IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 28634


Ignore:
Timestamp:
Jul 7, 2010, 6:31:37 PM (16 years ago)
Author:
Paul Price
Message:

Allow NULL constraint.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/math/psMinimizePowell.c

    r21183 r28634  
    8383f(param + b * line) < f(param + c * line)
    8484a < b < c
    85  
     85
    8686Algorithm:
    87  
     87
    8888XXX completely ad hoc:
    8989start with the user-supplied starting parameter and
    9090call that b.  Calculate a/c as a fractional amount smaller/larger than b.
    9191Repeat this process until a local minimum is found.
    92  
     92
    9393XXX: new algorithm:
    9494start at x=0, expand in one direction until the function
     
    9696increases, or x is too large.  If thst does not work, expand in the other
    9797direction.
    98  
     98
    9999XXX: output bracket vector should be an input as well.
    100100*****************************************************************************/
     
    335335along that vector and returns the offset along that vector at which the
    336336minimum is determined.
    337  
     337
    338338XXX: This routine is not very efficient in terms of total evaluations of the
    339339function.
     
    491491points at which the function is varied are in the argument "coords" which is
    492492a psArray of psVectors: each vector represents a different coordinate.
    493  
     493
    494494XXX: We do not use Brent's method.
    495495 *****************************************************************************/
     
    707707This routine is to be used with the psMinimizeChi2Powell() function below.
    708708and the psMinimizePowell() function above.
    709  
     709
    710710The basic idea is calculate chi-squared for a set of params/coords/errors.
    711711This functions uses global variables to receive the function pointer, the
     
    762762This routine must minimize the chi-squared match of a set of data points and
    763763values for a possibly multi-dimensional function.
    764  
     764
    765765The basic idea is to use the psMinimizePowell() function defined above.  In
    766766order to do so, we defined above a function myPowellChi2Func() which takes
     
    789789    newCoords->data[coords->n + 2] = &model;
    790790
    791     bool success = psMinimizePowell(min, params, constraint->paramMask, newCoords, myPowellChi2Func);
     791    bool success = psMinimizePowell(min, params, constraint ? constraint->paramMask : NULL,
     792                                    newCoords, myPowellChi2Func);
    792793
    793794    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.