Index: trunk/psLib/src/math/psMatrix.c
===================================================================
--- trunk/psLib/src/math/psMatrix.c	(revision 8914)
+++ trunk/psLib/src/math/psMatrix.c	(revision 9538)
@@ -21,6 +21,6 @@
  *  @author Robert DeSonia, MHPCC
  *
- *  @version $Revision: 1.43 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2006-08-26 04:34:28 $
+ *  @version $Revision: 1.44 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2006-10-13 21:13:48 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -308,11 +308,18 @@
 // This is a temporary gauss-jordan solver based on gene's
 // version based on the Numerical Recipes version
-bool psMatrixGJSolve(
-    psImage *a,
-    psVector *b)
-{
+bool psMatrixGJSolve(psImage *a,
+                     psVector *b
+                    )
+{
+    PS_ASSERT_IMAGE_NON_NULL(a, false);
+    PS_ASSERT_VECTOR_NON_NULL(b, false);
+    PS_ASSERT_IMAGE_TYPE(a, PS_TYPE_F64, false);
+    PS_ASSERT_VECTOR_TYPE(b, PS_TYPE_F64, false);
+    PS_ASSERT_INT_EQUAL(a->numCols, a->numRows, false);
+    int Nx = a->numCols;
+    PS_ASSERT_VECTOR_SIZE(b, (long int)Nx, false);
+
     psF64 *vector = b->data.F64;
     psF64 **matrix = a->data.F64;
-    int Nx = a->numCols;
     int *indxc = psAlloc(Nx*sizeof(int));
     int *indxr = psAlloc(Nx*sizeof(int));
Index: trunk/psLib/src/math/psMatrix.h
===================================================================
--- trunk/psLib/src/math/psMatrix.h	(revision 8914)
+++ trunk/psLib/src/math/psMatrix.h	(revision 9538)
@@ -21,6 +21,6 @@
  *  @author Ross Harman, MHPCC
  *
- *  @version $Revision: 1.21 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2006-05-10 00:49:38 $
+ *  @version $Revision: 1.22 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2006-10-13 21:13:48 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -69,6 +69,6 @@
  */
 bool psMatrixGJSolve(
-    psImage *a,                        ///< Matrix to be solved
-    psVector *b                        ///< Vector of values
+    psImage *a,                   ///< Matrix to be solved
+    psVector *b                   ///< Vector of values
 );
 
Index: trunk/psLib/src/math/psMinimizeLMM.c
===================================================================
--- trunk/psLib/src/math/psMinimizeLMM.c	(revision 8914)
+++ trunk/psLib/src/math/psMinimizeLMM.c	(revision 9538)
@@ -10,6 +10,6 @@
  *  @author EAM, IfA
  *
- *  @version $Revision: 1.20 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2006-08-26 04:34:28 $
+ *  @version $Revision: 1.21 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2006-10-13 21:13:48 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -539,7 +539,5 @@
 bool psMemCheckMinimization(psPtr ptr)
 {
-    if (!is_psType(ptr)) {
-        return false;
-    }
+    PS_ASSERT_PTR(ptr, false);
     return( psMemGetDeallocator(ptr) == (psFreeFunc)minimizationFree );
 }
Index: trunk/psLib/src/math/psPolynomial.c
===================================================================
--- trunk/psLib/src/math/psPolynomial.c	(revision 8914)
+++ trunk/psLib/src/math/psPolynomial.c	(revision 9538)
@@ -7,6 +7,6 @@
 *  polynomials.  It also contains a Gaussian functions.
 *
-*  @version $Revision: 1.149 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2006-08-09 02:26:44 $
+*  @version $Revision: 1.150 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2006-10-13 21:13:48 $
 *
 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -64,7 +64,5 @@
 bool psMemCheckPolynomial1D(psPtr ptr)
 {
-    if (!is_psType(ptr)) {
-        return false;
-    }
+    PS_ASSERT_PTR(ptr, false);
     return ( psMemGetDeallocator(ptr) == (psFreeFunc)polynomial1DFree );
 }
@@ -72,7 +70,5 @@
 bool psMemCheckPolynomial2D(psPtr ptr)
 {
-    if (!is_psType(ptr)) {
-        return false;
-    }
+    PS_ASSERT_PTR(ptr, false);
     return ( psMemGetDeallocator(ptr) == (psFreeFunc)polynomial2DFree );
 }
@@ -80,7 +76,5 @@
 bool psMemCheckPolynomial3D(psPtr ptr)
 {
-    if (!is_psType(ptr)) {
-        return false;
-    }
+    PS_ASSERT_PTR(ptr, false);
     return ( psMemGetDeallocator(ptr) == (psFreeFunc)polynomial3DFree );
 }
@@ -88,7 +82,5 @@
 bool psMemCheckPolynomial4D(psPtr ptr)
 {
-    if (!is_psType(ptr)) {
-        return false;
-    }
+    PS_ASSERT_PTR(ptr, false);
     return ( psMemGetDeallocator(ptr) == (psFreeFunc)polynomial4DFree );
 }
Index: trunk/psLib/src/math/psRegion.c
===================================================================
--- trunk/psLib/src/math/psRegion.c	(revision 8914)
+++ trunk/psLib/src/math/psRegion.c	(revision 9538)
@@ -3,5 +3,5 @@
 #include "psMemory.h"
 #include "psError.h"
-
+#include "psAssert.h"
 #include "psRegion.h"
 
@@ -109,7 +109,5 @@
 bool psMemCheckRegion(psPtr ptr)
 {
-    if (!is_psType(ptr)) {
-        return false;
-    }
+    PS_ASSERT_PTR(ptr, false);
     return ( psMemGetDeallocator(ptr) == (psFreeFunc)regionFree );
 }
Index: trunk/psLib/src/math/psSpline.c
===================================================================
--- trunk/psLib/src/math/psSpline.c	(revision 8914)
+++ trunk/psLib/src/math/psSpline.c	(revision 9538)
@@ -6,6 +6,6 @@
 *  This file contains the routines that allocate, free, and evaluate splines.
 *
-*  @version $Revision: 1.153 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2006-08-26 04:34:28 $
+*  @version $Revision: 1.154 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2006-10-13 21:13:48 $
 *
 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -168,7 +168,5 @@
 bool psMemCheckSpline1D(psPtr ptr)
 {
-    if (!is_psType(ptr)) {
-        return false;
-    }
+    PS_ASSERT_PTR(ptr, false);
     return ( psMemGetDeallocator(ptr) == (psFreeFunc)spline1DFree );
 }
Index: trunk/psLib/src/math/psStats.c
===================================================================
--- trunk/psLib/src/math/psStats.c	(revision 8914)
+++ trunk/psLib/src/math/psStats.c	(revision 9538)
@@ -16,6 +16,6 @@
  * use ->min and ->max (PS_STAT_USE_RANGE)
  *
- *  @version $Revision: 1.185 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2006-08-26 04:34:28 $
+ *  @version $Revision: 1.186 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2006-10-13 21:13:48 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -1623,7 +1623,5 @@
 bool psMemCheckStats(psPtr ptr)
 {
-    if (!is_psType(ptr)) {
-        return false;
-    }
+    PS_ASSERT_PTR(ptr, false);
     return ( psMemGetDeallocator(ptr) == (psFreeFunc)statsFree );
 }
@@ -1734,7 +1732,5 @@
 bool psMemCheckHistogram(psPtr ptr)
 {
-    if (!is_psType(ptr)) {
-        return false;
-    }
+    PS_ASSERT_PTR(ptr, false);
     return ( psMemGetDeallocator(ptr) == (psFreeFunc)histogramFree );
 }
