Changeset 3987
- Timestamp:
- May 19, 2005, 12:50:05 PM (21 years ago)
- Location:
- trunk/psLib/test/dataManip
- Files:
-
- 2 edited
-
tst_psFunc08.c (modified) (1 diff)
-
tst_psMinimize06.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/test/dataManip/tst_psFunc08.c
r3682 r3987 4 4 * ORD and CHEB type polynomials. 5 5 * 6 * @version $Revision: 1.2 $ $Name: not supported by cvs2svn $ 7 * @date $Date: 2005-04-07 20:27:42 $ 6 * @version $Revision: 1.3 $ $Name: not supported by cvs2svn $ 7 * @date $Date: 2005-05-19 22:50:05 $ 8 * 9 * XXX: Probably should test single- and multi-dimensional polynomials in 10 * which one diminsion is constant (n == 1). 8 11 * 9 12 * Copyright 2004-2005 Maui High Performance Computing Center, Univ. of Hawaii -
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.
