Changeset 6202
- Timestamp:
- Jan 26, 2006, 9:07:53 AM (20 years ago)
- File:
-
- 1 edited
-
trunk/psLib/test/math/tst_psMinimize06.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/test/math/tst_psMinimize06.c
r5183 r6202 29 29 psVector *x) 30 30 { 31 if ((deriv == NULL) || (params == NULL) ) {32 psError(PS_ERR_UNKNOWN, true, "deriv or params is NULL.\n");31 if ((deriv == NULL) || (params == NULL) || (x == NULL)) { 32 psError(PS_ERR_UNKNOWN, true, "deriv or params or x is NULL.\n"); 33 33 } 34 34 … … 51 51 { 52 52 psS32 currentId = psMemGetId(); 53 psTraceSetLevel(".psLib", 0); 54 /************************************************************************** 55 *************************************************************************/ 53 56 54 psMinimization *min = psMinimizationAlloc(NUM_ITERATIONS, ERR_TOL); 57 55 psImage *myCovar = psImageAlloc(NUM_PARAMS, NUM_PARAMS, PS_TYPE_F32); … … 74 72 } 75 73 76 psBool rc = psMinimizeLMChi2(min, 77 NULL, 78 myParams, 79 NULL, 80 myCoords, 81 y, 82 NULL, 74 psBool rc = psMinimizeLMChi2(min, NULL, myParams, NULL, myCoords, y, NULL, 83 75 (psMinimizeLMChi2Func) myFunc); 84 76 if (rc == false) { … … 89 81 printf("\nThe value of the function at the minimum is %f\n", min->value); 90 82 for (psS32 i=0;i<NUM_DATA_POINTS;i++) { 91 printf("The minimum for data point %d: %f\n", i, myFunc(myDerivs, myParams, (psVector *) myCoords->data[i])); 83 printf("The minimum for data point number %d: f is %.2f\n", 84 i, myFunc(myDerivs, myParams, (psVector *) myCoords->data[i])); 92 85 fflush(stdout); 93 86 }
Note:
See TracChangeset
for help on using the changeset viewer.
