Index: /trunk/psLib/src/math/psPolynomial.c
===================================================================
--- /trunk/psLib/src/math/psPolynomial.c	(revision 5090)
+++ /trunk/psLib/src/math/psPolynomial.c	(revision 5091)
@@ -7,6 +7,6 @@
 *  polynomials.  It also contains a Gaussian functions.
 *
-*  @version $Revision: 1.123 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2005-09-22 02:47:16 $
+*  @version $Revision: 1.124 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2005-09-22 03:00:31 $
 *
 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -95,5 +95,5 @@
     unsigned int x = 0;
 
-    for (x = 0; x < poly->COOL_2D_nX; x++) {
+    for (x = 0; x < (1 + poly->COOL_2D_nX); x++) {
         psFree(poly->coeff[x]);
         psFree(poly->coeffErr[x]);
@@ -110,6 +110,6 @@
     unsigned int y = 0;
 
-    for (x = 0; x < poly->COOL_3D_nX; x++) {
-        for (y = 0; y < poly->COOL_3D_nY; y++) {
+    for (x = 0; x < (1 + poly->COOL_3D_nX); x++) {
+        for (y = 0; y < (1 + poly->COOL_3D_nY); y++) {
             psFree(poly->coeff[x][y]);
             psFree(poly->coeffErr[x][y]);
@@ -132,7 +132,7 @@
     unsigned int z = 0;
 
-    for (x = 0; x < poly->COOL_4D_nX; x++) {
-        for (y = 0; y < poly->COOL_4D_nY; y++) {
-            for (z = 0; z < poly->COOL_4D_nZ; z++) {
+    for (x = 0; x < (1 + poly->COOL_4D_nX); x++) {
+        for (y = 0; y < (1 + poly->COOL_4D_nY); y++) {
+            for (z = 0; z < (1 + poly->COOL_4D_nZ); z++) {
                 psFree(poly->coeff[x][y][z]);
                 psFree(poly->coeffErr[x][y][z]);
Index: /trunk/psLib/test/math/tst_psFunc00.c
===================================================================
--- /trunk/psLib/test/math/tst_psFunc00.c	(revision 5090)
+++ /trunk/psLib/test/math/tst_psFunc00.c	(revision 5091)
@@ -14,6 +14,8 @@
 *    orders are created.
 * 
-*    @version $Revision: 1.4 $  $Name: not supported by cvs2svn $
-*    @date $Date: 2005-09-22 02:47:16 $
+*    XXX: Compare to FLT_EPSILON
+* 
+*    @version $Revision: 1.5 $  $Name: not supported by cvs2svn $
+*    @date $Date: 2005-09-22 03:00:31 $
 *
 *  Copyright 2004-2005 Maui High Performance Computing Center, Univ. of Hawaii
@@ -131,7 +133,8 @@
         return 4;
     }
+
     for(psS32 i = 0; i < ORDER+1; i++) {
         for(psS32 j = 0; j < ORDER+2; j++) {
-            if(my2DPoly->coeff[i][j] != 0.0) {
+            if(fabs(my2DPoly->coeff[i][j]) > FLT_EPSILON) {
                 psError(PS_ERR_UNKNOWN,true,"Coeff[%d][%d] %lg not as expected %lg",
                         i, j, my2DPoly->coeff[i][j], 0.0);
Index: /trunk/psLib/test/math/tst_psFunc02.c
===================================================================
--- /trunk/psLib/test/math/tst_psFunc02.c	(revision 5090)
+++ /trunk/psLib/test/math/tst_psFunc02.c	(revision 5091)
@@ -51,6 +51,6 @@
             testStatus = false;
         }
-        if ((tmpSpline->spline[i])->n != LINEAR+1) {
-            printf("ERROR: Spline created with order %d\n", (tmpSpline->spline[i])->n);
+        if ((tmpSpline->spline[i])->COOL_1D_n != LINEAR+1) {
+            printf("ERROR: Spline created with order %d\n", (tmpSpline->spline[i])->COOL_1D_n);
             testStatus = false;
         }
@@ -133,6 +133,6 @@
             testStatus = false;
         }
-        if ((tmpSpline->spline[i])->n != LINEAR+1) {
-            printf("ERROR: Spline created with order %d\n", (tmpSpline->spline[i])->n);
+        if ((tmpSpline->spline[i])->COOL_1D_n != LINEAR+1) {
+            printf("ERROR: Spline created with order %d\n", (tmpSpline->spline[i])->COOL_1D_n);
             testStatus = false;
         }
@@ -188,6 +188,6 @@
             testStatus = false;
         }
-        if ((tmpSpline->spline[i])->n != CUBIC+1) {
-            printf("ERROR: Spline created with order %d\n", (tmpSpline->spline[i])->n);
+        if ((tmpSpline->spline[i])->COOL_1D_n != CUBIC+1) {
+            printf("ERROR: Spline created with order %d\n", (tmpSpline->spline[i])->COOL_1D_n);
             testStatus = false;
         }
@@ -270,6 +270,6 @@
             testStatus = false;
         }
-        if ((tmpSpline->spline[i])->n != CUBIC+1) {
-            printf("ERROR: Spline created with order %d\n", (tmpSpline->spline[i])->n);
+        if ((tmpSpline->spline[i])->COOL_1D_n != CUBIC+1) {
+            printf("ERROR: Spline created with order %d\n", (tmpSpline->spline[i])->COOL_1D_n);
             testStatus = false;
         }
@@ -330,6 +330,6 @@
             testStatus = false;
         }
-        if ((tmpSpline->spline[i])->n != LINEAR+1) {
-            printf("ERROR: Spline created with order %d\n", (tmpSpline->spline[i])->n);
+        if ((tmpSpline->spline[i])->COOL_1D_n != LINEAR+1) {
+            printf("ERROR: Spline created with order %d\n", (tmpSpline->spline[i])->COOL_1D_n);
             testStatus = false;
         }
Index: /trunk/psLib/test/math/verified/tst_psMinimize04.stderr
===================================================================
--- /trunk/psLib/test/math/verified/tst_psMinimize04.stderr	(revision 5090)
+++ /trunk/psLib/test/math/verified/tst_psMinimize04.stderr	(revision 5091)
@@ -1,2 +1,6 @@
+<HOST>|E|psGaussJordan (FILE:LINENO)
+    Input matrix contains NaNs.
+<HOST>|E|psGaussJordan (FILE:LINENO)
+    Input matrix contains NaNs.
 <HOST>|E|psVectorFitPolynomial2D (FILE:LINENO)
     Unallowable operation: polynomial poly or its coeffs is NULL.
Index: /trunk/psLib/test/math/verified/tst_psMinimizeVector2D_F32.stderr
===================================================================
--- /trunk/psLib/test/math/verified/tst_psMinimizeVector2D_F32.stderr	(revision 5090)
+++ /trunk/psLib/test/math/verified/tst_psMinimizeVector2D_F32.stderr	(revision 5091)
@@ -1,2 +1,6 @@
+<HOST>|E|psGaussJordan (FILE:LINENO)
+    Input matrix contains NaNs.
+<HOST>|E|psGaussJordan (FILE:LINENO)
+    Input matrix contains NaNs.
 <HOST>|E|psVectorFitPolynomial2D (FILE:LINENO)
     Unallowable operation: polynomial poly or its coeffs is NULL.
