Index: trunk/psLib/test/dataManip/tst_psMinimize06.c
===================================================================
--- trunk/psLib/test/dataManip/tst_psMinimize06.c	(revision 3682)
+++ trunk/psLib/test/dataManip/tst_psMinimize06.c	(revision 3987)
@@ -51,4 +51,43 @@
     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]);
+        }
+    }
+
+    return(sum);
+}
+
 
 psS32 t01()
