Index: trunk/psLib/src/math/psMinimizeLMM.h
===================================================================
--- trunk/psLib/src/math/psMinimizeLMM.h	(revision 28998)
+++ trunk/psLib/src/math/psMinimizeLMM.h	(revision 35767)
@@ -30,4 +30,7 @@
 #include "psConstants.h"
 
+# define PS_MINIMIZE_LMM_GAIN_FACTOR_MODE 0
+# define PS_MINIMIZE_LMM_CHISQ_CONVERGENCE 1
+
 #define PS_DETERMINE_BRACKET_STEP_SIZE 0.10
 #define PS_MAX_LMM_ITERATIONS 100
@@ -82,5 +85,8 @@
     int iter;                          ///< Number of iterations to date
     float lastDelta;                   ///< The last difference for the fit
+    float rParSigma;		       ///< last fractional change in the parameters
     float maxChisqDOF;		       ///< for Chisq minimization, require that we reach here before checking tolerance
+    int gainFactorMode;
+    bool chisqConvergence;
 }
 psMinimization;
@@ -124,4 +130,35 @@
  */
 bool psMinimizeLMChi2(
+    psMinimization *min,               ///< Minimization specification
+    psImage *covar,                    ///< Covariance matrix
+    psVector *params,                  ///< "Best Guess" for the parameters that minimize func
+    psMinConstraint *constraint, ///< Constraints on the parameters
+    const psArray *x,                  ///< Measurement ordinates of multiple vectors
+    const psVector *y,                 ///< Measurement coordinates
+    const psVector *yWt,               ///< Errors in the measurement coordinates
+    psMinimizeLMChi2Func func          ///< Specified function
+);
+
+/** Minimizes a specified function based on the Levenberg-Marquardt method.
+ *
+ *  @return bool:   True if successful.
+ */
+bool psMinimizeLMChi2_Old(
+    psMinimization *min,               ///< Minimization specification
+    psImage *covar,                    ///< Covariance matrix
+    psVector *params,                  ///< "Best Guess" for the parameters that minimize func
+    psMinConstraint *constraint, ///< Constraints on the parameters
+    const psArray *x,                  ///< Measurement ordinates of multiple vectors
+    const psVector *y,                 ///< Measurement coordinates
+    const psVector *yWt,               ///< Errors in the measurement coordinates
+    psMinimizeLMChi2Func func          ///< Specified function
+);
+
+/** Minimizes a specified function based on the Levenberg-Marquardt method
+    Uses alternative convergence criterion.
+ *
+ *  @return bool:   True if successful.
+ */
+bool psMinimizeLMChi2_Alt(
     psMinimization *min,               ///< Minimization specification
     psImage *covar,                    ///< Covariance matrix
