Index: /trunk/psLib/src/dataManip/psMinimize.h
===================================================================
--- /trunk/psLib/src/dataManip/psMinimize.h	(revision 1836)
+++ /trunk/psLib/src/dataManip/psMinimize.h	(revision 1837)
@@ -3,10 +3,11 @@
  *  @ingroup Math
  *
- *  This file will contain function prototypes...
+ *  This file will contain function prototypes for various minimization,
+ *  chi-squared minimization, and 1-D polynomial fitting routines.
  *
  *  @author George Gusciora, MHPCC
  *
- *  @version $Revision: 1.23 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-09-18 01:50:45 $
+ *  @version $Revision: 1.24 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-09-20 23:43:53 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -26,76 +27,20 @@
  *  \ingroup Stats
  */
-
-/** Functions **************************************************************/
-
 /** \addtogroup Stats
  *  \{
  */
 
-/** function of a collection of parameters and coordinate vector.
- *
- *  @return float    value to minimize
- */
-typedef float (*psMinimizeFunction)(
-    const psVector* restrict params,   ///< collection of parameters
-    const psVector* restrict coord     ///< coordinates
-);
+typedef struct
+{
+    int maxIter;                       ///< Convergence limit
+    float tol;                         ///< Error Tolerance
+    float value;                       ///< Value of function at minimum
+    int iter;                          ///< Number of iterations required
+    float lastDelta;                   ///< The last difference for the fit
+}
+psMinimization;
 
-/** derivative function of psMinimizeFunction
- *
- *  @return float     the derivative in respect to params[derivParam]
- */
-typedef float (*psMinimizeFunctionDeriv) (
-    const psVector* restrict params,   ///< collection of parameters
-    const psVector* restrict coord,    ///< coordinates
-    int derivParam                     ///< index of parameter to calculate derivative of
-);
-
-/** Minimizes a non-linear function.
- *
- *  psMinimize determines and returns the vector that minimizes the specified 
- *  function. It takes as input a function, myFunction, an initial guess for
- *  the vector that minimizes the function, initialGuess, the current 
- *  coordiate coord, and an optional mask for the vector elements (function 
- *  parameters) to minimize, paramMask (all parameters are fit if PSLib SDRS 
- *  25 July 13, 2004 Pan-STARRS Image Processing Pipeline PSDC-430-007-04 
- *  NULL). Note that paramMask must be of type psU8, while params must be of 
- *  type psF32. The optional function, myFuncDeriv returns the derivative of 
- *  the function. This function must be valid only for types psF32, psF64.
- *
- *  @return psVector*    minimized vector
- */
-psVector* psMinimize(
-    psVector* restrict initialGuess,
-    psMinimizeFunction myFunction,
-    psMinimizeFunctionDeriv myFunctionDeriv,
-    const psVector* restrict coord,
-    const psVector* restrict paramMask
-);
-
-/** Minimize chi^2 for input data.
- *
- *  psMinimizeChi2 fits a model to observations by minimizing chi^2, returning 
- *  the best-fit parameters. The input parameters are a function that 
- *  evaluates the model for a specified domain, given the parameters, 
- *  evalModel; a list of observations, (domain, data, and errors); an initial 
- *  guess at the best-fit parameters, initialGuess which is returned with the 
- *  best-fit parameters, and an optional mask specifying which parameters are 
- *  to be fit, paramMask, which must be of type psU8. All parameters are fit 
- *  if this vector is NULL. This function must be valid only for types psF32, 
- *  psF64.
- *
- *  @return psVector*      minimized vector
- */
-psVector* psMinimizeChi2(
-    psMinimizeFunction evalModel,      ///< Model to fit; (domain and params)
-    psMinimizeFunctionDeriv DevalModel,///< Derivative of model to fit; (domain and params)
-    const psImage* restrict domain,    ///< The domain values for the corresponding measurements
-    const psVector* restrict data,     ///< Data to fit
-    const psVector* restrict errors,   ///< Errors in the data
-    psVector* restrict initialGuess,   ///< Initial guess
-    const psVector* restrict paramMask,///< 1 = fit for parameter, 0 = hold parameter constant
-    float *chiSq                       ///< chi squared
-);
+psMinimization *psMinimizationAlloc(int maxIter,
+                                    float tol);
 
 /** Derive a polynomial fit by chi^2 minimisation (analytically)
@@ -119,32 +64,8 @@
 );
 
-typedef struct
-{
-    int maxIter;   ///< Convergence limit
-    float tol;    ///< Error Tolerance
-    float value;   ///< Value of function at minimum
-    int iter;    ///< Number of iterations required
-    float lastDelta;   ///< The last difference for the fit
-}
-psMinimization;
-
-psMinimization *psMinimizationAlloc(int maxIter, float tol);
-
-
-
-typedef float (*psMinimizeLMFunc) (psVector *deriv,
-                                   const psVector *params,
-                                   const psArray *coords);
-
-typedef float (*psMinimizeLMChi2Func) (psVector *deriv,
-                                       const psVector *params,
-                                       const psVector *coords);
-
-bool psMinimizeLM(psMinimization *min,
-                  psImage *covar,
-                  psVector *params,
-                  const psVector *paramMask,
-                  const psArray *coords,
-                  psMinimizeLMFunc func);
+typedef
+float (*psMinimizeLMChi2Func)(psVector *deriv,
+                              const psVector *params,
+                              const psVector *coords);
 
 bool psMinimizeLMChi2(psMinimization *min,
@@ -156,8 +77,7 @@
                       psMinimizeLMChi2Func func);
 
-
-
-typedef float (*psMinimizePowellFunc) (const psVector *params,
-                                       const psArray *coords);
+typedef
+float (*psMinimizePowellFunc)(const psVector *params,
+                              const psArray *coords);
 
 bool psMinimizePowell(psMinimization *min,
@@ -167,6 +87,7 @@
                       psMinimizePowellFunc func);
 
-typedef psVector* (*psMinimizeChi2PowellFunc) (const psVector *params,
-        const psArray *coords);
+typedef
+psVector *(*psMinimizeChi2PowellFunc)(const psVector *params,
+                                      const psArray *coords);
 
 bool psMinimizeChi2Powell(psMinimization *min,
@@ -178,19 +99,4 @@
                           psMinimizeChi2PowellFunc func);
 
-
-bool psMinimize1DFunc(psMinimization *min,
-                      psVector *params,
-                      int dim,
-                      const psArray *coords,
-                      psMinimizePowellFunc func);
-
-float psLineMin(psMinimization *min,
-                psVector *params,
-                psVector *line,
-                const psVector *paramMask,
-                const psArray *coords,
-                psMinimizePowellFunc func);
-
-
 /* \} */// End of MathGroup Functions
 
Index: /trunk/psLib/src/math/psMinimize.h
===================================================================
--- /trunk/psLib/src/math/psMinimize.h	(revision 1836)
+++ /trunk/psLib/src/math/psMinimize.h	(revision 1837)
@@ -3,10 +3,11 @@
  *  @ingroup Math
  *
- *  This file will contain function prototypes...
+ *  This file will contain function prototypes for various minimization,
+ *  chi-squared minimization, and 1-D polynomial fitting routines.
  *
  *  @author George Gusciora, MHPCC
  *
- *  @version $Revision: 1.23 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-09-18 01:50:45 $
+ *  @version $Revision: 1.24 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-09-20 23:43:53 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -26,76 +27,20 @@
  *  \ingroup Stats
  */
-
-/** Functions **************************************************************/
-
 /** \addtogroup Stats
  *  \{
  */
 
-/** function of a collection of parameters and coordinate vector.
- *
- *  @return float    value to minimize
- */
-typedef float (*psMinimizeFunction)(
-    const psVector* restrict params,   ///< collection of parameters
-    const psVector* restrict coord     ///< coordinates
-);
+typedef struct
+{
+    int maxIter;                       ///< Convergence limit
+    float tol;                         ///< Error Tolerance
+    float value;                       ///< Value of function at minimum
+    int iter;                          ///< Number of iterations required
+    float lastDelta;                   ///< The last difference for the fit
+}
+psMinimization;
 
-/** derivative function of psMinimizeFunction
- *
- *  @return float     the derivative in respect to params[derivParam]
- */
-typedef float (*psMinimizeFunctionDeriv) (
-    const psVector* restrict params,   ///< collection of parameters
-    const psVector* restrict coord,    ///< coordinates
-    int derivParam                     ///< index of parameter to calculate derivative of
-);
-
-/** Minimizes a non-linear function.
- *
- *  psMinimize determines and returns the vector that minimizes the specified 
- *  function. It takes as input a function, myFunction, an initial guess for
- *  the vector that minimizes the function, initialGuess, the current 
- *  coordiate coord, and an optional mask for the vector elements (function 
- *  parameters) to minimize, paramMask (all parameters are fit if PSLib SDRS 
- *  25 July 13, 2004 Pan-STARRS Image Processing Pipeline PSDC-430-007-04 
- *  NULL). Note that paramMask must be of type psU8, while params must be of 
- *  type psF32. The optional function, myFuncDeriv returns the derivative of 
- *  the function. This function must be valid only for types psF32, psF64.
- *
- *  @return psVector*    minimized vector
- */
-psVector* psMinimize(
-    psVector* restrict initialGuess,
-    psMinimizeFunction myFunction,
-    psMinimizeFunctionDeriv myFunctionDeriv,
-    const psVector* restrict coord,
-    const psVector* restrict paramMask
-);
-
-/** Minimize chi^2 for input data.
- *
- *  psMinimizeChi2 fits a model to observations by minimizing chi^2, returning 
- *  the best-fit parameters. The input parameters are a function that 
- *  evaluates the model for a specified domain, given the parameters, 
- *  evalModel; a list of observations, (domain, data, and errors); an initial 
- *  guess at the best-fit parameters, initialGuess which is returned with the 
- *  best-fit parameters, and an optional mask specifying which parameters are 
- *  to be fit, paramMask, which must be of type psU8. All parameters are fit 
- *  if this vector is NULL. This function must be valid only for types psF32, 
- *  psF64.
- *
- *  @return psVector*      minimized vector
- */
-psVector* psMinimizeChi2(
-    psMinimizeFunction evalModel,      ///< Model to fit; (domain and params)
-    psMinimizeFunctionDeriv DevalModel,///< Derivative of model to fit; (domain and params)
-    const psImage* restrict domain,    ///< The domain values for the corresponding measurements
-    const psVector* restrict data,     ///< Data to fit
-    const psVector* restrict errors,   ///< Errors in the data
-    psVector* restrict initialGuess,   ///< Initial guess
-    const psVector* restrict paramMask,///< 1 = fit for parameter, 0 = hold parameter constant
-    float *chiSq                       ///< chi squared
-);
+psMinimization *psMinimizationAlloc(int maxIter,
+                                    float tol);
 
 /** Derive a polynomial fit by chi^2 minimisation (analytically)
@@ -119,32 +64,8 @@
 );
 
-typedef struct
-{
-    int maxIter;   ///< Convergence limit
-    float tol;    ///< Error Tolerance
-    float value;   ///< Value of function at minimum
-    int iter;    ///< Number of iterations required
-    float lastDelta;   ///< The last difference for the fit
-}
-psMinimization;
-
-psMinimization *psMinimizationAlloc(int maxIter, float tol);
-
-
-
-typedef float (*psMinimizeLMFunc) (psVector *deriv,
-                                   const psVector *params,
-                                   const psArray *coords);
-
-typedef float (*psMinimizeLMChi2Func) (psVector *deriv,
-                                       const psVector *params,
-                                       const psVector *coords);
-
-bool psMinimizeLM(psMinimization *min,
-                  psImage *covar,
-                  psVector *params,
-                  const psVector *paramMask,
-                  const psArray *coords,
-                  psMinimizeLMFunc func);
+typedef
+float (*psMinimizeLMChi2Func)(psVector *deriv,
+                              const psVector *params,
+                              const psVector *coords);
 
 bool psMinimizeLMChi2(psMinimization *min,
@@ -156,8 +77,7 @@
                       psMinimizeLMChi2Func func);
 
-
-
-typedef float (*psMinimizePowellFunc) (const psVector *params,
-                                       const psArray *coords);
+typedef
+float (*psMinimizePowellFunc)(const psVector *params,
+                              const psArray *coords);
 
 bool psMinimizePowell(psMinimization *min,
@@ -167,6 +87,7 @@
                       psMinimizePowellFunc func);
 
-typedef psVector* (*psMinimizeChi2PowellFunc) (const psVector *params,
-        const psArray *coords);
+typedef
+psVector *(*psMinimizeChi2PowellFunc)(const psVector *params,
+                                      const psArray *coords);
 
 bool psMinimizeChi2Powell(psMinimization *min,
@@ -178,19 +99,4 @@
                           psMinimizeChi2PowellFunc func);
 
-
-bool psMinimize1DFunc(psMinimization *min,
-                      psVector *params,
-                      int dim,
-                      const psArray *coords,
-                      psMinimizePowellFunc func);
-
-float psLineMin(psMinimization *min,
-                psVector *params,
-                psVector *line,
-                const psVector *paramMask,
-                const psArray *coords,
-                psMinimizePowellFunc func);
-
-
 /* \} */// End of MathGroup Functions
 
