Index: trunk/doc/pslib/psLibSDRS.tex
===================================================================
--- trunk/doc/pslib/psLibSDRS.tex	(revision 5056)
+++ trunk/doc/pslib/psLibSDRS.tex	(revision 5059)
@@ -1,3 +1,3 @@
-%%% $Id: psLibSDRS.tex,v 1.339 2005-09-15 20:53:06 price Exp $
+%%% $Id: psLibSDRS.tex,v 1.340 2005-09-16 01:56:17 eugene Exp $
 \documentclass[panstarrs,spec]{panstarrs}
 
@@ -3449,6 +3449,6 @@
     const int numCols;                  ///< Number of columns in image
     const int numRows;                  ///< Number of rows in image.
-    const int col0;                     ///< Column position relative to parent.
-    const int row0;                     ///< Row position relative to parent.
+    int col0;                           ///< Column position relative to parent.
+    int row0;                           ///< Row position relative to parent.
     union {
         psS8  **S8;                     ///< Pointers to char data
@@ -4488,5 +4488,5 @@
     psF64 *coeff;                       ///< Coefficients
     psF64 *coeffErr;                    ///< Error in coefficients
-    char *mask;                         ///< Coefficient mask
+    psMaskType *mask;                   ///< Coefficient mask
 } psPolynomial1D;
 \end{datatype}
@@ -4500,5 +4500,5 @@
     psF64 **coeff;                      ///< Coefficients
     psF64 **coeffErr;                   ///< Error in coefficients
-    char **mask;                        ///< Coefficients mask
+    psMaskType **mask;                  ///< Coefficients mask
 } psPolynomial2D;
 \end{datatype}
@@ -4669,6 +4669,21 @@
 the minimization analysis.  The maximum number of iterations is
 specified by \code{maxIter}, while the maximum tolerance for
-convergence is \code{tol}.  Four parameter vectors describe the
-behavior of individual parameters.  The \code{paramMask} vector
+convergence is \code{tol}.  The output information carried by the
+structure consists of the value of the function at the minimum
+(\code{value}), the number of iterations performed (\code{iter}) and
+last change in tolerance before returning (\code{lastDelta}).
+
+\begin{datatype}
+typedef struct {
+    const int maxIter;                  ///< Maximum number of iterations
+    const float tol;                    ///< Tolerance to reach
+    float value;                        ///< Value after minimization
+    int iter;                           ///< Actual number of iterations performed
+    float lastDelta;                    ///< Last change before quitting
+} psMinimization;
+\end{datatype}
+
+We define the \code{psMinConstrain} structure to define values which
+constrain the allowed parameter values.  The \code{paramMask} vector
 defines the free (0) or frozen (not 0) parameters.  The
 \code{paramMin} defines the minimum allowed value for each parameter,
@@ -4680,16 +4695,8 @@
 swing is saturated to the limit (with the correct sign).  Any of these
 parameter vectors may be set to \code{NULL}, in which case the concept
-is ignored in the analysis.  The output information carried by the
-structure consists of the value of the function at the minimum
-(\code{value}), the number of iterations performed (\code{iter}) and
-last change in tolerance before returning (\code{lastDelta}).
+is ignored in the analysis.
 
 \begin{datatype}
 typedef struct {
-    const int maxIter;                  ///< Maximum number of iterations
-    const float tol;                    ///< Tolerance to reach
-    float value;                        ///< Value after minimization
-    int iter;                           ///< Actual number of iterations performed
-    float lastDelta;                    ///< Last change before quitting
     psVector *paramMask;                ///< valid / invalid parameters
     psVector *paramMax;                 ///< max allowed parameters
@@ -4699,7 +4706,8 @@
 \end{datatype}
 
-The corresponding allocator is:
+The corresponding allocators are:
 \begin{prototype}
 psMinimization *psMinimizationAlloc(int maxIter, float tol);
+psMinConstrain *psMinConstrainAlloc();
 \end{prototype}
 and the parameter vectors are initially set to \code{NULL}.  
@@ -4717,5 +4725,5 @@
 
 Then \code{psMinimizeLMChi2} shall fit the specified function,
-\code{func}, to a set of measurements, \code{x,y,yErr}, using the
+\code{func}, to a set of measurements, \code{x,y,yWt}, using the
 Levenberg-Marquardt method:
 
@@ -4724,7 +4732,8 @@
                       psImage *covar, 
                       psVector *params,
+		      psMinConstrain *constrain,
                       const psArray  *x, 
                       const psVector *y,
-                      const psVector *yErr, 
+                      const psVector *yWt, 
                       psMinimizeLMChi2Func func);
 \end{prototype}
@@ -4755,16 +4764,16 @@
 The measurement ordinates, \code{x}, shall consist of multiple
 vectors, each of which may be passed to the model \code{func}.  If the
-measurement coordinates, \code{y}, and errors, \code{yErr}, are not of
+measurement coordinates, \code{y}, and weights, \code{yWt}, are not of
 the same length as the ordinates array, \code{x}, then the function
 shall generate a warning, and truncate the longest of the
 array/vectors to match the length of the shortest.  The vectors
-contained within the \code{x} array, and the \code{y} and \code{yErr}
-vectors must be of type \code{psF32}.  The \code{yErr} vector may be
+contained within the \code{x} array, and the \code{y} and \code{yWt}
+vectors must be of type \code{psF64}.  The \code{yWt} vector may be
 \code{NULL}, in which case the errors shall be assumed to be
 identical.
 
-\code{paramMask} must be of type \code{psMaskType}, while \code{params}
-must be of type \code{psF32}.  The \code{func} function must be valid
-only for types \code{psF32}, \code{psF64}.
+\code{paramMask} must be of type \code{psMaskType}, while
+\code{params} must be of type \code{psF64}.  The \code{func} function
+must be valid only for type \code{psF64}.
 
 \begin{prototype}
@@ -4785,27 +4794,4 @@
 of the distances.  This vector must be pre-allocated to the
 dimenstions of \code{params}.
-
-%% \subsubsubsection{Pre-defined Functions for LM}
-%% 
-%% We define some commonly used functions for use with the LM
-%% minimization, used for the purpose of performing $\chi^2$ fitting:
-%% 
-%% \begin{prototype}
-%% psMinimizeLMChi2Func psMinimizeLMChi2Gauss1D;
-%% psMinimizeLMChi2Func psMinimizeLMChi2Gauss2D;
-%% \end{prototype}
-%% 
-%% \code{psMinimizeChi2LMGauss1D} shall take as \code{params}, the
-%% normalization, center, and standard deviation of a Gaussian to be fit,
-%% and as \code{x}, a vector containing a single value.  It shall return
-%% the value of the Gaussian at the value, and the derivatives
-%% (\code{deriv}) with respect to each of the parameters.
-%% 
-%% \code{psMinimizeChi2LMGauss2D} shall take, as \code{params}, the
-%% normalization, center (two values), standard deviation (two values)
-%% and position angle of a 2-dimensional Gaussian, and as \code{x}, a
-%% vector containing a position, $(x,y)$.  It shall return the value of
-%% the 2-dimensional Gaussian at the specified point, along with the
-%% derivatives with respect to each of the parameters.
 
 \subsubsection{Powell}
@@ -4827,5 +4813,5 @@
 bool psMinimizePowell(psMinimization *min, 
                       psVector *params, 
-                      const psVector *paramMask,
+		      const psVector *paramMask,
                       const psArray *coords, 
                       psMinimizePowellFunc func);
@@ -4848,5 +4834,5 @@
 bool psMinimizeChi2Powell(psMinimization *min, 
                           psVector *params, 
-			  const psVector *paramMask,
+			  psMinConstrain *constrain,
                           const psArray *coords, 
 			  const psVector *value, 
