IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Sep 20, 2004, 1:43:53 PM (22 years ago)
Author:
gusciora
Message:

Removed obsolete prototypes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/math/psMinimize.h

    r1831 r1837  
    33 *  @ingroup Math
    44 *
    5  *  This file will contain function prototypes...
     5 *  This file will contain function prototypes for various minimization,
     6 *  chi-squared minimization, and 1-D polynomial fitting routines.
    67 *
    78 *  @author George Gusciora, MHPCC
    89 *
    9  *  @version $Revision: 1.23 $ $Name: not supported by cvs2svn $
    10  *  @date $Date: 2004-09-18 01:50:45 $
     10 *  @version $Revision: 1.24 $ $Name: not supported by cvs2svn $
     11 *  @date $Date: 2004-09-20 23:43:53 $
    1112 *
    1213 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    2627 *  \ingroup Stats
    2728 */
    28 
    29 /** Functions **************************************************************/
    30 
    3129/** \addtogroup Stats
    3230 *  \{
    3331 */
    3432
    35 /** function of a collection of parameters and coordinate vector.
    36  *
    37  *  @return float    value to minimize
    38  */
    39 typedef float (*psMinimizeFunction)(
    40     const psVector* restrict params,   ///< collection of parameters
    41     const psVector* restrict coord     ///< coordinates
    42 );
     33typedef struct
     34{
     35    int maxIter;                       ///< Convergence limit
     36    float tol;                         ///< Error Tolerance
     37    float value;                       ///< Value of function at minimum
     38    int iter;                          ///< Number of iterations required
     39    float lastDelta;                   ///< The last difference for the fit
     40}
     41psMinimization;
    4342
    44 /** derivative function of psMinimizeFunction
    45  *
    46  *  @return float     the derivative in respect to params[derivParam]
    47  */
    48 typedef float (*psMinimizeFunctionDeriv) (
    49     const psVector* restrict params,   ///< collection of parameters
    50     const psVector* restrict coord,    ///< coordinates
    51     int derivParam                     ///< index of parameter to calculate derivative of
    52 );
    53 
    54 /** Minimizes a non-linear function.
    55  *
    56  *  psMinimize determines and returns the vector that minimizes the specified
    57  *  function. It takes as input a function, myFunction, an initial guess for
    58  *  the vector that minimizes the function, initialGuess, the current
    59  *  coordiate coord, and an optional mask for the vector elements (function
    60  *  parameters) to minimize, paramMask (all parameters are fit if PSLib SDRS
    61  *  25 July 13, 2004 Pan-STARRS Image Processing Pipeline PSDC-430-007-04
    62  *  NULL). Note that paramMask must be of type psU8, while params must be of
    63  *  type psF32. The optional function, myFuncDeriv returns the derivative of
    64  *  the function. This function must be valid only for types psF32, psF64.
    65  *
    66  *  @return psVector*    minimized vector
    67  */
    68 psVector* psMinimize(
    69     psVector* restrict initialGuess,
    70     psMinimizeFunction myFunction,
    71     psMinimizeFunctionDeriv myFunctionDeriv,
    72     const psVector* restrict coord,
    73     const psVector* restrict paramMask
    74 );
    75 
    76 /** Minimize chi^2 for input data.
    77  *
    78  *  psMinimizeChi2 fits a model to observations by minimizing chi^2, returning
    79  *  the best-fit parameters. The input parameters are a function that
    80  *  evaluates the model for a specified domain, given the parameters,
    81  *  evalModel; a list of observations, (domain, data, and errors); an initial
    82  *  guess at the best-fit parameters, initialGuess which is returned with the
    83  *  best-fit parameters, and an optional mask specifying which parameters are
    84  *  to be fit, paramMask, which must be of type psU8. All parameters are fit
    85  *  if this vector is NULL. This function must be valid only for types psF32,
    86  *  psF64.
    87  *
    88  *  @return psVector*      minimized vector
    89  */
    90 psVector* psMinimizeChi2(
    91     psMinimizeFunction evalModel,      ///< Model to fit; (domain and params)
    92     psMinimizeFunctionDeriv DevalModel,///< Derivative of model to fit; (domain and params)
    93     const psImage* restrict domain,    ///< The domain values for the corresponding measurements
    94     const psVector* restrict data,     ///< Data to fit
    95     const psVector* restrict errors,   ///< Errors in the data
    96     psVector* restrict initialGuess,   ///< Initial guess
    97     const psVector* restrict paramMask,///< 1 = fit for parameter, 0 = hold parameter constant
    98     float *chiSq                       ///< chi squared
    99 );
     43psMinimization *psMinimizationAlloc(int maxIter,
     44                                    float tol);
    10045
    10146/** Derive a polynomial fit by chi^2 minimisation (analytically)
     
    11964);
    12065
    121 typedef struct
    122 {
    123     int maxIter;   ///< Convergence limit
    124     float tol;    ///< Error Tolerance
    125     float value;   ///< Value of function at minimum
    126     int iter;    ///< Number of iterations required
    127     float lastDelta;   ///< The last difference for the fit
    128 }
    129 psMinimization;
    130 
    131 psMinimization *psMinimizationAlloc(int maxIter, float tol);
    132 
    133 
    134 
    135 typedef float (*psMinimizeLMFunc) (psVector *deriv,
    136                                    const psVector *params,
    137                                    const psArray *coords);
    138 
    139 typedef float (*psMinimizeLMChi2Func) (psVector *deriv,
    140                                        const psVector *params,
    141                                        const psVector *coords);
    142 
    143 bool psMinimizeLM(psMinimization *min,
    144                   psImage *covar,
    145                   psVector *params,
    146                   const psVector *paramMask,
    147                   const psArray *coords,
    148                   psMinimizeLMFunc func);
     66typedef
     67float (*psMinimizeLMChi2Func)(psVector *deriv,
     68                              const psVector *params,
     69                              const psVector *coords);
    14970
    15071bool psMinimizeLMChi2(psMinimization *min,
     
    15677                      psMinimizeLMChi2Func func);
    15778
    158 
    159 
    160 typedef float (*psMinimizePowellFunc) (const psVector *params,
    161                                        const psArray *coords);
     79typedef
     80float (*psMinimizePowellFunc)(const psVector *params,
     81                              const psArray *coords);
    16282
    16383bool psMinimizePowell(psMinimization *min,
     
    16787                      psMinimizePowellFunc func);
    16888
    169 typedef psVector* (*psMinimizeChi2PowellFunc) (const psVector *params,
    170         const psArray *coords);
     89typedef
     90psVector *(*psMinimizeChi2PowellFunc)(const psVector *params,
     91                                      const psArray *coords);
    17192
    17293bool psMinimizeChi2Powell(psMinimization *min,
     
    17899                          psMinimizeChi2PowellFunc func);
    179100
    180 
    181 bool psMinimize1DFunc(psMinimization *min,
    182                       psVector *params,
    183                       int dim,
    184                       const psArray *coords,
    185                       psMinimizePowellFunc func);
    186 
    187 float psLineMin(psMinimization *min,
    188                 psVector *params,
    189                 psVector *line,
    190                 const psVector *paramMask,
    191                 const psArray *coords,
    192                 psMinimizePowellFunc func);
    193 
    194 
    195101/* \} */// End of MathGroup Functions
    196102
Note: See TracChangeset for help on using the changeset viewer.