Index: /trunk/psLib/src/dataManip/psMinimize.c
===================================================================
--- /trunk/psLib/src/dataManip/psMinimize.c	(revision 1991)
+++ /trunk/psLib/src/dataManip/psMinimize.c	(revision 1992)
@@ -9,6 +9,6 @@
  *  @author GLF, MHPCC
  *
- *  @version $Revision: 1.56 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-10-06 23:29:16 $
+ *  @version $Revision: 1.57 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-10-06 23:38:49 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -18,5 +18,5 @@
  *  XXX: Section 4.5.1.1 (predefined functions for Gauss minimization via
  *       LMM) is not addressed here.  We are waiting for subsequent SDRs
- *       which will redfeine the LMM functions.
+ *       which will redefine the LMM functions.
  *
  */
@@ -424,4 +424,13 @@
                       psMinimizeLMChi2Func func)
 {
+    PS_CHECK_NULL_PTR_RETURN_NULL(min);
+    PS_CHECK_NULL_VECTOR_RETURN_NULL(params);
+    PS_CHECK_EMPTY_VECTOR_RETURN_NULL(params);
+    PS_CHECK_NULL_PTR_RETURN_NULL(coords);
+    PS_CHECK_NULL_VECTOR_RETURN_NULL(value);
+    PS_CHECK_EMPTY_VECTOR_RETURN_NULL(value);
+    if (paramMask != NULL) {
+        PS_CHECK_VECTOR_SIZE_EQUAL_RETURN_NULL(params, paramMask);
+    }
     psTrace(".psLib.dataManip.psMinimizeLMChi2", 4,
             "---- psMinimizeLMChi2() begin ----\n");
@@ -1299,4 +1308,6 @@
  
 XXX: Must define behavior on various NULL inputs.
+ 
+XXX: Check for F32 types?
  *****************************************************************************/
 bool psMinimizePowell(psMinimization *min,
Index: /trunk/psLib/src/dataManip/psMinimize.h
===================================================================
--- /trunk/psLib/src/dataManip/psMinimize.h	(revision 1991)
+++ /trunk/psLib/src/dataManip/psMinimize.h	(revision 1992)
@@ -8,6 +8,6 @@
  *  @author GLG, MHPCC
  *
- *  @version $Revision: 1.28 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-10-06 21:30:53 $
+ *  @version $Revision: 1.29 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-10-06 23:38:49 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -83,4 +83,6 @@
                                );
 
+
+// XXX: What if any of these arguments are NULL?
 typedef
 float (*psMinimizeLMChi2Func)(psVector *deriv,
Index: /trunk/psLib/src/math/psMinimize.c
===================================================================
--- /trunk/psLib/src/math/psMinimize.c	(revision 1991)
+++ /trunk/psLib/src/math/psMinimize.c	(revision 1992)
@@ -9,6 +9,6 @@
  *  @author GLF, MHPCC
  *
- *  @version $Revision: 1.56 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-10-06 23:29:16 $
+ *  @version $Revision: 1.57 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-10-06 23:38:49 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -18,5 +18,5 @@
  *  XXX: Section 4.5.1.1 (predefined functions for Gauss minimization via
  *       LMM) is not addressed here.  We are waiting for subsequent SDRs
- *       which will redfeine the LMM functions.
+ *       which will redefine the LMM functions.
  *
  */
@@ -424,4 +424,13 @@
                       psMinimizeLMChi2Func func)
 {
+    PS_CHECK_NULL_PTR_RETURN_NULL(min);
+    PS_CHECK_NULL_VECTOR_RETURN_NULL(params);
+    PS_CHECK_EMPTY_VECTOR_RETURN_NULL(params);
+    PS_CHECK_NULL_PTR_RETURN_NULL(coords);
+    PS_CHECK_NULL_VECTOR_RETURN_NULL(value);
+    PS_CHECK_EMPTY_VECTOR_RETURN_NULL(value);
+    if (paramMask != NULL) {
+        PS_CHECK_VECTOR_SIZE_EQUAL_RETURN_NULL(params, paramMask);
+    }
     psTrace(".psLib.dataManip.psMinimizeLMChi2", 4,
             "---- psMinimizeLMChi2() begin ----\n");
@@ -1299,4 +1308,6 @@
  
 XXX: Must define behavior on various NULL inputs.
+ 
+XXX: Check for F32 types?
  *****************************************************************************/
 bool psMinimizePowell(psMinimization *min,
Index: /trunk/psLib/src/math/psMinimize.h
===================================================================
--- /trunk/psLib/src/math/psMinimize.h	(revision 1991)
+++ /trunk/psLib/src/math/psMinimize.h	(revision 1992)
@@ -8,6 +8,6 @@
  *  @author GLG, MHPCC
  *
- *  @version $Revision: 1.28 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-10-06 21:30:53 $
+ *  @version $Revision: 1.29 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-10-06 23:38:49 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -83,4 +83,6 @@
                                );
 
+
+// XXX: What if any of these arguments are NULL?
 typedef
 float (*psMinimizeLMChi2Func)(psVector *deriv,
Index: /trunk/psLib/test/dataManip/tst_psMinimize06.c
===================================================================
--- /trunk/psLib/test/dataManip/tst_psMinimize06.c	(revision 1991)
+++ /trunk/psLib/test/dataManip/tst_psMinimize06.c	(revision 1992)
@@ -22,4 +22,5 @@
 This procedure ignores the coordinates, other than to ensure that they were
 passed correctly from psMinimizePowell().
+ 
  *****************************************************************************/
 float myFunc(psVector *myDeriv,
@@ -34,4 +35,5 @@
     if (myDeriv == NULL) {
         myDeriv = psVectorAlloc(myParams->n, PS_TYPE_F32);
+        psError(__func__, "myDeriv is NULL.\n");
     }
 
@@ -129,4 +131,7 @@
     psFree(myParamMask);
     psFree(min);
+    psFree(x);
+    psFree(y);
+    psFree(myCovar);
 
     psMemCheckCorruption(1);
