Index: trunk/psLib/test/dataManip/tst_psMinimize06.c
===================================================================
--- trunk/psLib/test/dataManip/tst_psMinimize06.c	(revision 3987)
+++ trunk/psLib/test/dataManip/tst_psMinimize06.c	(revision 4141)
@@ -15,74 +15,22 @@
 
 /*****************************************************************************
-myFunc(): This routine subtracts the associate value in expectedParm[] from
-each parameter and then squares it, then sums that for all parameters, then
-adds MIN_VALUE to it.  The minimum for this function will be MIN_VALUE, and
-will occur when each parameter equals the associated value in expectedParm[].
- 
-This procedure ignores the coordinates, other than to ensure that they were
-passed correctly from psMinimizePowell().
- 
+myFunc():
+    sum = (param[0] * x[0]) + 
+          (param[1] * x[1]) +
+          ...
  *****************************************************************************/
-psVector *myFunc(psImage *myDeriv,
-                 psVector *myParams,
-                 psArray *myCoords)
+psF64 myFunc(psVector *deriv,
+             psVector *params,
+             psVector *x)
 {
-    psVector *sum = psVectorAlloc(myCoords->n, PS_TYPE_F32);
-    psS32 i;
-    psS32 j;
-
-
-    if (myDeriv == NULL) {
-        myDeriv = psImageAlloc(myParams->n, myCoords->n, PS_TYPE_F32);
-        psError(PS_ERR_UNKNOWN, true, "myDeriv is NULL.\n");
+    if ((deriv == NULL) ||
+            (params == NULL)) {
+        psError(PS_ERR_UNKNOWN, true, "deriv or params is NULL.\n");
     }
 
-    for (i=0;i<N;i++) {
-        sum->data.F32[i] = MIN_VALUE;
-        for (j=0;j<NUM_PARAMS;j++) {
-            sum->data.F32[i]+= (myParams->data.F32[j] - expectedParm[j]) *
-                               (myParams->data.F32[j] - expectedParm[j]);
-
-            myDeriv->data.F32[i][j] = (2.0 * myParams->data.F32[j]) -
-                                      (2.0 * expectedParm[j]);
-        }
-    }
-
-    return(sum);
-}
-
-/*****************************************************************************
-myFuncEAM(): This routine subtracts the associate value in expectedParm[] from
-each parameter and then squares it, then sums that for all parameters, then
-adds MIN_VALUE to it.  The minimum for this function will be MIN_VALUE, and
-will occur when each parameter equals the associated value in expectedParm[].
- 
-This procedure ignores the coordinates, other than to ensure that they were
-passed correctly from psMinimizePowell().
- 
- *****************************************************************************/
-psVector *myFuncEAM(psImage *myDeriv,
-                    psVector *myParams,
-                    psArray *myCoords)
-{
-    psVector *sum = psVectorAlloc(myCoords->n, PS_TYPE_F32);
-    psS32 i;
-    psS32 j;
-
-
-    if (myDeriv == NULL) {
-        myDeriv = psImageAlloc(myParams->n, myCoords->n, PS_TYPE_F32);
-        psError(PS_ERR_UNKNOWN, true, "myDeriv is NULL.\n");
-    }
-
-    for (i=0;i<N;i++) {
-        sum->data.F32[i] = MIN_VALUE;
-        for (j=0;j<NUM_PARAMS;j++) {
-            sum->data.F32[i]+= (myParams->data.F32[j] - expectedParm[j]) *
-                               (myParams->data.F32[j] - expectedParm[j]);
-
-            myDeriv->data.F32[i][j] = (2.0 * myParams->data.F32[j]) -
-                                      (2.0 * expectedParm[j]);
-        }
+    psF64 sum = 0.0;
+    for (psS32 i=0 ; i < params->n ; i++) {
+        sum += (params->data.F32[i] * x->data.F32[i]);
+        deriv->data.F32[i] = params->data.F32[i];
     }
 
@@ -121,6 +69,6 @@
         myParams->data.F32[i] = (float) i;
         myParams->data.F32[i] = expectedParm[i] * 1.3;
+        myParams->data.F32[i] = 0.0;
         myParams->data.F32[i] = (float) (5 + i);
-        myParams->data.F32[i] = 0.0;
     }
 
