Changeset 3987 for trunk/psLib/test/dataManip/tst_psMinimize06.c
- Timestamp:
- May 19, 2005, 12:50:05 PM (21 years ago)
- File:
-
- 1 edited
-
trunk/psLib/test/dataManip/tst_psMinimize06.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/test/dataManip/tst_psMinimize06.c
r3682 r3987 51 51 return(sum); 52 52 } 53 54 /***************************************************************************** 55 myFuncEAM(): This routine subtracts the associate value in expectedParm[] from 56 each parameter and then squares it, then sums that for all parameters, then 57 adds MIN_VALUE to it. The minimum for this function will be MIN_VALUE, and 58 will occur when each parameter equals the associated value in expectedParm[]. 59 60 This procedure ignores the coordinates, other than to ensure that they were 61 passed correctly from psMinimizePowell(). 62 63 *****************************************************************************/ 64 psVector *myFuncEAM(psImage *myDeriv, 65 psVector *myParams, 66 psArray *myCoords) 67 { 68 psVector *sum = psVectorAlloc(myCoords->n, PS_TYPE_F32); 69 psS32 i; 70 psS32 j; 71 72 73 if (myDeriv == NULL) { 74 myDeriv = psImageAlloc(myParams->n, myCoords->n, PS_TYPE_F32); 75 psError(PS_ERR_UNKNOWN, true, "myDeriv is NULL.\n"); 76 } 77 78 for (i=0;i<N;i++) { 79 sum->data.F32[i] = MIN_VALUE; 80 for (j=0;j<NUM_PARAMS;j++) { 81 sum->data.F32[i]+= (myParams->data.F32[j] - expectedParm[j]) * 82 (myParams->data.F32[j] - expectedParm[j]); 83 84 myDeriv->data.F32[i][j] = (2.0 * myParams->data.F32[j]) - 85 (2.0 * expectedParm[j]); 86 } 87 } 88 89 return(sum); 90 } 91 53 92 54 93 psS32 t01()
Note:
See TracChangeset
for help on using the changeset viewer.
