Changeset 28634 for trunk/psLib/src/math/psMinimizePowell.c
- Timestamp:
- Jul 7, 2010, 6:31:37 PM (16 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/math/psMinimizePowell.c (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/math/psMinimizePowell.c
r21183 r28634 83 83 f(param + b * line) < f(param + c * line) 84 84 a < b < c 85 85 86 86 Algorithm: 87 87 88 88 XXX completely ad hoc: 89 89 start with the user-supplied starting parameter and 90 90 call that b. Calculate a/c as a fractional amount smaller/larger than b. 91 91 Repeat this process until a local minimum is found. 92 92 93 93 XXX: new algorithm: 94 94 start at x=0, expand in one direction until the function … … 96 96 increases, or x is too large. If thst does not work, expand in the other 97 97 direction. 98 98 99 99 XXX: output bracket vector should be an input as well. 100 100 *****************************************************************************/ … … 335 335 along that vector and returns the offset along that vector at which the 336 336 minimum is determined. 337 337 338 338 XXX: This routine is not very efficient in terms of total evaluations of the 339 339 function. … … 491 491 points at which the function is varied are in the argument "coords" which is 492 492 a psArray of psVectors: each vector represents a different coordinate. 493 493 494 494 XXX: We do not use Brent's method. 495 495 *****************************************************************************/ … … 707 707 This routine is to be used with the psMinimizeChi2Powell() function below. 708 708 and the psMinimizePowell() function above. 709 709 710 710 The basic idea is calculate chi-squared for a set of params/coords/errors. 711 711 This functions uses global variables to receive the function pointer, the … … 762 762 This routine must minimize the chi-squared match of a set of data points and 763 763 values for a possibly multi-dimensional function. 764 764 765 765 The basic idea is to use the psMinimizePowell() function defined above. In 766 766 order to do so, we defined above a function myPowellChi2Func() which takes … … 789 789 newCoords->data[coords->n + 2] = &model; 790 790 791 bool success = psMinimizePowell(min, params, constraint->paramMask, newCoords, myPowellChi2Func); 791 bool success = psMinimizePowell(min, params, constraint ? constraint->paramMask : NULL, 792 newCoords, myPowellChi2Func); 792 793 793 794 newCoords->data[coords->n - 1] = NULL; // We can't free the array with a function pointer on it
Note:
See TracChangeset
for help on using the changeset viewer.
