Changeset 2204 for trunk/psLib/src/math/psMinimize.c
- Timestamp:
- Oct 26, 2004, 2:57:34 PM (22 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/math/psMinimize.c (modified) (21 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/math/psMinimize.c
r2202 r2204 9 9 * @author GLF, MHPCC 10 10 * 11 * @version $Revision: 1.6 0$ $Name: not supported by cvs2svn $12 * @date $Date: 2004-10-2 6 23:14:04$11 * @version $Revision: 1.61 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2004-10-27 00:57:31 $ 13 13 * 14 14 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 59 59 *****************************************************************************/ 60 60 void p_psBuildSums1D(double x, 61 intpolyOrder,61 psS32 polyOrder, 62 62 psVector* sums) 63 63 { 64 inti = 0;64 psS32 i = 0; 65 65 double xSum = 0.0; 66 66 … … 101 101 "---- CalculateSecondDerivs() begin ----\n"); 102 102 103 inti;104 intk;105 bool mustFreeX = false;103 psS32 i; 104 psS32 k; 105 psBool mustFreeX = false; 106 106 float sig; 107 107 float p; 108 intn = y->n;108 psS32 n = y->n; 109 109 float *u = (float *) psAlloc(n * sizeof(float)); 110 110 float *derivs2 = (float *) psAlloc(n * sizeof(float)); … … 173 173 float X) 174 174 { 175 intn;176 intklo;177 intkhi;175 psS32 n; 176 psS32 klo; 177 psS32 khi; 178 178 float H; 179 179 float A; … … 240 240 psTrace(".psLib.dataManip.psVectorFitSpline1D", 4, 241 241 "---- psVectorFitSpline1D() begin ----\n"); 242 intnumSplines = (y->n)-1;242 psS32 numSplines = (y->n)-1; 243 243 float tmp; 244 244 float H; 245 inti;245 psS32 i; 246 246 float slope; 247 247 psVector *x32 = NULL; … … 416 416 the F64 port might be. 417 417 *****************************************************************************/ 418 bool psMinimizeLMChi2(psMinimization *min,419 psImage *covar,420 psVector *params,421 const psVector *paramMask,422 const psArray *x,423 const psVector *y,424 const psVector *yErr,425 psMinimizeLMChi2Func func)418 psBool psMinimizeLMChi2(psMinimization *min, 419 psImage *covar, 420 psVector *params, 421 const psVector *paramMask, 422 const psArray *x, 423 const psVector *y, 424 const psVector *yErr, 425 psMinimizeLMChi2Func func) 426 426 { 427 427 PS_CHECK_NULL_PTR_RETURN_NULL(min); … … 441 441 psTrace(".psLib.dataManip.psMinimizeLMChi2", 4, 442 442 "---- psMinimizeLMChi2() begin ----\n"); 443 intnumData = y->n;444 intnumParams = params->n;445 inti;446 intj;447 intk;448 intl;449 intn;450 intp;443 psS32 numData = y->n; 444 psS32 numParams = params->n; 445 psS32 i; 446 psS32 j; 447 psS32 k; 448 psS32 l; 449 psS32 n; 450 psS32 p; 451 451 psVector *beta = psVectorAlloc(numParams, PS_TYPE_F64); 452 452 psVector *perm = psVectorAlloc(numParams, PS_TYPE_F64); … … 663 663 const psVector* restrict yErr) 664 664 { 665 intj;666 intk;667 intn = x->n;665 psS32 j; 666 psS32 k; 667 psS32 n = x->n; 668 668 double fac; 669 669 double sum; … … 689 689 // are fitting this ChebyShev polynomial to. 690 690 691 for ( inti=0;i<n;i++) {691 for (psS32 i=0;i<n;i++) { 692 692 // NR 5.8.4 693 693 double Y = cos(M_PI * (0.5 + ((float) i)) / ((float) n)); … … 741 741 const psVector* restrict yErr) 742 742 { 743 intpolyOrder = myPoly->n;743 psS32 polyOrder = myPoly->n; 744 744 psImage* A = NULL; 745 745 psImage* ALUD = NULL; … … 748 748 psVector* X = NULL; // NOTE: do we need this? 749 749 psVector* coeffs = NULL; 750 inti = 0;751 intj = 0;752 intk = 0;750 psS32 i = 0; 751 psS32 j = 0; 752 psS32 k = 0; 753 753 psVector* xSums = NULL; 754 754 … … 853 853 const psVector* restrict yErr) 854 854 { 855 inti;855 psS32 i; 856 856 psPolynomial1D *tmpPoly; 857 857 PS_CHECK_NULL_1DPOLY_RETURN_NULL(myPoly); … … 908 908 /****************************************************************************** 909 909 *****************************************************************************/ 910 psMinimization *psMinimizationAlloc( intmaxIter,910 psMinimization *psMinimizationAlloc(psS32 maxIter, 911 911 float tol) 912 912 { … … 952 952 float fb = 0.0; 953 953 float fc = 0.0; 954 intiter = 100;954 psS32 iter = 100; 955 955 float aDir = 0.0; 956 956 float cDir = 0.0; … … 960 960 float stepSize = DETERMINE_BRACKET_STEP_SIZE; 961 961 psVector *tmp = NULL; 962 inti = 0;963 intnull = 0;962 psS32 i = 0; 963 psS32 null = 0; 964 964 965 965 psTrace(".psLib.dataManip.p_psDetermineBracket", 4, … … 1141 1141 psVector *tmpc = NULL; 1142 1142 psVector *tmpn = NULL; 1143 inti = 0;1144 intnull = 0;1143 psS32 i = 0; 1144 psS32 null = 0; 1145 1145 1146 1146 psTrace(".psLib.dataManip.p_psLineMin", 4, … … 1313 1313 XXX: Check for F32 types? 1314 1314 *****************************************************************************/ 1315 bool psMinimizePowell(psMinimization *min,1316 psVector *params,1317 const psVector *paramMask,1318 const psArray *coords,1319 psMinimizePowellFunc func)1315 psBool psMinimizePowell(psMinimization *min, 1316 psVector *params, 1317 const psVector *paramMask, 1318 const psArray *coords, 1319 psMinimizePowellFunc func) 1320 1320 { 1321 1321 PS_CHECK_NULL_VECTOR_RETURN_NULL(params); … … 1325 1325 PS_CHECK_NULL_PTR_RETURN_NULL(func); 1326 1326 1327 intnumDims = params->n;1328 inti = 0;1329 intj = 0;1327 psS32 numDims = params->n; 1328 psS32 i = 0; 1329 psS32 j = 0; 1330 1330 psVector **v = NULL; 1331 1331 psVector *pQP = NULL; … … 1337 1337 float baseFuncVal = 0.0; 1338 1338 float currFuncVal = 0.0; 1339 intbiggestIter = 0;1339 psS32 biggestIter = 0; 1340 1340 float biggestDiff = 0.0; 1341 1341 float term1 = 0.0; … … 1529 1529 float chi2 = 0.0; 1530 1530 float d; 1531 inti;1531 psS32 i; 1532 1532 psVector *tmp; 1533 1533 … … 1552 1552 psMinimizePowell(). 1553 1553 *****************************************************************************/ 1554 bool psMinimizeChi2Powell(psMinimization *min,1555 psVector *params,1556 const psVector *paramMask,1557 const psArray *coords,1558 const psVector *value,1559 const psVector *error,1560 psMinimizeChi2PowellFunc func)1554 psBool psMinimizeChi2Powell(psMinimization *min, 1555 psVector *params, 1556 const psVector *paramMask, 1557 const psArray *coords, 1558 const psVector *value, 1559 const psVector *error, 1560 psMinimizeChi2PowellFunc func) 1561 1561 { 1562 1562 myValue = (psVector *) value;
Note:
See TracChangeset
for help on using the changeset viewer.
