Index: trunk/psLib/test/dataManip/tst_psMatrix01.c
===================================================================
--- trunk/psLib/test/dataManip/tst_psMatrix01.c	(revision 2674)
+++ trunk/psLib/test/dataManip/tst_psMatrix01.c	(revision 2684)
@@ -11,6 +11,6 @@
 *  @author  Ross Harman, MHPCC
 *
-*  @version $Revision: 1.9 $  $Name: not supported by cvs2svn $
-*  @date  $Date: 2004-12-09 21:00:39 $
+*  @version $Revision: 1.10 $  $Name: not supported by cvs2svn $
+*  @date  $Date: 2004-12-10 19:34:49 $
 *
 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -21,16 +21,24 @@
 #include "psTest.h"
 
-#define PRINT_MATRIX(IMAGE)                         \
-for(psS32 i=0; i<IMAGE->numRows; i++) {             \
-    for(psS32 j=0; j<IMAGE->numCols; j++) {         \
-        if(IMAGE->type.type == PS_TYPE_F64) {       \
-            printf("%lf ", IMAGE->data.F64[i][j]);  \
-        } else {                                    \
-            printf("%f ", IMAGE->data.F32[i][j]);   \
-        }                                           \
-    }                                               \
-    printf("\n");                                   \
-}                                                   \
-printf("\n")
+#define TOLERANCE 0.000001
+
+#define CHECK_MATRIX(IMAGE)                                                                                  \
+for(psU32 i=0; i<IMAGE->numRows; i++) {                                                                  \
+    for(psU32 j=0; j<IMAGE->numCols; j++) {                                                              \
+        if(IMAGE->type.type == PS_TYPE_F64) {                                                            \
+            if(fabs(IMAGE->data.F64[i][j]-truthMatrix[i][j]) > TOLERANCE) {                              \
+                printf("Matrix values at element %d, %d don't agree %lf vs %lf\n", i, j,                 \
+                       IMAGE->data.F64[i][j], truthMatrix[i][j]);                                        \
+            }                                                                                            \
+        } else if(IMAGE->type.type == PS_TYPE_F32){                                                      \
+            if(fabs(IMAGE->data.F32[i][j]-truthMatrix[i][j]) > TOLERANCE) {                              \
+                printf("%lf\n", fabs(IMAGE->data.F32[i][j]-truthMatrix[i][j])),                              \
+                printf("Matrix values at element %d, %d don't agree %f vs %lf\n", i, j,                  \
+                       IMAGE->data.F32[i][j], truthMatrix[i][j]);                                        \
+            }                                                                                            \
+        }                                                                                                \
+    }                                                                                                    \
+}
+
 
 psS32 main( psS32 argc, char* argv[] )
@@ -38,4 +46,7 @@
     psImage * tempImage = NULL;
 
+    double truthMatrix[3][3] = {{1, 4, 7},
+                                {2, 5, 8},
+                                {3, 6, 9}};
 
     // Test A - Create input and output images
@@ -63,6 +74,4 @@
     inImageF32->data.F32[2][1] = 8;
     inImageF32->data.F32[2][2] = 9;
-    PRINT_MATRIX(inImage);
-    PRINT_MATRIX(inImageF32);
     printFooter(stdout, "psMatrix", "Create input and output images", true);
 
@@ -72,5 +81,5 @@
     tempImage = outImage;
     outImage = psMatrixTranspose(outImage, inImage);
-    PRINT_MATRIX(outImage);
+    CHECK_MATRIX(outImage);
     if (outImage->type.dimen != PS_DIMEN_IMAGE) {
         printf( "Error: Resulting image is not PS_DIMEN_IMAGE\n");
@@ -81,5 +90,5 @@
     tempImage = outImageF32;
     outImageF32 = psMatrixTranspose(outImageF32, inImageF32);
-    PRINT_MATRIX(outImageF32);
+    CHECK_MATRIX(outImageF32);
     if (outImageF32->type.dimen != PS_DIMEN_IMAGE) {
         printf("Error: Resulting image is not PS_DIMEN_IMAGE\n");
@@ -94,9 +103,9 @@
     psImage *outImageNull = NULL;
     outImageNull = psMatrixTranspose(outImageNull, inImage);
-    PRINT_MATRIX(outImageNull);
+    CHECK_MATRIX(outImageNull);
 
     psImage *outImageNullF32 = NULL;
     outImageNullF32 = psMatrixTranspose(outImageNullF32, inImageF32);
-    PRINT_MATRIX(outImageNullF32);
+    CHECK_MATRIX(outImageNullF32);
     printFooter(stdout, "psMatrix", "Transpose input image into auto allocated NULL output image", true);
 
