Changeset 4282 for trunk/psLib/src/dataManip/psMinimize.h
- Timestamp:
- Jun 15, 2005, 4:50:59 PM (21 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/dataManip/psMinimize.h (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/dataManip/psMinimize.h
r4243 r4282 8 8 * @author GLG, MHPCC 9 9 * 10 * @version $Revision: 1.4 4$ $Name: not supported by cvs2svn $11 * @date $Date: 2005-06-1 4 02:54:12$10 * @version $Revision: 1.45 $ $Name: not supported by cvs2svn $ 11 * @date $Date: 2005-06-16 02:50:59 $ 12 12 * 13 13 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 37 37 #include "psConstants.h" 38 38 39 /** A psMinimization data structure.39 /** A data structure for minimization routines. 40 40 * 41 41 * Contains numerical analysis parameters/values … … 82 82 /** Derive a one-dimensional spline fit. 83 83 * 84 * Given a psSpline1D data structure and a set of x,y vectors, this routine generates85 * the linear splines which satisfy those data points.84 * Given a psSpline1D data structure and a set of x,y vectors, this routine 85 * generates the linear splines which satisfy those data points. 86 86 * 87 87 * @return psSpline1D*: the calculated one-dimensional splines … … 94 94 ); 95 95 96 /** Defines a Levenberg-Marquardt function of a collection of parameters evaluated at a given position. 97 * 98 * @return psF64: a single floating-point value which is the value of the function given the parameters 99 * and coordinate vectors, along with the derivatives of the function with respect to each of the parameters. 96 /** Specifies the format of a user-defined function that the general Levenberg- 97 * Marquardt minimizer routine will accept. 98 * 99 * @return psF64: the single float value of the function given the parameters, 100 * positions, and derivatives. 100 101 */ 101 102 typedef … … 106 107 ); 107 108 108 /** Fits a specified function based on the Levenberg-Marquardt method.109 * 110 * @return psBool: True unless an error occurred.109 /** Minimizes a specified function based on the Levenberg-Marquardt method. 110 * 111 * @return psBool: True if successful. 111 112 */ 112 113 psBool psMinimizeLMChi2( 113 psMinimization *min, ///< 114 psImage *covar, ///< 115 psVector *params, ///< 116 const psVector *paramMask, ///< 117 const psArray *x, ///< 118 const psVector *y, ///< 119 const psVector *yErr, ///< 120 psMinimizeLMChi2Func func ///< 121 ); 122 123 /** 124 * 125 * 126 * @return psBool: True if 114 psMinimization *min, ///< Minimization specification 115 psImage *covar, ///< Covariance matrix 116 psVector *params, ///< "Best Guess" for the parameters that minimize func 117 const psVector *paramMask, ///< Parameters to be held fixed by the minimizer 118 const psArray *x, ///< Measurement ordinates of multiple vectors 119 const psVector *y, ///< Measurement coordinates 120 const psVector *yErr, ///< Errors in the measurement coordinates 121 psMinimizeLMChi2Func func ///< Specified function 122 ); 123 124 /** Use specified alpha, beta, params to generate a new guess for Alpha, Beta, Params 125 * 126 * @return psBool: True if successful. 127 127 */ 128 128 psBool p_psMinLM_GuessABP( 129 psImage *Alpha, ///< 130 psVector *Beta, ///< 131 psVector *Params, ///< 132 psImage *alpha, ///< 133 psVector *beta, ///< 134 psVector *params, ///< 135 psF64 lambda ///< 136 ); 137 138 /** 139 * 140 * 141 * @return psF64: 129 psImage *Alpha, ///< New Alpha guess 130 psVector *Beta, ///< New Beta guess 131 psVector *Params, ///< New Params guess 132 psImage *alpha, ///< Old Alpha guess 133 psVector *beta, ///< Old Beta guess 134 psVector *params, ///< Old Params guess 135 psF64 lambda ///< Factor used in update //XXX Got Better Desc? 136 ); 137 138 /** Function used to set parameters for generating "best guess" in minimizing Chi-Squared value. 139 * 140 * @return psF64: Chi-squared value for new guess 142 141 */ 143 142 psF64 p_psMinLM_SetABX ( 144 psImage *alpha, ///< 145 psVector *beta, ///< 146 psVector *params, ///< 147 const psArray *x, ///< 148 const psVector *y, ///< 149 const psVector *dy, ///< 150 psMinimizeLMChi2Func func); ///< 151 152 /** 153 * 154 * 155 * @return psF32: 143 psImage *alpha, ///< alpha guess 144 psVector *beta, ///< beta guess 145 psVector *params, ///< params guess 146 const psArray *x, ///< Measurement ordinates 147 const psVector *y, ///< Measurement coordinates 148 const psVector *dy, ///< Weights calculated from y-errors 149 psMinimizeLMChi2Func func); ///< Specified function 150 151 /** Specifies the format of a user-defined function that the general Powell 152 * minimizer routine will accept. 153 * 154 * @return psF32: the single float value of the function given the parameters 155 * and coordinate vectors. 156 156 */ 157 157 typedef 158 158 psF32 (*psMinimizePowellFunc)( 159 const psVector *params, ///< 160 const psArray *coords ///< 161 ); 162 163 164 /** 165 * 159 const psVector *params, ///< Parameters used to evaluate the function 160 const psArray *coords ///< Coordinates at which to evaluate 161 ); 162 163 /** Minimizes a specified function based on the Powell method. 164 * 165 * @return psBool: True if successful. 166 */ 167 psBool psMinimizePowell( 168 psMinimization *min, ///< Minimization specification 169 psVector *params, ///< "Best guess" for parameters that minimize func 170 const psVector *paramMask, ///< Parameters to be held fixed by minimizer 171 const psArray *coords, ///< Measurement coordinates 172 psMinimizePowellFunc func ///< Specified function 173 ); 174 175 /** Calculates the one-dimensional Gaussian in a format acceptable to the Levenberg- 176 * Marquardt minimizer routine. 166 177 * 167 * @return psBool: True if 168 */ 169 psBool psMinimizePowell( 170 psMinimization *min, ///< 171 psVector *params, ///< 172 const psVector *paramMask, ///< 173 const psArray *coords, ///< 174 psMinimizePowellFunc func ///< 175 ); 176 177 /** 178 * 179 * 180 * @return psVector*: 178 * @return psVector*: Calculated values 181 179 */ 182 180 psVector *psMinimizeLMChi2Gauss1D( 183 psImage *deriv, ///< 184 const psVector *params, ///< 185 const psArray *coords ///< 186 ); 187 188 /** 189 * 190 * 191 * @return psVector*: 181 psImage *deriv, ///< Derivative Matrix 182 const psVector *params, ///< Parameters used in evaluation 183 const psArray *coords ///< Measurement coordinates 184 ); 185 186 /** Calculates the one-dimensional Gaussian in a format acceptable to the Powell 187 * chi-squared minimizer routine. 188 * 189 * @return psVector*: Calculated values 192 190 */ 193 191 psVector *psMinimizePowellChi2Gauss1D( 194 const psVector *params, ///< 195 const psArray *coords ///< 196 ); 197 198 /** 199 * 200 * 201 * 192 const psVector *params, ///< Parameters used in evaluation 193 const psArray *coords ///< Measurement coordinates 194 ); 195 196 /** Specifies the format of a user-defined function that the general Powell chi- 197 * squared minimizer routine will accept. 198 * 199 * @return psVector*: Calculated values given the parameters and coordinates. 202 200 */ 203 201 typedef 204 202 psVector *(*psMinimizeChi2PowellFunc)( 205 const psVector *params, ///< 206 const psArray *coords ///< 207 ); 208 209 210 /** 211 * 203 const psVector *params, ///< Parameters used to evaluate the function 204 const psArray *coords ///< Coordinates at which to evaluate 205 ); 206 207 /** Minimizes a specified function based on the Powell chi-squared method. 212 208 * 213 * @return psBool: True i f209 * @return psBool: True is successful. 214 210 */ 215 211 psBool psMinimizeChi2Powell( 216 psMinimization *min, ///< 217 psVector *params, ///< 218 const psVector *paramMask, ///< 219 const psArray *coords, ///< 220 const psVector *value, ///< 221 const psVector *error, ///< 222 psMinimizeChi2PowellFunc func ///< 223 ); 224 225 /** 226 * 227 * 228 * @return bool: True if 212 psMinimization *min, ///< Minimization specification 213 psVector *params, ///< "Best guess" for parameters that minimize func 214 const psVector *paramMask, ///< Parameters to be held fixed by minimizer 215 const psArray *coords, ///< Measurement coordinates 216 const psVector *value, ///< Measured values at the coordinates 217 const psVector *error, ///< Errors in the measure values (or NULL) 218 psMinimizeChi2PowellFunc func ///< Specified function 219 ); 220 221 /** Gauss-Jordan numerical solver. 222 * 223 * @return bool: True if successful. 229 224 */ 230 225 bool psGaussJordan( 231 psImage *a, ///< 232 psVector *b ///< 226 psImage *a, ///< Matrix to be solved 227 psVector *b ///< Vector of values 233 228 ); 234 229
Note:
See TracChangeset
for help on using the changeset viewer.
