Index: /trunk/psLib/src/math/psMinimizePowell.c
===================================================================
--- /trunk/psLib/src/math/psMinimizePowell.c	(revision 6419)
+++ /trunk/psLib/src/math/psMinimizePowell.c	(revision 6420)
@@ -9,6 +9,8 @@
  *  @author GLG, MHPCC
  *
- *  @version $Revision: 1.4 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2006-02-07 23:14:21 $
+ *  NOTE: XXX: The SDR is silent about data types.  F32 is implemented here.
+ *
+ *  @version $Revision: 1.5 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2006-02-10 04:12:02 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -98,7 +100,4 @@
 increases, or x is too large.  If thst does not work, expand in the other
 direction.
- 
-XXX: This is F32 only.  Must add F64 support (actually, make the defaults F64,
-and convert F32 vectors to F64).
  
 XXX: output bracket vector should be an input as well.
@@ -341,11 +340,9 @@
 XXX: This routine is not very efficient in terms of total evaluations of the
 function.
-XXX: This is F32 only (make it F64).
 XXX: Since this is an internal function, many of the parameter checks are
      redundant.
-XXX: Don't modify the psMinimization argument.
  *****************************************************************************/
 #define PS_LINEMIN_MAX_ITERATIONS 30
-psF32 p_psLineMin(
+static psF32 LineMin(
     psMinimization *min,
     psVector *params,
@@ -385,10 +382,10 @@
     psS32 numIterations = 0;
 
-    psTrace(__func__, 4, "---- p_psLineMin() begin ----\n");
+    psTrace(__func__, 4, "---- LineMin() begin ----\n");
     PS_VECTOR_F32_CHECK_ZERO_VECTOR(line, boolLineIsNull);
 
     if (boolLineIsNull == true) {
         min->value = func(params, coords);
-        psTrace(__func__, 2, "p_psLineMin() called with zero line vector.  Return 0.0.  Function value is %f\n", min->value);
+        psTrace(__func__, 2, "LineMin() called with zero line vector.  Return 0.0.  Function value is %f\n", min->value);
         return(0.0);
     }
@@ -410,5 +407,5 @@
     while (numIterations < PS_LINEMIN_MAX_ITERATIONS) {
         numIterations++;
-        psTrace(__func__, 6, "p_psLineMin(): iteration %d\n", numIterations);
+        psTrace(__func__, 6, "LineMin(): iteration %d\n", numIterations);
 
         a = bracket->data.F32[0];
@@ -464,5 +461,5 @@
             min->value = func(params, coords);
             psFree(bracket);
-            psTrace(__func__, 4, "---- p_psLineMin() end.a (%f) (%f) ----\n", mul, min->value);
+            psTrace(__func__, 4, "---- LineMin() end.a (%f) (%f) ----\n", mul, min->value);
             return(mul);
         }
@@ -472,5 +469,5 @@
     PS_VECTOR_ADD_MULTIPLE(params, paramMask, line, params, mul);
     min->value = func(params, coords);
-    psTrace(__func__, 4, "---- p_psLineMin() end.b (%f) %f ----\n", mul, min->value);
+    psTrace(__func__, 4, "---- LineMin() end.b (%f) %f ----\n", mul, min->value);
 
     psFree(bracket);
@@ -488,7 +485,4 @@
  
 XXX: We do not use Brent's method.
- 
-XXX: The SDR is silent about data types.  F32 is implemented here.
-Reimplement in F64, convert F32 vectors to F64.
  *****************************************************************************/
 #define PS_MINIMIZE_POWELL_LINEMIN_MAX_ITERATIONS 20
@@ -574,10 +568,6 @@
                 P_PSMINIMIZATION_SET_MAXITER((&dummyMin),PS_MINIMIZE_POWELL_LINEMIN_MAX_ITERATIONS);
                 *(float*)&dummyMin.tol = PS_MINIMIZE_POWELL_LINEMIN_ERROR_TOLERANCE;
-                mul = p_psLineMin(&dummyMin,
-                                  Q,
-                                  ((psVector *) v->data[i]),
-                                  myParamMask,
-                                  coords,
-                                  func);
+                mul = LineMin(&dummyMin, Q, ((psVector *) v->data[i]),
+                              myParamMask, coords, func);
                 if (isnan(mul)) {
                     psError(PS_ERR_UNKNOWN, false,
@@ -594,6 +584,9 @@
                 currFuncVal = dummyMin.value;
             }
+            // XXX: how can it be that we are not saving mul anywhere?
         }
         psTrace(__func__, 6, "New function value is %f\n", currFuncVal);
+        // XXX: There must be a bug here.  How can currFuncVal be the current function value?
+        // It is simply the minimum along one of the parameter dimensions.
 
         // 4: Set the vector u = Q - P
@@ -616,5 +609,5 @@
         }
 
-        mul = p_psLineMin(&dummyMin, params, u, myParamMask, coords, func);
+        mul = LineMin(&dummyMin, params, u, myParamMask, coords, func);
         if (isnan(mul)) {
             psError(PS_ERR_UNKNOWN, false,
@@ -628,7 +621,5 @@
             psFree(v);
             min->iter = iterationNumber;
-            // XXX: Ensure that currFuncVal is the correct value to use here.
             min->value = currFuncVal;
-            // XXX: ensure that the lastDelta should be 0.0.
             min->lastDelta = 0.0;
             psTrace(__func__, 4, "---- psMinimizePowell() end (1)(true) ----\n");
@@ -690,6 +681,4 @@
 This functions uses global variables to receive the function pointer, the
 data values, and the data errors.
- 
-XXX: This is F32 only.  Must implement F64.
  *****************************************************************************/
 static psF32 myPowellChi2Func(
