Index: /trunk/psLib/src/math/psPolynomial.c
===================================================================
--- /trunk/psLib/src/math/psPolynomial.c	(revision 5091)
+++ /trunk/psLib/src/math/psPolynomial.c	(revision 5092)
@@ -7,6 +7,6 @@
 *  polynomials.  It also contains a Gaussian functions.
 *
-*  @version $Revision: 1.124 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2005-09-22 03:00:31 $
+*  @version $Revision: 1.125 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2005-09-22 20:45:43 $
 *
 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -298,11 +298,9 @@
     /* This is old code that does not use Clenshaw's formula.  Get rid of it.
 
-    psS32 n;
     psS32 i;
     psF32 tmp;
     psPolynomial1D **chebPolys = NULL;
 
-    n = 1 + poly->COOL_1D_n;
-    chebPolys = createChebyshevPolys(n);
+    chebPolys = createChebyshevPolys(1 + poly->COOL_1D_n);
 
     tmp = 0.0;
@@ -360,9 +358,9 @@
     // Determine how many Chebyshev polynomials
     // are needed, then create them.
-    maxChebyPoly = 1 + poly->COOL_2D_nX;
-    if ((1 + poly->COOL_2D_nY) > maxChebyPoly) {
-        maxChebyPoly = (1 + poly->COOL_2D_nY);
-    }
-    chebPolys = createChebyshevPolys(maxChebyPoly);
+    maxChebyPoly = poly->COOL_2D_nX;
+    if (poly->COOL_2D_nY > maxChebyPoly) {
+        maxChebyPoly = poly->COOL_2D_nY;
+    }
+    chebPolys = createChebyshevPolys(maxChebyPoly + 1);
 
     for (loop_x = 0; loop_x < (1 + poly->COOL_2D_nX); loop_x++) {
@@ -375,5 +373,5 @@
         }
     }
-    for (i=0;i<maxChebyPoly;i++) {
+    for (i=0;i<maxChebyPoly+1;i++) {
         psFree(chebPolys[i]);
     }
@@ -453,5 +451,5 @@
     }
 
-    for (i=0;i<maxChebyPoly;i++) {
+    for (i=0;i<maxChebyPoly+1;i++) {
         psFree(chebPolys[i]);
     }
@@ -529,5 +527,5 @@
         maxChebyPoly = poly->COOL_4D_nT;
     }
-    chebPolys = createChebyshevPolys(maxChebyPoly);
+    chebPolys = createChebyshevPolys(maxChebyPoly + 1);
 
     for (loop_x = 0; loop_x < (1 + poly->COOL_4D_nX); loop_x++) {
@@ -536,4 +534,7 @@
                 for (loop_t = 0; loop_t < (1 + poly->COOL_4D_nZ); loop_t++) {
                     if (poly->mask[loop_x][loop_y][loop_z][loop_t] == 0) {
+                        //printf("HMMM (%d, %d, %d, %d)\n", loop_x, loop_y, loop_z, loop_t);
+                        //printf("HMMM (%d, %d, %d, %d)\n", chebPolys[loop_x]->COOL_1D_n, chebPolys[loop_y]->COOL_1D_n, chebPolys[loop_z]->COOL_1D_n, chebPolys[loop_t]->COOL_1D_n);
+
                         polySum += poly->coeff[loop_x][loop_y][loop_z][loop_t] *
                                    psPolynomial1DEval(chebPolys[loop_x], x) *
@@ -547,5 +548,5 @@
     }
 
-    for (i=0;i<maxChebyPoly;i++) {
+    for (i=0;i<maxChebyPoly+1;i++) {
         psFree(chebPolys[i]);
     }
@@ -618,5 +619,5 @@
                                     psPolynomialType type)
 {
-    PS_ASSERT_INT_POSITIVE(n, NULL);
+    PS_ASSERT_INT_NONNEGATIVE(n, NULL);
 
     unsigned int i = 0;
@@ -628,6 +629,6 @@
     newPoly->type = type;
     newPoly->COOL_1D_n = n;
-    newPoly->coeff = psAlloc(n * sizeof(psF64));
-    newPoly->coeffErr = psAlloc(n * sizeof(psF64));
+    newPoly->coeff = psAlloc((n + 1) * sizeof(psF64));
+    newPoly->coeffErr = psAlloc((n + 1) * sizeof(psF64));
     newPoly->mask = (psMaskType *)psAlloc((n + 1) * sizeof(psMaskType));
     for (i = 0; i < (n + 1); i++) {
Index: /trunk/psLib/test/math/tst_psFunc02.c
===================================================================
--- /trunk/psLib/test/math/tst_psFunc02.c	(revision 5091)
+++ /trunk/psLib/test/math/tst_psFunc02.c	(revision 5092)
@@ -51,5 +51,5 @@
             testStatus = false;
         }
-        if ((tmpSpline->spline[i])->COOL_1D_n != LINEAR+1) {
+        if ((tmpSpline->spline[i])->COOL_1D_n != LINEAR) {
             printf("ERROR: Spline created with order %d\n", (tmpSpline->spline[i])->COOL_1D_n);
             testStatus = false;
@@ -133,5 +133,5 @@
             testStatus = false;
         }
-        if ((tmpSpline->spline[i])->COOL_1D_n != LINEAR+1) {
+        if ((tmpSpline->spline[i])->COOL_1D_n != LINEAR) {
             printf("ERROR: Spline created with order %d\n", (tmpSpline->spline[i])->COOL_1D_n);
             testStatus = false;
@@ -188,5 +188,5 @@
             testStatus = false;
         }
-        if ((tmpSpline->spline[i])->COOL_1D_n != CUBIC+1) {
+        if ((tmpSpline->spline[i])->COOL_1D_n != CUBIC) {
             printf("ERROR: Spline created with order %d\n", (tmpSpline->spline[i])->COOL_1D_n);
             testStatus = false;
@@ -270,5 +270,5 @@
             testStatus = false;
         }
-        if ((tmpSpline->spline[i])->COOL_1D_n != CUBIC+1) {
+        if ((tmpSpline->spline[i])->COOL_1D_n != CUBIC) {
             printf("ERROR: Spline created with order %d\n", (tmpSpline->spline[i])->COOL_1D_n);
             testStatus = false;
@@ -330,5 +330,5 @@
             testStatus = false;
         }
-        if ((tmpSpline->spline[i])->COOL_1D_n != LINEAR+1) {
+        if ((tmpSpline->spline[i])->COOL_1D_n != LINEAR) {
             printf("ERROR: Spline created with order %d\n", (tmpSpline->spline[i])->COOL_1D_n);
             testStatus = false;
Index: /trunk/psLib/test/math/tst_psFunc03.c
===================================================================
--- /trunk/psLib/test/math/tst_psFunc03.c	(revision 5091)
+++ /trunk/psLib/test/math/tst_psFunc03.c	(revision 5092)
@@ -56,6 +56,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) {
+            printf("ERROR: Spline created with order %d\n", (tmpSpline->spline[i])->COOL_1D_n);
             testStatus = false;
         }
@@ -117,6 +117,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) {
+            printf("ERROR: Spline created with order %d\n", (tmpSpline->spline[i])->COOL_1D_n);
             testStatus = false;
         }
Index: /trunk/psLib/test/math/tst_psFunc08.c
===================================================================
--- /trunk/psLib/test/math/tst_psFunc08.c	(revision 5091)
+++ /trunk/psLib/test/math/tst_psFunc08.c	(revision 5092)
@@ -4,9 +4,12 @@
 *  ORD and CHEB type polynomials.
 *
-*  @version  $Revision: 1.4 $  $Name: not supported by cvs2svn $
-*  @date  $Date: 2005-09-22 02:47:16 $
+*  @version  $Revision: 1.5 $  $Name: not supported by cvs2svn $
+*  @date  $Date: 2005-09-22 20:45:43 $
 *
 *  XXX: Probably should test single- and multi-dimensional polynomials in
 *  which one diminsion is constant (n == 1).
+*
+*  XXX: define ORDERS, not TERMS
+* 
 *
 * Copyright 2004-2005 Maui High Performance Computing Center, Univ. of Hawaii
@@ -191,3 +194,2 @@
     return 0;
 }
-
Index: /trunk/psLib/test/math/tst_psFunc09.c
===================================================================
--- /trunk/psLib/test/math/tst_psFunc09.c	(revision 5091)
+++ /trunk/psLib/test/math/tst_psFunc09.c	(revision 5092)
@@ -4,6 +4,6 @@
 *  ORD and CHEB type polynomials.
 *
-*  @version  $Revision: 1.4 $  $Name: not supported by cvs2svn $
-*  @date  $Date: 2005-09-22 02:47:16 $
+*  @version  $Revision: 1.5 $  $Name: not supported by cvs2svn $
+*  @date  $Date: 2005-09-22 20:45:43 $
 *
 * Copyright 2004-2005 Maui High Performance Computing Center, Univ. of Hawaii
@@ -22,6 +22,6 @@
 
 testDescription tests[] = {
-                              {testPoly2DEval,583,"psPolynomial2DEval",0,false},
-                              {testPoly2DEvalVector,000,"psPolynomial2DEvalVector",0,false},
+                              {testPoly2DEval,583,"psPolynomial2DEval",true,false},
+                              {testPoly2DEvalVector,000,"psPolynomial2DEvalVector",true,false},
                               {NULL}
                           };
@@ -82,9 +82,10 @@
 
 // This test will verify operation of 1D polynomial evaluation
-/*psS32 testPoly2DEval(void)
+psS32 testPoly2DEval(void)
 {
-    psF32  result;
-    psF32  resultCheb;
- 
+    psF64  result;
+    psF64  resultCheb;
+    psBool testStatus = true;
+
     // Allocate polynomial structure
     psPolynomial2D*  polyOrd = psPolynomial2DAlloc(TERMS-1, TERMS-1, PS_POLYNOMIAL_ORD);
@@ -101,20 +102,18 @@
     // Evaluate test points and verify results
     for(psS32 i = 0; i < TESTPOINTS; i++) {
-        result = psPolynomial2DEval(polyOrd,poly2DXYValue[i][0],poly2DXYValue[i][1]);
-        if(fabs(poly2DResult[i]-result) > ERROR_TOL ) {
-            psError(PS_ERR_UNKNOWN,true,"Evaluated value %g not as expected %g",
-                    result, poly2DResult[i]);
-            return i;
-        }
-        resultCheb = psPolynomial2DEval(polyCheb,poly2DXYChebValue[i][0], poly2DXYChebValue[i][1]);
-        if(fabs(poly2DChebResult[i]-resultCheb) > ERROR_TOL ) {
-            psError(PS_ERR_UNKNOWN,true,"Evaluated Chebyshev value %lg not as expected %lg",
-                    resultCheb, poly2DChebResult[i]);
-            return 5*i;
+        result = psPolynomial2DEval(polyOrd,Dpoly2DXYValue[i][0],Dpoly2DXYValue[i][1]);
+        if(fabs(Dpoly2DResult[i]-result) > ERROR_TOL ) {
+            printf("TEST ERROR: Evaluated value %f, should be %f\n", result, Dpoly2DResult[i]);
+            testStatus = false;
+        }
+        resultCheb = psPolynomial2DEval(polyCheb,Dpoly2DXYChebValue[i][0],Dpoly2DXYChebValue[i][1]);
+        if(fabs(Dpoly2DChebResult[i]-resultCheb) > ERROR_TOL ) {
+            printf("TEST ERROR: Evaluated value %f, should be %f\n", resultCheb, Dpoly2DChebResult[i]);
+            testStatus = false;
         }
     }
     psFree(polyOrd);
     psFree(polyCheb);
- 
+
     // Allocate polynomial with invalid type
     polyOrd = psPolynomial2DAlloc(TERMS-1, TERMS-1, 99);
@@ -124,176 +123,14 @@
     if ( !isnan(result) ) {
         psError(PS_ERR_UNKNOWN,true,"Did not return NAN for invalid polynomial type");
-        return 20;
+        testStatus = false;
     }
     psFree(polyOrd);
- 
-    return 0;
+
+    return(testStatus);
 }
-*/
-// This test will verify operation of 1D polynomial evaluation
-psS32 testPoly2DEval(void)
-{
-    psF64  result;
-    psF64  resultCheb;
-
-    // Allocate polynomial structure
-    psPolynomial2D*  polyOrd = psPolynomial2DAlloc(TERMS-1, TERMS-1, PS_POLYNOMIAL_ORD);
-    psPolynomial2D*  polyCheb = psPolynomial2DAlloc(TERMS-1, TERMS-1, PS_POLYNOMIAL_CHEB);
-    // Set polynomial members
-    for(psS32 i = 0; i < TERMS; i++) {
-        for(psS32 j = 0; j < TERMS; j++) {
-            polyOrd->coeff[i][j] = poly2DCoeff[i][j];
-            polyOrd->mask[i][j]  = poly2DMask[i][j];
-            polyCheb->coeff[i][j] = 1.0;
-            polyCheb->mask[i][j]  = poly2DMask[i][j];
-        }
-    }
-    // Evaluate test points and verify results
-    for(psS32 i = 0; i < TESTPOINTS; i++) {
-        result = psPolynomial2DEval(polyOrd,Dpoly2DXYValue[i][0],Dpoly2DXYValue[i][1]);
-        if(fabs(Dpoly2DResult[i]-result) > ERROR_TOL ) {
-            psError(PS_ERR_UNKNOWN,true,"Evaluated value %lg not as expected %lg",
-                    result, Dpoly2DResult[i]);
-            return i;
-        }
-        resultCheb = psPolynomial2DEval(polyCheb,Dpoly2DXYChebValue[i][0],Dpoly2DXYChebValue[i][1]);
-        if(fabs(Dpoly2DChebResult[i]-resultCheb) > ERROR_TOL ) {
-            psError(PS_ERR_UNKNOWN,true,"Evaluated Chebyshev value %lg not as expected %lg",
-                    resultCheb, Dpoly2DChebResult[i]);
-            return 5*i;
-        }
-    }
-    psFree(polyOrd);
-    psFree(polyCheb);
-
-    // Allocate polynomial with invalid type
-    polyOrd = psPolynomial2DAlloc(TERMS-1, TERMS-1, 99);
-    // Attempt to evaluation invalid polynomial type
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message invalid type");
-    result = psPolynomial2DEval(polyOrd,0.0, 0.0);
-    if ( !isnan(result) ) {
-        psError(PS_ERR_UNKNOWN,true,"Did not return NAN for invalid polynomial type");
-        return 20;
-    }
-    psFree(polyOrd);
-
-    return 0;
-}
-
-/*psS32 testPoly2DEvalVector(void)
-{
-    // Allocate polynomial
-    psPolynomial2D* polyOrd = psPolynomial2DAlloc(TERMS-1,TERMS-1,PS_POLYNOMIAL_ORD);
-    psPolynomial2D* polyCheb = psPolynomial2DAlloc(TERMS-1,TERMS-1,PS_POLYNOMIAL_CHEB);
- 
-    // Set polynomial members
-    for(psS32 i = 0; i < TERMS; i++) {
-        for(psS32 j = 0; j < TERMS; j++) {
-            polyOrd->coeff[i][j] = poly2DCoeff[i][j];
-            polyOrd->mask[i][j]  = poly2DMask[i][j];
-            polyCheb->coeff[i][j] = 1.0;
-            polyCheb->mask[i][j]  = poly2DMask[i][j];
-        }
-    }
- 
-    // Create input vectors
-    psVector* inputOrdX  = psVectorAlloc(TESTPOINTS, PS_TYPE_F32);
-    psVector* inputOrdY  = psVectorAlloc(TESTPOINTS, PS_TYPE_F32);
-    psVector* inputChebX = psVectorAlloc(TESTPOINTS, PS_TYPE_F32);
-    psVector* inputChebY = psVectorAlloc(TESTPOINTS, PS_TYPE_F32);
-    for(psS32 i = 0; i < TESTPOINTS; i++) {
-        inputOrdX->data.F32[i] = poly2DXYValue[i][0];
-        inputOrdY->data.F32[i] = poly2DXYValue[i][1];
-        inputChebX->data.F32[i] = poly2DXYChebValue[i][0];
-        inputChebY->data.F32[i] = poly2DXYChebValue[i][1];
-    }
- 
-    // Evaluate the vectors
-    psVector* outputOrd = psPolynomial2DEvalVector(polyOrd, inputOrdX, inputOrdY);
-    if(outputOrd == NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Unexpected return of NULL.");
-        return 1;
-    }
-    if(outputOrd->type.type != PS_TYPE_F32) {
-        psError(PS_ERR_UNKNOWN,true,"Output vector of type %d expected %d",
-                outputOrd->type.type, PS_TYPE_F32);
-        return 2;
-    }
-    psVector* outputCheb = psPolynomial2DEvalVector(polyCheb, inputChebX, inputChebY);
-    if(outputCheb == NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Unexpected return of NULL.");
-        return 1;
-    }
-    if(outputCheb->type.type != PS_TYPE_F32) {
-        psError(PS_ERR_UNKNOWN,true,"Output vector of type %d expected %d",
-                outputCheb->type.type, PS_TYPE_F32);
-        return 2;
-    }
- 
-    // Verify the results
-    for(psS32 i = 0; i < TESTPOINTS; i++) {
-        if(fabs(poly2DResult[i]-outputOrd->data.F32[i]) > ERROR_TOL) {
-            psError(PS_ERR_UNKNOWN,true,"Result[%d] %g not equal to expected %g",
-                    i, outputOrd->data.F32[i], poly2DResult[i]);
-            return i*5;
-        }
-        if(fabs(poly2DChebResult[i]-outputCheb->data.F32[i]) > ERROR_TOL) {
-            psError(PS_ERR_UNKNOWN,true,"ResultCheb[%d] %g not equal to expected %g",
-                    i, outputCheb->data.F32[i], poly2DChebResult[i]);
-            return i*10;
-        }
-    }
- 
-    // Attempt to invoke function with null polynomial
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message for NULL polynomial");
-    if(psPolynomial2DEvalVector(NULL, inputOrdX, inputOrdY) != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Return of NULL expected for NULL polynomial");
-        return 60;
-    }
- 
-    // Attempt to invoke function with null input vector
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message for NULL input vector");
-    if(psPolynomial2DEvalVector(polyOrd,NULL, inputOrdY) != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Return of NULL expected for NULL input vector");
-        return 61;
-    }
-    // Attempt to invoke function with null input vector
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message for NULL input vector");
-    if(psPolynomial2DEvalVector(polyOrd, inputOrdX, NULL) != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Return of NULL expected for NULL input vector");
-        return 62;
-    }
- 
-    // Attempt to invoke function with a non F32 type input vector
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message for invalid input type");
-    inputOrdX->type.type = PS_TYPE_U8;
-    if(psPolynomial2DEvalVector(polyOrd,inputOrdX,inputOrdY) != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Return NULL expected for non-F32 input vector");
-        return 63;
-    }
-    inputOrdX->type.type = PS_TYPE_F32;
-    // Attempt to invoke function with a non F32 type input vector
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message for invalid input type");
-    inputOrdY->type.type = PS_TYPE_U8;
-    if(psPolynomial2DEvalVector(polyOrd,inputOrdX,inputOrdY) != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Return NULL expected for non-F32 input vector");
-        return 64;
-    }
-    inputOrdY->type.type = PS_TYPE_F32;
- 
-    psFree(inputOrdX);
-    psFree(inputOrdY);
-    psFree(inputChebX);
-    psFree(inputChebY);
-    psFree(outputOrd);
-    psFree(outputCheb);
-    psFree(polyOrd);
-    psFree(polyCheb);
- 
-    return 0;
-}
-*/
+
 psS32 testPoly2DEvalVector(void)
 {
+    psBool testStatus = true;
     // Allocate polynomial
     psPolynomial2D* polyOrd = psPolynomial2DAlloc(TERMS-1,TERMS-1,PS_POLYNOMIAL_ORD);
@@ -325,21 +162,19 @@
     psVector* outputOrd = psPolynomial2DEvalVector(polyOrd, inputOrdX, inputOrdY);
     if(outputOrd == NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Unexpected return of NULL.");
-        return 1;
+        printf("TEST ERROR: Unexpected return of NULL.\n");
+        testStatus = false;
     }
     if(outputOrd->type.type != PS_TYPE_F64) {
-        psError(PS_ERR_UNKNOWN,true,"Output vector of type %d expected %d",
-                outputOrd->type.type, PS_TYPE_F64);
-        return 2;
+        printf("TEST ERROR: Output vector of type %d expected %d\n", outputOrd->type.type, PS_TYPE_F64);
+        testStatus = false;
     }
     psVector* outputCheb = psPolynomial2DEvalVector(polyCheb, inputChebX, inputChebY);
     if(outputCheb == NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Unexpected return of NULL.");
-        return 1;
+        printf("TEST ERROR: Unexpected return of NULL.\n");
+        testStatus = false;
     }
     if(outputCheb->type.type != PS_TYPE_F64) {
-        psError(PS_ERR_UNKNOWN,true,"Output vector of type %d expected %d",
-                outputCheb->type.type, PS_TYPE_F64);
-        return 2;
+        printf("TEST ERROR: Output vector of type %d expected %d.\n", outputCheb->type.type, PS_TYPE_F64);
+        testStatus = false;
     }
 
@@ -347,12 +182,12 @@
     for(psS32 i = 0; i < TESTPOINTS; i++) {
         if(fabs(poly2DResult[i]-outputOrd->data.F64[i]) > ERROR_TOL) {
-            psError(PS_ERR_UNKNOWN,true,"Result[%d] %lg not equal to expected %lg",
-                    i, outputOrd->data.F64[i], poly2DResult[i]);
-            return i*5;
+            printf("TEST ERROR: Result[%d] %lg not equal to expected %lg.\n",
+                   i, outputOrd->data.F64[i], poly2DResult[i]);
+            testStatus = false;
         }
         if(fabs(poly2DChebResult[i]-outputCheb->data.F64[i]) > ERROR_TOL) {
-            psError(PS_ERR_UNKNOWN,true,"ResultCheb[%d] %lg not equal to expected %lg",
-                    i, outputCheb->data.F64[i], poly2DChebResult[i]);
-            return i*10;
+            printf("TEST ERROR: ResultCheb[%d] %lg not equal to expected %lg.\n",
+                   i, outputCheb->data.F64[i], poly2DChebResult[i]);
+            testStatus = false;
         }
     }
@@ -361,6 +196,6 @@
     psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message for NULL polynomial");
     if(psPolynomial2DEvalVector(NULL, inputOrdX, inputOrdY) != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Return of NULL expected for NULL polynomial");
-        return 60;
+        printf("TEST ERROR: Return of NULL expected for NULL polynomial.\n");
+        testStatus = false;
     }
 
@@ -368,12 +203,12 @@
     psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message for NULL input vector");
     if(psPolynomial2DEvalVector(polyOrd,NULL,inputOrdY) != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Return of NULL expected for NULL input vector");
-        return 61;
+        printf("TEST ERROR: Return of NULL expected for NULL input vector.\n");
+        testStatus = false;
     }
     // Attempt to invoke function with null input vector
     psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message for NULL input vector");
     if(psPolynomial2DEvalVector(polyOrd,inputOrdX,NULL) != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Return of NULL expected for NULL input vector");
-        return 62;
+        printf("TEST ERROR: Return of NULL expected for NULL input vector.\n");
+        testStatus = false;
     }
 
@@ -382,6 +217,6 @@
     inputOrdX->type.type = PS_TYPE_U8;
     if(psPolynomial2DEvalVector(polyOrd,inputOrdX, inputOrdY) != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Return NULL expected for non-F64 input vector");
-        return 63;
+        printf("TEST ERROR: Return NULL expected for non-F64 input vector.\n");
+        testStatus = false;
     }
     inputOrdX->type.type = PS_TYPE_F64;
@@ -390,6 +225,6 @@
     inputOrdY->type.type = PS_TYPE_U8;
     if(psPolynomial2DEvalVector(polyOrd,inputOrdX, inputOrdY) != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Return NULL expected for non-F64 input vector");
-        return 64;
+        printf("TEST ERROR: Return NULL expected for non-F64 input vector.\n");
+        testStatus = false;
     }
     inputOrdY->type.type = PS_TYPE_F64;
@@ -404,5 +239,5 @@
     psFree(polyCheb);
 
-    return 0;
+    return(testStatus);
 }
 
Index: /trunk/psLib/test/math/tst_psFunc10.c
===================================================================
--- /trunk/psLib/test/math/tst_psFunc10.c	(revision 5091)
+++ /trunk/psLib/test/math/tst_psFunc10.c	(revision 5092)
@@ -4,6 +4,6 @@
 *  ORD and CHEB type polynomials.
 *
-*  @version  $Revision: 1.4 $  $Name: not supported by cvs2svn $
-*  @date  $Date: 2005-09-22 02:47:16 $
+*  @version  $Revision: 1.5 $  $Name: not supported by cvs2svn $
+*  @date  $Date: 2005-09-22 20:45:43 $
 *
 * Copyright 2004-2005 Maui High Performance Computing Center, Univ. of Hawaii
@@ -22,6 +22,6 @@
 
 testDescription tests[] = {
-                              {testPoly3DEval,583,"psPolynomial3DEval",0,false},
-                              {testPoly3DEvalVector,000,"psPolynomial3DEvalVector",0,false},
+                              {testPoly3DEval,583,"psPolynomial3DEval",true,false},
+                              {testPoly3DEvalVector,000,"psPolynomial3DEvalVector",true,false},
                               {NULL}
                           };
@@ -133,62 +133,9 @@
 
 // This test will verify operation of 1D polynomial evaluation
-/*psS32 testPoly3DEval(void)
-{
-    psF32  result;
-    psF32  resultCheb;
- 
-    // Allocate polynomial structure
-    psPolynomial3D*  polyOrd = psPolynomial3DAlloc(TERMS-1, TERMS-1, TERMS-1, PS_POLYNOMIAL_ORD);
-    psPolynomial3D*  polyCheb = psPolynomial3DAlloc(TERMS-1, TERMS-1, TERMS-1, PS_POLYNOMIAL_CHEB);
-    // Set polynomial members
-    for(psS32 i = 0; i < TERMS; i++) {
-        for(psS32 j = 0; j < TERMS; j++) {
-            for(psS32 k = 0; k < TERMS; k++) {
-                polyOrd->coeff[i][j][k] = poly3DCoeff[i][j][k];
-                polyOrd->mask[i][j][k]  = poly3DMask[i][j][k];
-                polyCheb->coeff[i][j][k] = 1.0;
-                polyCheb->mask[i][j][k]  = poly3DMask[i][j][k];
-            }
-        }
-    }
-    // Evaluate test points and verify results
-    for(psS32 i = 0; i < TESTPOINTS; i++) {
-        result = psPolynomial3DEval(polyOrd,poly3DXYZValue[i][0],poly3DXYZValue[i][1],
-                                    poly3DXYZValue[i][2]);
-        if(fabs(poly3DResult[i]-result) > ERROR_TOL ) {
-            psError(PS_ERR_UNKNOWN,true,"Evaluated value %g not as expected %g",
-                    result, poly3DResult[i]);
-            return i;
-        }
-        resultCheb = psPolynomial3DEval(polyCheb,poly3DXYZChebValue[i][0], poly3DXYZChebValue[i][1],
-                                        poly3DXYZChebValue[i][2]);
-        if(fabs(poly3DChebResult[i]-resultCheb) > ERROR_TOL ) {
-            psError(PS_ERR_UNKNOWN,true,"Evaluated Chebyshev value %lg not as expected %lg",
-                    resultCheb, poly3DChebResult[i]);
-            return 5*i;
-        }
-    }
-    psFree(polyOrd);
-    psFree(polyCheb);
- 
-    // Allocate polynomial with invalid type
-    polyOrd = psPolynomial3DAlloc(TERMS-1, TERMS-1, TERMS-1, 99);
-    // Attempt to evaluation invalid polynomial type
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message invalid type");
-    result = psPolynomial3DEval(polyOrd,0.0, 0.0, 0.0);
-    if ( !isnan(result) ) {
-        psError(PS_ERR_UNKNOWN,true,"Did not return NAN for invalid polynomial type");
-        return 20;
-    }
-    psFree(polyOrd);
- 
-    return 0;
-}
-*/
-// This test will verify operation of 1D polynomial evaluation
 psS32 testPoly3DEval(void)
 {
     psF64  result;
     psF64  resultCheb;
+    psBool testStatus = true;
 
     // Allocate polynomial structure
@@ -211,14 +158,14 @@
                                     Dpoly3DXYZValue[i][2]);
         if(fabs(Dpoly3DResult[i]-result) > ERROR_TOL ) {
-            psError(PS_ERR_UNKNOWN,true,"Evaluated value %lg not as expected %lg",
-                    result, Dpoly3DResult[i]);
-            return i;
+            printf("TEST ERROR: Evaluated value %lg not as expected %lg.\n",
+                   result, Dpoly3DResult[i]);
+            testStatus = false;
         }
         resultCheb = psPolynomial3DEval(polyCheb,Dpoly3DXYZChebValue[i][0],Dpoly3DXYZChebValue[i][1],
                                         Dpoly3DXYZChebValue[i][2]);
         if(fabs(Dpoly3DChebResult[i]-resultCheb) > ERROR_TOL ) {
-            psError(PS_ERR_UNKNOWN,true,"Evaluated Chebyshev value %lg not as expected %lg",
-                    resultCheb, Dpoly3DChebResult[i]);
-            return 5*i;
+            printf("TEST ERROR: Evaluated Chebyshev value %lg not as expected %lg.\n",
+                   resultCheb, Dpoly3DChebResult[i]);
+            testStatus = false;
         }
     }
@@ -232,6 +179,6 @@
     result = psPolynomial3DEval(polyOrd,0.0, 0.0, 0.0);
     if ( !isnan(result) ) {
-        psError(PS_ERR_UNKNOWN,true,"Did not return NAN for invalid polynomial type");
-        return 20;
+        printf("TEST ERROR: Did not return NAN for invalid polynomial type.\n");
+        testStatus = false;
     }
     psFree(polyOrd);
@@ -240,141 +187,7 @@
 }
 
-/*psS32 testPoly3DEvalVector(void)
-{
-    // Allocate polynomial
-    psPolynomial3D* polyOrd  = psPolynomial3DAlloc(TERMS-1, TERMS-1, TERMS-1,PS_POLYNOMIAL_ORD);
-    psPolynomial3D* polyCheb = psPolynomial3DAlloc(TERMS-1, TERMS-1, TERMS-1,PS_POLYNOMIAL_CHEB);
- 
-    // Set polynomial members
-    for(psS32 i = 0; i < TERMS; i++) {
-        for(psS32 j = 0; j < TERMS; j++) {
-            for(psS32 k = 0; k < TERMS; k++) {
-                polyOrd->coeff[i][j][k] = poly3DCoeff[i][j][k];
-                polyOrd->mask[i][j][k]  = poly3DMask[i][j][k];
-                polyCheb->coeff[i][j][k] = 1.0;
-                polyCheb->mask[i][j][k]  = poly3DMask[i][j][k];
-            }
-        }
-    }
- 
-    // Create input vectors
-    psVector* inputOrdX  = psVectorAlloc(TESTPOINTS, PS_TYPE_F32);
-    psVector* inputOrdY  = psVectorAlloc(TESTPOINTS, PS_TYPE_F32);
-    psVector* inputOrdZ  = psVectorAlloc(TESTPOINTS, PS_TYPE_F32);
-    psVector* inputChebX = psVectorAlloc(TESTPOINTS, PS_TYPE_F32);
-    psVector* inputChebY = psVectorAlloc(TESTPOINTS, PS_TYPE_F32);
-    psVector* inputChebZ = psVectorAlloc(TESTPOINTS, PS_TYPE_F32);
-    for(psS32 i = 0; i < TESTPOINTS; i++) {
-        inputOrdX->data.F32[i] = poly3DXYZValue[i][0];
-        inputOrdY->data.F32[i] = poly3DXYZValue[i][1];
-        inputOrdZ->data.F32[i] = poly3DXYZValue[i][2];
-        inputChebX->data.F32[i] = poly3DXYZChebValue[i][0];
-        inputChebY->data.F32[i] = poly3DXYZChebValue[i][1];
-        inputChebZ->data.F32[i] = poly3DXYZChebValue[i][2];
-    }
- 
-    // Evaluate the vectors
-    psVector* outputOrd = psPolynomial3DEvalVector(polyOrd,inputOrdX,inputOrdY,inputOrdZ);
-    if(outputOrd == NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Unexpected return of NULL.");
-        return 1;
-    }
-    if(outputOrd->type.type != PS_TYPE_F32) {
-        psError(PS_ERR_UNKNOWN,true,"Output vector of type %d expected %d",
-                outputOrd->type.type, PS_TYPE_F32);
-        return 2;
-    }
-    psVector* outputCheb = psPolynomial3DEvalVector(polyCheb,inputChebX,inputChebY,inputChebZ);
-    if(outputCheb == NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Unexpected return of NULL.");
-        return 1;
-    }
-    if(outputCheb->type.type != PS_TYPE_F32) {
-        psError(PS_ERR_UNKNOWN,true,"Output vector of type %d expected %d",
-                outputCheb->type.type, PS_TYPE_F32);
-        return 2;
-    }
- 
-    // Verify the results
-    for(psS32 i = 0; i < TESTPOINTS; i++) {
-        if(fabs(poly3DResult[i]-outputOrd->data.F32[i]) > ERROR_TOL) {
-            psError(PS_ERR_UNKNOWN,true,"Result[%d] %g not equal to expected %g",
-                    i, outputOrd->data.F32[i], poly3DResult[i]);
-            return i*5;
-        }
-        if(fabs(poly3DChebResult[i]-outputCheb->data.F32[i]) > ERROR_TOL) {
-            psError(PS_ERR_UNKNOWN,true,"ResultCheb[%d] %g not equal to expected %g",
-                    i, outputCheb->data.F32[i], poly3DChebResult[i]);
-            return i*10;
-        }
-    }
- 
-    // Attempt to invoke function with null polynomial
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message for NULL polynomial");
-    if(psPolynomial3DEvalVector(NULL, inputOrdX, inputOrdY, inputOrdZ) != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Return of NULL expected for NULL polynomial");
-        return 60;
-    }
- 
-    // Attempt to invoke function with null input vector
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message for NULL input vector");
-    if(psPolynomial3DEvalVector(polyOrd,NULL, inputOrdY,inputOrdZ) != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Return of NULL expected for NULL input vector");
-        return 61;
-    }
-    // Attempt to invoke function with null input vector
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message for NULL input vector");
-    if(psPolynomial3DEvalVector(polyOrd, inputOrdX, NULL,inputOrdZ) != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Return of NULL expected for NULL input vector");
-        return 62;
-    }
-    // Attempt to invoke function with null input vector
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message for NULL input vector");
-    if(psPolynomial3DEvalVector(polyOrd, inputOrdX,inputOrdY,NULL) != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Return of NULL expected for NULL input vector");
-        return 63;
-    }
- 
-    // Attempt to invoke function with a non F32 type input vector
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message for invalid input type");
-    inputOrdX->type.type = PS_TYPE_U8;
-    if(psPolynomial3DEvalVector(polyOrd,inputOrdX,inputOrdY,inputOrdZ) != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Return NULL expected for non-F32 input vector");
-        return 65;
-    }
-    inputOrdX->type.type = PS_TYPE_F32;
-    // Attempt to invoke function with a non F32 type input vector
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message for invalid input type");
-    inputOrdY->type.type = PS_TYPE_U8;
-    if(psPolynomial3DEvalVector(polyOrd,inputOrdX,inputOrdY,inputOrdZ) != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Return NULL expected for non-F32 input vector");
-        return 66;
-    }
-    inputOrdY->type.type = PS_TYPE_F32;
-    // Attempt to invoke function with a non F32 type input vector
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message for invalid input type");
-    inputOrdZ->type.type = PS_TYPE_U8;
-    if(psPolynomial3DEvalVector(polyOrd,inputOrdX,inputOrdY,inputOrdZ) != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Return NULL expected for non-F32 input vector");
-        return 67;
-    }
-    inputOrdZ->type.type = PS_TYPE_F32;
- 
-    psFree(inputOrdX);
-    psFree(inputOrdY);
-    psFree(inputOrdZ);
-    psFree(inputChebX);
-    psFree(inputChebY);
-    psFree(inputChebZ);
-    psFree(outputOrd);
-    psFree(outputCheb);
-    psFree(polyOrd);
-    psFree(polyCheb);
- 
-    return 0;
-}
-*/
 psS32 testPoly3DEvalVector(void)
 {
+    psBool testStatus = true;
     // Allocate polynomial
     psPolynomial3D* polyOrd = psPolynomial3DAlloc(TERMS-1, TERMS-1, TERMS-1,PS_POLYNOMIAL_ORD);
@@ -412,21 +225,21 @@
     psVector* outputOrd = psPolynomial3DEvalVector(polyOrd,inputOrdX,inputOrdY,inputOrdZ);
     if(outputOrd == NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Unexpected return of NULL.");
-        return 1;
+        printf("TEST ERROR: Unexpected return of NULL.\n");
+        testStatus = false;
     }
     if(outputOrd->type.type != PS_TYPE_F64) {
-        psError(PS_ERR_UNKNOWN,true,"Output vector of type %d expected %d",
-                outputOrd->type.type, PS_TYPE_F64);
-        return 2;
+        printf("TEST ERROR: Output vector of type %d expected %d.\n",
+               outputOrd->type.type, PS_TYPE_F64);
+        testStatus = false;
     }
     psVector* outputCheb = psPolynomial3DEvalVector(polyCheb,inputChebX,inputChebY,inputChebZ);
     if(outputCheb == NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Unexpected return of NULL.");
-        return 1;
+        printf("TEST ERROR: Unexpected return of NULL.\n");
+        testStatus = false;
     }
     if(outputCheb->type.type != PS_TYPE_F64) {
-        psError(PS_ERR_UNKNOWN,true,"Output vector of type %d expected %d",
-                outputCheb->type.type, PS_TYPE_F64);
-        return 2;
+        printf("TEST ERROR: Output vector of type %d expected %d.\n",
+               outputCheb->type.type, PS_TYPE_F64);
+        testStatus = false;
     }
 
@@ -434,12 +247,12 @@
     for(psS32 i = 0; i < TESTPOINTS; i++) {
         if(fabs(Dpoly3DResult[i]-outputOrd->data.F64[i]) > ERROR_TOL) {
-            psError(PS_ERR_UNKNOWN,true,"Result[%d] %lg not equal to expected %lg",
-                    i, outputOrd->data.F64[i], Dpoly3DResult[i]);
-            return i*5;
+            printf("TEST ERROR: Result[%d] %lg not equal to expected %lg.\n",
+                   i, outputOrd->data.F64[i], Dpoly3DResult[i]);
+            testStatus = false;
         }
         if(fabs(Dpoly3DChebResult[i]-outputCheb->data.F64[i]) > ERROR_TOL) {
-            psError(PS_ERR_UNKNOWN,true,"ResultCheb[%d] %lg not equal to expected %lg",
-                    i, outputCheb->data.F64[i], Dpoly3DChebResult[i]);
-            return i*10;
+            printf("TEST ERROR: ResultCheb[%d] %lg not equal to expected %lg.\n",
+                   i, outputCheb->data.F64[i], Dpoly3DChebResult[i]);
+            testStatus = false;
         }
     }
@@ -448,6 +261,6 @@
     psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message for NULL polynomial");
     if(psPolynomial3DEvalVector(NULL,inputOrdX,inputOrdY,inputOrdZ) != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Return of NULL expected for NULL polynomial");
-        return 60;
+        printf("TEST ERROR: Return of NULL expected for NULL polynomial.\n");
+        testStatus = false;
     }
 
@@ -455,18 +268,18 @@
     psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message for NULL input vector");
     if(psPolynomial3DEvalVector(polyOrd,NULL,inputOrdY,inputOrdZ) != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Return of NULL expected for NULL input vector");
-        return 61;
+        printf("TEST ERROR: Return of NULL expected for NULL input vector.\n");
+        testStatus = false;
     }
     // Attempt to invoke function with null input vector
     psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message for NULL input vector");
     if(psPolynomial3DEvalVector(polyOrd,inputOrdX,NULL,inputOrdZ) != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Return of NULL expected for NULL input vector");
-        return 62;
+        printf("TEST ERROR: Return of NULL expected for NULL input vector.\n");
+        testStatus = false;
     }
     // Attempt to invoke function with null input vector
     psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message for NULL input vector");
     if(psPolynomial3DEvalVector(polyOrd,inputOrdX,inputOrdY,NULL) != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Return of NULL expected for NULL input vector");
-        return 63;
+        printf("TEST ERROR: Return of NULL expected for NULL input vector.\n");
+        testStatus = false;
     }
 
@@ -475,6 +288,6 @@
     inputOrdX->type.type = PS_TYPE_U8;
     if(psPolynomial3DEvalVector(polyOrd,inputOrdX,inputOrdY,inputOrdZ) != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Return NULL expected for non-F64 input vector");
-        return 64;
+        printf("TEST ERROR: Return NULL expected for non-F64 input vector.\n");
+        testStatus = false;
     }
     inputOrdX->type.type = PS_TYPE_F64;
@@ -483,6 +296,6 @@
     inputOrdY->type.type = PS_TYPE_U8;
     if(psPolynomial3DEvalVector(polyOrd,inputOrdX,inputOrdY,inputOrdZ) != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Return NULL expected for non-F64 input vector");
-        return 65;
+        printf("TEST ERROR: Return NULL expected for non-F64 input vector.\n");
+        testStatus = false;
     }
     inputOrdY->type.type = PS_TYPE_F64;
@@ -491,6 +304,6 @@
     inputOrdZ->type.type = PS_TYPE_U8;
     if(psPolynomial3DEvalVector(polyOrd,inputOrdX,inputOrdY,inputOrdZ) != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Return NULL expected for non-F64 input vector");
-        return 66;
+        printf("TEST ERROR: Return NULL expected for non-F64 input vector.\n");
+        testStatus = false;
     }
     inputOrdZ->type.type = PS_TYPE_F64;
Index: /trunk/psLib/test/math/tst_psFunc11.c
===================================================================
--- /trunk/psLib/test/math/tst_psFunc11.c	(revision 5091)
+++ /trunk/psLib/test/math/tst_psFunc11.c	(revision 5092)
@@ -4,6 +4,6 @@
 *  ORD and CHEB type polynomials.
 *
-*  @version  $Revision: 1.4 $  $Name: not supported by cvs2svn $
-*  @date  $Date: 2005-09-22 02:47:16 $
+*  @version  $Revision: 1.5 $  $Name: not supported by cvs2svn $
+*  @date  $Date: 2005-09-22 20:45:43 $
 *
 * Copyright 2004-2005 Maui High Performance Computing Center, Univ. of Hawaii
@@ -19,9 +19,9 @@
 
 static psS32 testPoly4DEval(void);
-static psS32 testPoly4DEvalVector(void);
+//static psS32 testPoly4DEvalVector(void);
 
 testDescription tests[] = {
-                              {testPoly4DEval,583,"psPolynomial4DEval",0,false},
-                              {testPoly4DEvalVector,000,"psPolynomial4DEvalVector",0,false},
+                              {testPoly4DEval,583,"psPolynomial4DEval",true,false},
+                              //                              {testPoly4DEvalVector,000,"psPolynomial4DEvalVector",true,false},
                               {NULL}
                           };
@@ -374,65 +374,8 @@
 }
 
-// This test will verify operation of 1D polynomial evaluation
-/*psS32 testPoly4DEval(void)
-{
-    psF32  result;
-    psF32  resultCheb;
- 
-    // Allocate polynomial structure
-    psPolynomial4D*  polyOrd  = psPolynomial4DAlloc(TERMS-1, TERMS-1, TERMS-1, TERMS-1, PS_POLYNOMIAL_ORD);
-    psPolynomial4D*  polyCheb = psPolynomial4DAlloc(TERMS-1, TERMS-1, TERMS-1, TERMS-1, PS_POLYNOMIAL_CHEB);
-    // Set polynomial members
-    for(psS32 i = 0; i < TERMS; i++) {
-        for(psS32 j = 0; j < TERMS; j++) {
-            for(psS32 k = 0; k < TERMS; k++) {
-                for(psS32 l = 0; l < TERMS; l++) {
-                    polyOrd->coeff[i][j][k][l] = poly4DCoeff[i][j][k][l];
-                    polyOrd->mask[i][j][k][l]  = poly4DMask[i][j][k][l];
-                    polyCheb->coeff[i][j][k][l] = 1.0;
-                    polyCheb->mask[i][j][k][l]  = poly4DMask[i][j][k][l];
-                }
-            }
-        }
-    }
-    // Evaluate test points and verify results
-    for(psS32 i = 0; i < TESTPOINTS; i++) {
-        result = psPolynomial4DEval(polyOrd,poly4DWXYZValue[i][0],poly4DWXYZValue[i][1],
-                                    poly4DWXYZValue[i][2], poly4DWXYZValue[i][3]);
-        if(fabs(poly4DResult[i]-result) > ERROR_TOL ) {
-            psError(PS_ERR_UNKNOWN,true,"Evaluated value %g not as expected %g",
-                    result, poly4DResult[i]);
-            return i;
-        }
-        resultCheb = psPolynomial4DEval(polyCheb,poly4DWXYZChebValue[i][0], poly4DWXYZChebValue[i][1],
-                                        poly4DWXYZChebValue[i][2], poly4DWXYZChebValue[i][3]);
-        if(fabs(poly4DChebResult[i]-resultCheb) > ERROR_TOL ) {
-            psError(PS_ERR_UNKNOWN,true,"Evaluated Chebyshev value %lg not as expected %lg",
-                    resultCheb, poly4DChebResult[i]);
-            return 5*i;
-        }
-    }
-    psFree(polyOrd);
-    psFree(polyCheb);
- 
-    // Allocate polynomial with invalid type
-    polyOrd = psPolynomial4DAlloc(TERMS-1, TERMS-1, TERMS-1, TERMS-1, 99);
-    // Attempt to evaluation invalid polynomial type
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message invalid type");
-    result = psPolynomial4DEval(polyOrd,0.0, 0.0, 0.0, 0.0);
-    if ( !isnan(result) ) {
-        psError(PS_ERR_UNKNOWN,true,"Did not return NAN for invalid polynomial type");
-        return 20;
-    }
-    psFree(polyOrd);
- 
-    return 0;
-}
-*/
-// This test will verify operation of 1D polynomial evaluation
+// This test will verify operation of 4D polynomial evaluation
 psS32 testPoly4DEval(void)
 {
-    psF64  result;
-    psF64  resultCheb;
+    psBool testStatus = true;
 
     // Allocate polynomial structure
@@ -452,21 +395,24 @@
         }
     }
+
     // Evaluate test points and verify results
     for(psS32 i = 0; i < TESTPOINTS; i++) {
-        result = psPolynomial4DEval(polyOrd,Dpoly4DWXYZValue[i][0],Dpoly4DWXYZValue[i][1],
-                                    Dpoly4DWXYZValue[i][2],Dpoly4DWXYZValue[i][3]);
+        psF64 result = psPolynomial4DEval(polyOrd,Dpoly4DWXYZValue[i][0],Dpoly4DWXYZValue[i][1],
+                                          Dpoly4DWXYZValue[i][2],Dpoly4DWXYZValue[i][3]);
         if(fabs(Dpoly4DResult[i]-result) > ERROR_TOL ) {
-            psError(PS_ERR_UNKNOWN,true,"Evaluated value %lg not as expected %lg",
-                    result, Dpoly4DResult[i]);
-            return i;
+            printf("TEST ERROR: Evaluated value %lg not as expected %lg.\n",
+                   result, Dpoly4DResult[i]);
+            testStatus = false;
         }
-        resultCheb = psPolynomial4DEval(polyCheb,Dpoly4DWXYZChebValue[i][0],Dpoly4DWXYZChebValue[i][1],
-                                        Dpoly4DWXYZChebValue[i][2],Dpoly4DWXYZChebValue[i][3]);
+
+        psF64 resultCheb = psPolynomial4DEval(polyCheb,Dpoly4DWXYZChebValue[i][0],Dpoly4DWXYZChebValue[i][1],
+                                              Dpoly4DWXYZChebValue[i][2],Dpoly4DWXYZChebValue[i][3]);
         if(fabs(Dpoly4DChebResult[i]-resultCheb) > ERROR_TOL ) {
-            psError(PS_ERR_UNKNOWN,true,"Evaluated Chebyshev value %lg not as expected %lg",
-                    resultCheb, Dpoly4DChebResult[i]);
-            return 5*i;
+            printf("TEST ERROR: Evaluated Chebyshev value %lg not as expected %lg.\n",
+                   resultCheb, Dpoly4DChebResult[i]);
+            testStatus = false;
         }
     }
+
     psFree(polyOrd);
     psFree(polyCheb);
@@ -476,171 +422,14 @@
     // Attempt to evaluation invalid polynomial type
     psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message invalid type");
-    result = psPolynomial4DEval(polyOrd,0.0, 0.0, 0.0, 0.0);
+    psF64 result = psPolynomial4DEval(polyOrd,0.0, 0.0, 0.0, 0.0);
     if ( !isnan(result) ) {
-        psError(PS_ERR_UNKNOWN,true,"Did not return NAN for invalid polynomial type");
-        return 20;
+        printf("TEST ERROR: Did not return NAN for invalid polynomial type");
+        testStatus = false;
     }
     psFree(polyOrd);
 
-    return 0;
+    return(testStatus);
 }
-
-/*psS32 testPoly4DEvalVector(void)
-{
-    // Allocate polynomial
-    psPolynomial4D* polyOrd  = psPolynomial4DAlloc(TERMS-1, TERMS-1, TERMS-1, TERMS-1, PS_POLYNOMIAL_ORD);
-    psPolynomial4D* polyCheb = psPolynomial4DAlloc(TERMS-1, TERMS-1, TERMS-1, TERMS-1, PS_POLYNOMIAL_CHEB);
- 
-    // Set polynomial members
-    for(psS32 i = 0; i < TERMS; i++) {
-        for(psS32 j = 0; j < TERMS; j++) {
-            for(psS32 k = 0; k < TERMS; k++) {
-                for(psS32 l = 0; l < TERMS; l++) {
-                    polyOrd->coeff[i][j][k][l] = poly4DCoeff[i][j][k][l];
-                    polyOrd->mask[i][j][k][l]  = poly4DMask[i][j][k][l];
-                    polyCheb->coeff[i][j][k][l] = 1.0;
-                    polyCheb->mask[i][j][k][l]  = poly4DMask[i][j][k][l];
-                }
-            }
-        }
-    }
- 
-    // Create input vectors
-    psVector* inputOrdW  = psVectorAlloc(TESTPOINTS, PS_TYPE_F32);
-    psVector* inputOrdX  = psVectorAlloc(TESTPOINTS, PS_TYPE_F32);
-    psVector* inputOrdY  = psVectorAlloc(TESTPOINTS, PS_TYPE_F32);
-    psVector* inputOrdZ  = psVectorAlloc(TESTPOINTS, PS_TYPE_F32);
-    psVector* inputChebW = psVectorAlloc(TESTPOINTS, PS_TYPE_F32);
-    psVector* inputChebX = psVectorAlloc(TESTPOINTS, PS_TYPE_F32);
-    psVector* inputChebY = psVectorAlloc(TESTPOINTS, PS_TYPE_F32);
-    psVector* inputChebZ = psVectorAlloc(TESTPOINTS, PS_TYPE_F32);
-    for(psS32 i = 0; i < TESTPOINTS; i++) {
-        inputOrdW->data.F32[i] = poly4DWXYZValue[i][0];
-        inputOrdX->data.F32[i] = poly4DWXYZValue[i][1];
-        inputOrdY->data.F32[i] = poly4DWXYZValue[i][2];
-        inputOrdZ->data.F32[i] = poly4DWXYZValue[i][3];
-        inputChebW->data.F32[i] = poly4DWXYZChebValue[i][0];
-        inputChebX->data.F32[i] = poly4DWXYZChebValue[i][1];
-        inputChebY->data.F32[i] = poly4DWXYZChebValue[i][2];
-        inputChebZ->data.F32[i] = poly4DWXYZChebValue[i][3];
-    }
- 
-    // Evaluate the vectors
-    psVector* outputOrd = psPolynomial4DEvalVector(polyOrd,inputOrdW,inputOrdX,inputOrdY,inputOrdZ);
-    if(outputOrd == NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Unexpected return of NULL.");
-        return 1;
-    }
-    if(outputOrd->type.type != PS_TYPE_F32) {
-        psError(PS_ERR_UNKNOWN,true,"Output vector of type %d expected %d",
-                outputOrd->type.type, PS_TYPE_F32);
-        return 2;
-    }
-    psVector* outputCheb = psPolynomial4DEvalVector(polyCheb,inputChebW,inputChebX,inputChebY,inputChebZ);
-    if(outputCheb == NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Unexpected return of NULL.");
-        return 1;
-    }
-    if(outputCheb->type.type != PS_TYPE_F32) {
-        psError(PS_ERR_UNKNOWN,true,"Output vector of type %d expected %d",
-                outputCheb->type.type, PS_TYPE_F32);
-        return 2;
-    }
- 
-    // Verify the results
-    for(psS32 i = 0; i < TESTPOINTS; i++) {
-        if(fabs(poly4DResult[i]-outputOrd->data.F32[i]) > ERROR_TOL) {
-            psError(PS_ERR_UNKNOWN,true,"Result[%d] %g not equal to expected %g",
-                    i, outputOrd->data.F32[i], poly4DResult[i]);
-            return i*5;
-        }
-        if(fabs(poly4DChebResult[i]-outputCheb->data.F32[i]) > ERROR_TOL) {
-            psError(PS_ERR_UNKNOWN,true,"ResultCheb[%d] %g not equal to expected %g",
-                    i, outputCheb->data.F32[i], poly4DChebResult[i]);
-            return i*10;
-        }
-    }
- 
-    // Attempt to invoke function with null polynomial
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message for NULL polynomial");
-    if(psPolynomial4DEvalVector(NULL, inputOrdW, inputOrdX, inputOrdY, inputOrdZ) != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Return of NULL expected for NULL polynomial");
-        return 60;
-    }
- 
-    // Attempt to invoke function with null input vector
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message for NULL input vector");
-    if(psPolynomial4DEvalVector(polyOrd,NULL,inputOrdX, inputOrdY,inputOrdZ) != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Return of NULL expected for NULL input vector");
-        return 61;
-    }
-    // Attempt to invoke function with null input vector
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message for NULL input vector");
-    if(psPolynomial4DEvalVector(polyOrd, inputOrdW, NULL, inputOrdY, inputOrdZ) != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Return of NULL expected for NULL input vector");
-        return 62;
-    }
-    // Attempt to invoke function with null input vector
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message for NULL input vector");
-    if(psPolynomial4DEvalVector(polyOrd, inputOrdW, inputOrdX,NULL,inputOrdZ) != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Return of NULL expected for NULL input vector");
-        return 63;
-    }
-    // Attempt to invoke function with null input vector
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message for NULL input vector");
-    if(psPolynomial4DEvalVector(polyOrd, inputOrdW, inputOrdX,inputOrdY,NULL) != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Return of NULL expected for NULL input vector");
-        return 64;
-    }
- 
-    // Attempt to invoke function with a non F32 type input vector
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message for invalid input type");
-    inputOrdX->type.type = PS_TYPE_U8;
-    if(psPolynomial4DEvalVector(polyOrd,inputOrdW,inputOrdX,inputOrdY,inputOrdZ) != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Return NULL expected for non-F32 input vector");
-        return 65;
-    }
-    inputOrdX->type.type = PS_TYPE_F32;
-    // Attempt to invoke function with a non F32 type input vector
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message for invalid input type");
-    inputOrdY->type.type = PS_TYPE_U8;
-    if(psPolynomial4DEvalVector(polyOrd,inputOrdW,inputOrdX,inputOrdY,inputOrdZ) != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Return NULL expected for non-F32 input vector");
-        return 66;
-    }
-    inputOrdY->type.type = PS_TYPE_F32;
-    // Attempt to invoke function with a non F32 type input vector
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message for invalid input type");
-    inputOrdZ->type.type = PS_TYPE_U8;
-    if(psPolynomial4DEvalVector(polyOrd,inputOrdW,inputOrdX,inputOrdY,inputOrdZ) != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Return NULL expected for non-F32 input vector");
-        return 67;
-    }
-    inputOrdZ->type.type = PS_TYPE_F32;
-    // Attempt to invoke function with a non F32 type input vector
-    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message for invalid input type");
-    inputOrdW->type.type = PS_TYPE_U8;
-    if(psPolynomial4DEvalVector(polyOrd,inputOrdW,inputOrdX,inputOrdY,inputOrdZ) != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Return NULL expected for non-F32 input vector");
-        return 68;
-    }
-    inputOrdW->type.type = PS_TYPE_F32;
- 
-    psFree(inputOrdW);
-    psFree(inputOrdX);
-    psFree(inputOrdY);
-    psFree(inputOrdZ);
-    psFree(inputChebW);
-    psFree(inputChebX);
-    psFree(inputChebY);
-    psFree(inputChebZ);
-    psFree(outputOrd);
-    psFree(outputCheb);
-    psFree(polyOrd);
-    psFree(polyCheb);
- 
-    return 0;
-}
-*/
+/*
 psS32 testPoly4DEvalVector(void)
 {
@@ -648,5 +437,5 @@
     psPolynomial4D* polyOrd = psPolynomial4DAlloc(TERMS-1, TERMS-1, TERMS-1, TERMS-1, PS_POLYNOMIAL_ORD);
     psPolynomial4D* polyCheb = psPolynomial4DAlloc(TERMS-1, TERMS-1, TERMS-1, TERMS-1, PS_POLYNOMIAL_CHEB);
-
+ 
     // Set polynomial members
     for(psS32 i = 0; i < TERMS; i++) {
@@ -662,5 +451,5 @@
         }
     }
-
+ 
     // Create input vectors
     psVector* inputOrdW  = psVectorAlloc(TESTPOINTS, PS_TYPE_F64);
@@ -682,79 +471,79 @@
         inputChebZ->data.F64[i] = Dpoly4DWXYZChebValue[i][3];
     }
-
+ 
     // Evaluate the vectors
     psVector* outputOrd = psPolynomial4DEvalVector(polyOrd,inputOrdW,inputOrdX,inputOrdY,inputOrdZ);
     if(outputOrd == NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Unexpected return of NULL.");
-        return 1;
+        printf("TEST ERROR: Unexpected return of NULL.");
+        testStatus = false;
     }
     if(outputOrd->type.type != PS_TYPE_F64) {
-        psError(PS_ERR_UNKNOWN,true,"Output vector of type %d expected %d",
+        printf("TEST ERROR: Output vector of type %d expected %d",
                 outputOrd->type.type, PS_TYPE_F64);
-        return 2;
+        testStatus = false;
     }
     psVector* outputCheb = psPolynomial4DEvalVector(polyCheb,inputChebW,inputChebX,inputChebY,inputChebZ);
     if(outputCheb == NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Unexpected return of NULL.");
-        return 1;
+        printf("TEST ERROR: Unexpected return of NULL.");
+        testStatus = false;
     }
     if(outputCheb->type.type != PS_TYPE_F64) {
-        psError(PS_ERR_UNKNOWN,true,"Output vector of type %d expected %d",
+        printf("TEST ERROR: Output vector of type %d expected %d",
                 outputCheb->type.type, PS_TYPE_F64);
-        return 2;
-    }
-
+        testStatus = false;
+    }
+ 
     // Verify the results
     for(psS32 i = 0; i < TESTPOINTS; i++) {
         if(fabs(Dpoly4DResult[i]-outputOrd->data.F64[i]) > ERROR_TOL) {
-            psError(PS_ERR_UNKNOWN,true,"Result[%d] %lg not equal to expected %lg",
+            printf("TEST ERROR: Result[%d] %lg not equal to expected %lg",
                     i, outputOrd->data.F64[i], Dpoly4DResult[i]);
-            return i*5;
+            testStatus = false;
         }
         if(fabs(Dpoly4DChebResult[i]-outputCheb->data.F64[i]) > ERROR_TOL) {
-            psError(PS_ERR_UNKNOWN,true,"ResultCheb[%d] %lg not equal to expected %lg",
+            printf("TEST ERROR: ResultCheb[%d] %lg not equal to expected %lg",
                     i, outputCheb->data.F64[i], Dpoly4DChebResult[i]);
-            return i*10;
+            testStatus = false;
         }
     }
-
+ 
     // Attempt to invoke function with null polynomial
     psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message for NULL polynomial");
     if(psPolynomial4DEvalVector(NULL,inputOrdW,inputOrdX,inputOrdY,inputOrdZ) != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Return of NULL expected for NULL polynomial");
-        return 60;
-    }
-
+        printf("TEST ERROR: Return of NULL expected for NULL polynomial");
+        testStatus = false;
+    }
+ 
     // Attempt to invoke function with null input vector
     psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message for NULL input vector");
     if(psPolynomial4DEvalVector(polyOrd,NULL,inputOrdX,inputOrdY,inputOrdZ) != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Return of NULL expected for NULL input vector");
-        return 61;
+        printf("TEST ERROR: Return of NULL expected for NULL input vector");
+        testStatus = false;
     }
     // Attempt to invoke function with null input vector
     psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message for NULL input vector");
     if(psPolynomial4DEvalVector(polyOrd,inputOrdW,NULL,inputOrdY,inputOrdZ) != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Return of NULL expected for NULL input vector");
-        return 62;
+        printf("TEST ERROR: Return of NULL expected for NULL input vector");
+        testStatus = false;
     }
     // Attempt to invoke function with null input vector
     psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message for NULL input vector");
     if(psPolynomial4DEvalVector(polyOrd,inputOrdW,inputOrdX,NULL,inputOrdZ) != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Return of NULL expected for NULL input vector");
-        return 63;
+        printf("TEST ERROR: Return of NULL expected for NULL input vector");
+        testStatus = false;
     }
     // Attempt to invoke function with null input vector
     psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message for NULL input vector");
     if(psPolynomial4DEvalVector(polyOrd,inputOrdW,inputOrdX,inputOrdY,NULL) != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Return of NULL expected for NULL input vector");
-        return 64;
-    }
-
+        printf("TEST ERROR: Return of NULL expected for NULL input vector");
+        testStatus = false;
+    }
+ 
     // Attempt to invoke function with a non F64 type input vector
     psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message for invalid input type");
     inputOrdX->type.type = PS_TYPE_U8;
     if(psPolynomial4DEvalVector(polyOrd,inputOrdW,inputOrdX,inputOrdY,inputOrdZ) != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Return NULL expected for non-F64 input vector");
-        return 65;
+        printf("TEST ERROR: Return NULL expected for non-F64 input vector");
+        testStatus = false;
     }
     inputOrdX->type.type = PS_TYPE_F64;
@@ -763,6 +552,6 @@
     inputOrdY->type.type = PS_TYPE_U8;
     if(psPolynomial4DEvalVector(polyOrd,inputOrdW,inputOrdX,inputOrdY,inputOrdZ) != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Return NULL expected for non-F64 input vector");
-        return 66;
+        printf("TEST ERROR: Return NULL expected for non-F64 input vector");
+        testStatus = false;
     }
     inputOrdY->type.type = PS_TYPE_F64;
@@ -771,6 +560,6 @@
     inputOrdZ->type.type = PS_TYPE_U8;
     if(psPolynomial4DEvalVector(polyOrd,inputOrdW,inputOrdX,inputOrdY,inputOrdZ) != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Return NULL expected for non-F64 input vector");
-        return 67;
+        printf("TEST ERROR: Return NULL expected for non-F64 input vector");
+        testStatus = false;
     }
     inputOrdZ->type.type = PS_TYPE_F64;
@@ -779,9 +568,9 @@
     inputOrdW->type.type = PS_TYPE_U8;
     if(psPolynomial4DEvalVector(polyOrd,inputOrdW,inputOrdX,inputOrdY,inputOrdZ) != NULL) {
-        psError(PS_ERR_UNKNOWN,true,"Return NULL expected for non-F64 input vector");
-        return 68;
+        printf("TEST ERROR: Return NULL expected for non-F64 input vector");
+        testStatus = false;
     }
     inputOrdW->type.type = PS_TYPE_F64;
-
+ 
     psFree(inputOrdX);
     psFree(inputOrdY);
@@ -796,6 +585,7 @@
     psFree(polyOrd);
     psFree(polyCheb);
-
-    return 0;
+ 
+    return(testStatus);
 }
-
+ 
+*/
Index: /trunk/psLib/test/math/tst_psMinimize04.c
===================================================================
--- /trunk/psLib/test/math/tst_psMinimize04.c	(revision 5091)
+++ /trunk/psLib/test/math/tst_psMinimize04.c	(revision 5092)
@@ -62,5 +62,4 @@
                             "psVectorFitPolynomial2D(): equal difference in variable fErr");
 
-    printf("TEST: calling psVectorFitPolynomial2D() with f, fErr, y, x as F32 vectors.\n");
     psVectorFitPolynomial2D(myPoly, NULL, 0, f, fErr, x, y);
 
Index: /trunk/psLib/test/math/verified/tst_psMinimize04.stderr
===================================================================
--- /trunk/psLib/test/math/verified/tst_psMinimize04.stderr	(revision 5091)
+++ /trunk/psLib/test/math/verified/tst_psMinimize04.stderr	(revision 5092)
@@ -1,6 +1,2 @@
-<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_psMinimize04.stdout
===================================================================
--- /trunk/psLib/test/math/verified/tst_psMinimize04.stdout	(revision 5091)
+++ /trunk/psLib/test/math/verified/tst_psMinimize04.stdout	(revision 5092)
@@ -5,5 +5,4 @@
 \**********************************************************************************/
 
-TEST: calling psVectorFitPolynomial2D() with f, fErr, y, x as F32 vectors.
 Running test with fErr set to NULL.
 Running test with x, y set to NULL.  Should generate error.
Index: /trunk/psLib/test/math/verified/tst_psMinimizeVector2D_F32.stderr
===================================================================
--- /trunk/psLib/test/math/verified/tst_psMinimizeVector2D_F32.stderr	(revision 5091)
+++ /trunk/psLib/test/math/verified/tst_psMinimizeVector2D_F32.stderr	(revision 5092)
@@ -1,6 +1,2 @@
-<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.
