Index: trunk/psLib/src/math/psMatrix.c
===================================================================
--- trunk/psLib/src/math/psMatrix.c	(revision 19805)
+++ trunk/psLib/src/math/psMatrix.c	(revision 19843)
@@ -22,6 +22,6 @@
  *  @author Andy Becker, University of Washington (SVD).
  *
- *  @version $Revision: 1.57 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2008-05-07 23:10:46 $
+ *  @version $Revision: 1.58 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2008-10-02 20:48:12 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -329,4 +329,6 @@
     PS_ASSERT_VECTOR_SIZE(b, (long int)a->numCols, false);
 
+# if (0)
+    // XXX expand this out explicitly below
     // Check for non-finite entries
 #define MATRIX_CHECK_NONFINITE_CASE(TYPE,MATRIX) \
@@ -337,7 +339,7 @@
           for (int j = 0; j < numCols; j++) { \
               if (!isfinite(values[i][j])) { \
-                  psError(PS_ERR_BAD_PARAMETER_VALUE, 3, \
-                          "Input matrix contains non-finite elements: matrix[%d][%d] is %.2f\n", \
-                          i, j, values[i][j]); \
+                  // psError(PS_ERR_BAD_PARAMETER_VALUE, 3,		
+		  // "Input matrix contains non-finite elements: matrix[%d][%d] is %.2f\n", 
+		  // i, j, values[i][j]);				
                   return false; \
               } \
@@ -346,11 +348,42 @@
       break; \
   }
+# endif
 
     // Check for non-finite entries in matrix
     switch (a->type.type) {
-        MATRIX_CHECK_NONFINITE_CASE(F32, a);
-        MATRIX_CHECK_NONFINITE_CASE(F64, a);
+      case PS_TYPE_F32: {
+	  psF32 **values = a->data.F32; /* Dereference */
+	  int numCols = a->numCols, numRows = a->numRows; /* Size of matrix */
+	  for (int i = 0; i < numRows; i++) {
+	      for (int j = 0; j < numCols; j++) {
+		  if (!isfinite(values[i][j])) {
+		      // psError(PS_ERR_BAD_PARAMETER_VALUE, 3,
+		      // "Input matrix contains non-finite elements: matrix[%d][%d] is %.2f\n",
+		      // i, j, values[i][j]);
+		      return false;
+		  }
+	      }
+	  }
+	  break;
+      }
+      case PS_TYPE_F64: {
+	  psF64 **values = a->data.F64; /* Dereference */
+	  int numCols = a->numCols, numRows = a->numRows; /* Size of matrix */
+	  for (int i = 0; i < numRows; i++) {
+	      for (int j = 0; j < numCols; j++) {
+		  if (!isfinite(values[i][j])) {
+		      // psError(PS_ERR_BAD_PARAMETER_VALUE, 3,
+		      // "Input matrix contains non-finite elements: matrix[%d][%d] is %.2f\n",
+		      // i, j, values[i][j]);
+		      return false;
+		  }
+	      }
+	  }
+	  break;
+      }
+	// MATRIX_CHECK_NONFINITE_CASE(F32, a);
+	// MATRIX_CHECK_NONFINITE_CASE(F64, a);
       default:
-        psAbort("Should never get here.");
+	psAbort("Should never get here.");
     }
 
