Changeset 10252 for trunk/psLib/src/math/psMinimizeLMM.h
- Timestamp:
- Nov 28, 2006, 4:17:15 PM (19 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/math/psMinimizeLMM.h (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/math/psMinimizeLMM.h
r7766 r10252 8 8 * @author GLG, MHPCC 9 9 * 10 * @version $Revision: 1. 6$ $Name: not supported by cvs2svn $11 * @date $Date: 2006- 06-30 02:20:06$10 * @version $Revision: 1.7 $ $Name: not supported by cvs2svn $ 11 * @date $Date: 2006-11-29 02:17:15 $ 12 12 * 13 13 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 41 41 #define PS_MAX_LMM_ITERATIONS 100 42 42 #define PS_MAX_MINIMIZE_ITERATIONS 100 43 #define P_PSMINIMIZATION_SET_MAXITER(m,val) *(int*)&m->maxIter = val 44 #define P_PSMINIMIZATION_SET_TOL(m,val) *(float*)&m->tol = val 45 46 typedef enum { 47 PS_MINIMIZE_BETA_LIMIT, 48 PS_MINIMIZE_PARAM_MIN, 49 PS_MINIMIZE_PARAM_MAX 50 } psMinConstraintMode; 51 52 /** Specifies the format of a user-defined function that the general Levenberg- 53 * Marquardt minimizer routine will accept. 54 * 55 * @return float: the single float value of the function given the parameters, 56 * positions, and derivatives. 57 */ 58 typedef 59 float (*psMinimizeLMChi2Func)( 60 psVector *deriv, ///< derivatives of the function 61 const psVector *params, ///< the parameters used to evaluate the function 62 const psVector *x ///< positions for evaluation 63 ); 64 65 /** Specifies the format of a user-defined function which check the parameters 66 * against the allowed limits. used by the general Levenberg-Marquardt minimizer. 67 * 68 * @return float: the single float value of the function given the parameters, 69 * positions, and derivatives. 70 */ 71 typedef 72 bool (*psMinimizeLMLimitFunc)( 73 psMinConstraintMode mode, ///< which limit to check 74 int nParam, ///< which param to check 75 float *params, ///< current param value set 76 float *beta ///< current beta value, if needed 77 ); 43 78 44 79 /** A data structure for minimization routines. … … 56 91 psMinimization; 57 92 58 59 93 /** A data structure for minimization routines. 60 94 * … … 64 98 { 65 99 psVector *paramMask; ///< valid / invalid parameters 66 psVector *paramMax; ///< max allowed parameters 67 psVector *paramMin; ///< min allowed parameters 68 psVector *paramDelta; ///< max allowed param swing 100 psMinimizeLMLimitFunc checkLimits; ///< user-supplied function to test the parameter limits 69 101 } 70 psMinConstrain ;102 psMinConstraint; 71 103 72 psMinConstrain *psMinConstrainAlloc();104 psMinConstraint *psMinConstraintAlloc(); 73 105 74 #define P_PSMINIMIZATION_SET_MAXITER(m,val) *(int*)&m->maxIter = val 75 #define P_PSMINIMIZATION_SET_TOL(m,val) *(float*)&m->tol = val 76 77 /** Allocates a psMinimization structure. 78 * 79 * @return psMinimization* : a new psMinimization struct 80 */ 81 psMinimization *psMinimizationAlloc( 82 int maxIter, ///< Number of minimization iterations to perform. 83 float tol ///< Requested error tolerance 84 ); 106 /** Allocates a psMinimization structure. 107 * 108 * @return psMinimization* : a new psMinimization struct 109 */ 110 psMinimization *psMinimizationAlloc( 111 int maxIter, ///< Number of minimization iterations to perform. 112 float tol ///< Requested error tolerance 113 ); 85 114 86 115 /* Checks the type of a particular pointer. … … 94 123 ); 95 124 96 97 /** Specifies the format of a user-defined function that the general Levenberg-98 * Marquardt minimizer routine will accept.99 *100 * @return float: the single float value of the function given the parameters,101 * positions, and derivatives.102 */103 typedef104 float (*psMinimizeLMChi2Func)(105 psVector *deriv, ///< derivatives of the function106 const psVector *params, ///< the parameters used to evaluate the function107 const psVector *x ///< positions for evaluation108 );109 110 125 /** Minimizes a specified function based on the Levenberg-Marquardt method. 111 126 * … … 116 131 psImage *covar, ///< Covariance matrix 117 132 psVector *params, ///< "Best Guess" for the parameters that minimize func 118 psMinConstrain *constrain,///< Constraints on the parameters133 psMinConstraint *constraint, ///< Constraints on the parameters 119 134 const psArray *x, ///< Measurement ordinates of multiple vectors 120 135 const psVector *y, ///< Measurement coordinates … … 135 150 /** Function used to set parameters for generating "best guess" in minimizing Chi-Squared value. 136 151 * 137 * @return psF 64: Chi-squared value for new guess152 * @return psF32: Chi-squared value for new guess 138 153 */ 139 psF 64p_psMinLM_SetABX (154 psF32 p_psMinLM_SetABX ( 140 155 psImage *alpha, ///< alpha guess 141 156 psVector *beta, ///< beta guess … … 149 164 150 165 166 psBool p_psMinLM_GuessABP( 167 psImage *Alpha, 168 psVector *Beta, 169 psVector *Params, 170 const psImage *alpha, 171 const psVector *beta, 172 const psVector *params, 173 const psVector *paramMask, 174 psMinimizeLMLimitFunc checkLimits, 175 psF32 lambda 176 ); 177 151 178 /* \} */// End of MathGroup Functions 152 153 154 155 179 156 180 #endif // #ifndef PS_MINIMIZE_LMM_H
Note:
See TracChangeset
for help on using the changeset viewer.
