Changeset 1847 for trunk/psLib/src/math/psMinimize.c
- Timestamp:
- Sep 21, 2004, 4:42:20 PM (22 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/math/psMinimize.c (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/math/psMinimize.c
r1846 r1847 1 M/** @file psMinimize.c1 /** @file psMinimize.c 2 2 * \brief basic minimization functions 3 3 * @ingroup Math … … 9 9 * @author George Gusciora, MHPCC 10 10 * 11 * @version $Revision: 1.4 2$ $Name: not supported by cvs2svn $12 * @date $Date: 2004-09-22 0 1:30:21$11 * @version $Revision: 1.43 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2004-09-22 02:42:20 $ 13 13 * 14 14 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 162 162 const psVector* restrict y) ///< Coordinates 163 163 { 164 psTrace(".psLib.dataManip.CalculateSecondDerivs", 4, 165 "---- CalculateSecondDerivs() begin ----\n"); 166 164 167 int i; 165 168 int k; … … 194 197 u[i] = (Y[i+1] - Y[i])/(X[i+1]-X[i]) - (Y[i]-Y[i-1])/(X[i]-X[i-1]); 195 198 u[i] = (6.0 * u[i] / (X[i+1] - X[i-1]) - sig * u[i-1]) / p; 199 200 psTrace(".psLib.dataManip.CalculateSecondDerivs", 6, 201 "X[%d] is %f\n", i, X[i]); 202 psTrace(".psLib.dataManip.CalculateSecondDerivs", 6, 203 "Y[%d] is %f\n", i, Y[i]); 204 psTrace(".psLib.dataManip.CalculateSecondDerivs", 6, 205 "u[%d] is %f\n", i, u[i]); 196 206 } 197 207 198 208 for (k=(n-2);k>=0;k--) { 199 209 derivs2[k] = derivs2[k] * derivs2[k+1] + u[k]; 200 } 201 202 203 204 205 206 207 208 209 210 /* 211 if (mustFreeX == true) { 212 psFree(X); 213 } 214 */ 210 psTrace(".psLib.dataManip.CalculateSecondDerivs", 6, 211 "derivs2[%d] is %f\n", k, derivs2[k]); 212 } 213 if (mustFreeX == true) { 214 psFree(X); 215 } 215 216 psFree(u); 216 217 218 psTrace(".psLib.dataManip.CalculateSecondDerivs", 4, 219 "---- CalculateSecondDerivs() end ----\n"); 217 220 return(derivs2); 218 221 } … … 249 252 const psVector* restrict yErr) ///< Errors in coordinates, or NULL 250 253 { 254 psTrace(".psLib.dataManip.psVectorFitSpline1D", 4, 255 "---- psVectorFitSpline1D() begin ----\n"); 251 256 int numSplines = (y->n)-1; 252 257 float tmp; … … 261 266 for (i=0;i<numSplines;i++) { 262 267 H = x->data.F32[i+1] - x->data.F32[i]; 268 psTrace(".psLib.dataManip.psVectorFitSpline1D", 4, 269 "X data (%f - %f) (%f)\n", x->data.F32[i], x->data.F32[i+1], H); 263 270 // 264 271 // ******** Calulate 0-order term ******** … … 309 316 // 310 317 // From (3) 311 (mySpline->spline[i])->coeff[ 2] = -((mySpline->p_psDeriv2)[i]) / (6.0 * H);318 (mySpline->spline[i])->coeff[3] = -((mySpline->p_psDeriv2)[i]) / (6.0 * H); 312 319 // From (4) 313 (mySpline->spline[i])->coeff[2]+= ((mySpline->p_psDeriv2)[i+1]) / (6.0 * H); 314 } 315 316 317 318 319 320 321 322 323 320 (mySpline->spline[i])->coeff[3]+= ((mySpline->p_psDeriv2)[i+1]) / (6.0 * H); 321 322 psTrace(".psLib.dataManip.psMinimizeLMChi2", 6, 323 "(mySpline->spline[%d])->coeff[0] is %f\n", i, (mySpline->spline[i])->coeff[0]); 324 psTrace(".psLib.dataManip.psMinimizeLMChi2", 6, 325 "(mySpline->spline[%d])->coeff[1] is %f\n", i, (mySpline->spline[i])->coeff[1]); 326 psTrace(".psLib.dataManip.psMinimizeLMChi2", 6, 327 "(mySpline->spline[%d])->coeff[2] is %f\n", i, (mySpline->spline[i])->coeff[2]); 328 psTrace(".psLib.dataManip.psMinimizeLMChi2", 6, 329 "(mySpline->spline[%d])->coeff[3] is %f\n", i, (mySpline->spline[i])->coeff[3]); 330 331 } 332 333 psTrace(".psLib.dataManip.psVectorFitSpline1D", 4, 334 "---- psVectorFitSpline1D() end ----\n"); 324 335 return(mySpline); 325 336 } … … 559 570 return(false); 560 571 } 561 562 563 564 565 566 567 568 569 570 571 572 573 572 574 573 /******************************************************************************
Note:
See TracChangeset
for help on using the changeset viewer.
