Index: /trunk/psLib/src/math/psFunctions.c
===================================================================
--- /trunk/psLib/src/math/psFunctions.c	(revision 4579)
+++ /trunk/psLib/src/math/psFunctions.c	(revision 4580)
@@ -1,20 +1,20 @@
 /** @file  psFunctions.c
- *
- *  @brief Contains basic function allocation, deallocation, and evaluation
- *         routines.
- *
- *  This file will hold the functions for allocated, freeing, and evaluating
- *  polynomials.  It also contains a Gaussian functions.
- *
- *  @version $Revision: 1.4 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-07-16 00:42:28 $
- *
- *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
- *
- *  XXX: Should the "coeffErr[]" be used as well?  Bug ???.  Ignore coeffErr
- *
- *  XXX: In the various polyAlloc(n) functions, n is really the order of the
- *  polynomial plus 1.  To create a 2nd-order polynomial, n == 3.
- */
+*
+*  @brief Contains basic function allocation, deallocation, and evaluation
+*         routines.
+*
+*  This file will hold the functions for allocated, freeing, and evaluating
+*  polynomials.  It also contains a Gaussian functions.
+*
+*  @version $Revision: 1.5 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2005-07-19 02:55:54 $
+*
+*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
+*
+*  XXX: Should the "coeffErr[]" be used as well?  Bug ???.  Ignore coeffErr
+*
+*  XXX: In the various polyAlloc(n) functions, n is really the order of the
+*  polynomial plus 1.  To create a 2nd-order polynomial, n == 3.
+*/
 /*****************************************************************************/
 /*  INCLUDE FILES                                                            */
@@ -1918,5 +1918,5 @@
     for (psS32 i=0;i<bounds->n-1;i++) {
         if (FLT_EPSILON >= fabs(bounds->data.F32[i+1]-bounds->data.F32[i])) {
-            psError(PS_ERR_UNKNOWN, true, "data points must be distinct\n");
+            psError(PS_ERR_UNKNOWN, true, "data points must be distinct ([%d] %f %f)\n", i, bounds->data.F32[i], bounds->data.F32[i+1]);
             return(NULL);
         }
Index: /trunk/psLib/src/math/psMinimize.c
===================================================================
--- /trunk/psLib/src/math/psMinimize.c	(revision 4579)
+++ /trunk/psLib/src/math/psMinimize.c	(revision 4580)
@@ -9,6 +9,6 @@
  *  @author GLG, MHPCC
  *
- *  @version $Revision: 1.126 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-07-16 00:42:28 $
+ *  @version $Revision: 1.127 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-07-19 02:55:54 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -520,5 +520,4 @@
     psVector *y32 = yPtr;
 
-
     // If these are linear splines, which means their polynomials will have
     // two coefficients, then we do the simple calculation.
@@ -638,4 +637,5 @@
     psTrace(".psLib.dataManip.psVectorFitSpline1D", 4,
             "---- psVectorFitSpline1D() end ----\n");
+
     return(mySpline);
 }
Index: /trunk/psLib/test/math/tst_psFunc07.c
===================================================================
--- /trunk/psLib/test/math/tst_psFunc07.c	(revision 4579)
+++ /trunk/psLib/test/math/tst_psFunc07.c	(revision 4580)
@@ -9,4 +9,6 @@
 XXX: The spline eval functions are F32 only, while the spline fit functions
 are F32 and F64.
+ 
+XXX: Must call the spline fit functions with unallowable input parameters.
  *****************************************************************************/
 #include <stdio.h>
@@ -17,4 +19,5 @@
 #include "psFunctions.h"
 
+#define VERBOSE 0
 #define NUM_SPLINES 50
 #define A 4.0
@@ -51,8 +54,14 @@
     newX = psVectorAlloc(NUM_SPLINES+1, PS_TYPE_F32);
     y = psVectorAlloc(NUM_SPLINES+1, PS_TYPE_F32);
-    tmpSpline = psSpline1DAlloc(NUM_SPLINES, 3, MIN, MAX);
+
+
+    psF32 width = (MAX - MIN) / ((psF32) NUM_SPLINES);
+    x->data.F32[0] = MIN;
+    for (psS32 i=1;i<NUM_SPLINES;i++) {
+        x->data.F32[i] = MIN + (width * (psF32) i);
+    }
+    x->data.F32[NUM_SPLINES] = MAX;
 
     for (i=0;i<NUM_SPLINES+1;i++) {
-        x->data.F32[i] = tmpSpline->knots->data.F32[i];
         y->data.F32[i] = myFunc(x->data.F32[i]);
     }
@@ -69,23 +78,29 @@
                             "psSpline1DAlloc(), psVectorFitSpline1D, psSpline1DEvalVector: F32 versions");
 
-    psVectorFitSpline1D(tmpSpline, x, y, NULL);
-    newY = psSpline1DEvalVector(
-               tmpSpline,
-               newX
-           );
-
-    for (i=OFFSET;i<NUM_SPLINES-OFFSET+1;i++) {
-        if ( fabs( newY->data.F32[i] - myFunc(newX->data.F32[i]) ) > fabs( ERROR_TOLERANCE * myFunc(newX->data.F32[i]) ) ) {
-            printf("ERROR[%d]: f(%f) is %f.  Should be %f\n", i,
-                   newX->data.F32[i], newY->data.F32[i], myFunc(newX->data.F32[i]));
-            testStatus = false;
+    tmpSpline = psVectorFitSpline1DNEW(x, y, NUM_SPLINES);
+    if (tmpSpline == NULL) {
+        printf("TEST ERROR: psVectorFitSpline1DNEW() returned NULL.\n");
+        testStatus = false;
+    } else {
+        newY = psSpline1DEvalVector(tmpSpline, newX);
+
+        for (i=OFFSET;i<NUM_SPLINES-OFFSET+1;i++) {
+            if ( fabs( newY->data.F32[i] - myFunc(newX->data.F32[i]) ) > fabs( ERROR_TOLERANCE * myFunc(newX->data.F32[i]) ) ) {
+                printf("ERROR[%d]: f(%f) is %f.  Should be %f\n", i,
+                       newX->data.F32[i], newY->data.F32[i], myFunc(newX->data.F32[i]));
+                testStatus = false;
+            } else {
+                if (VERBOSE) {
+                    printf("COOL[%d]: f(%f) is %f.  Should be %f\n", i,
+                           newX->data.F32[i], newY->data.F32[i], myFunc(newX->data.F32[i]));
+                }
+            }
         }
-    }
-
+        psFree(tmpSpline);
+        psFree(newY);
+    }
     psFree(x);
+    psFree(y);
     psFree(newX);
-    psFree(y);
-    psFree(tmpSpline);
-    psFree(newY);
 
     psMemCheckCorruption(1);
@@ -123,8 +138,13 @@
     newX = psVectorAlloc(NUM_SPLINES+1, PS_TYPE_F64);
     y = psVectorAlloc(NUM_SPLINES+1, PS_TYPE_F64);
-    tmpSpline = psSpline1DAlloc(NUM_SPLINES, 3, MIN, MAX);
+
+    psF64 width = (MAX - MIN) / ((psF32) NUM_SPLINES);
+    x->data.F64[0] = MIN;
+    for (psS32 i=1;i<NUM_SPLINES;i++) {
+        x->data.F64[i] = MIN + (width * (psF64) i);
+    }
+    x->data.F64[NUM_SPLINES] = MAX;
 
     for (i=0;i<NUM_SPLINES+1;i++) {
-        x->data.F64[i] = tmpSpline->knots->data.F32[i];
         y->data.F64[i] = myFunc(x->data.F64[i]);
     }
@@ -141,23 +161,29 @@
                             "psSpline1DAlloc(), psVectorFitSpline1D, psSpline1DEvalVector: F64 versions");
 
-    psVectorFitSpline1D(tmpSpline, x, y, NULL);
-    newY = psSpline1DEvalVector(
-               tmpSpline,
-               newX
-           );
-
-    for (i=OFFSET;i<NUM_SPLINES-OFFSET+1;i++) {
-        if ( fabs( newY->data.F32[i] - myFunc(newX->data.F64[i]) ) > fabs( ERROR_TOLERANCE * myFunc((float)newX->data.F64[i]) ) ) {
-            printf("ERROR[%d]: f(%f) is %f.  Should be %f\n", i,
-                   newX->data.F64[i], newY->data.F32[i], myFunc((float)newX->data.F64[i]));
-            testStatus = false;
+    tmpSpline = psVectorFitSpline1DNEW(x, y, NUM_SPLINES);
+    if (tmpSpline == NULL) {
+        printf("TEST ERROR: psVectorFitSpline1DNEW() returned NULL.\n");
+        testStatus = false;
+    } else {
+        newY = psSpline1DEvalVector(tmpSpline, newX);
+
+        for (i=OFFSET;i<NUM_SPLINES-OFFSET+1;i++) {
+            if ( fabs( newY->data.F32[i] - myFunc(newX->data.F64[i]) ) > fabs( ERROR_TOLERANCE * myFunc((float)newX->data.F64[i]) ) ) {
+                printf("ERROR[%d]: f(%f) is %f.  Should be %f\n", i,
+                       newX->data.F64[i], newY->data.F32[i], myFunc((float)newX->data.F64[i]));
+                testStatus = false;
+            } else {
+                if (VERBOSE) {
+                    printf("COOL[%d]: f(%f) is %f.  Should be %f\n", i,
+                           newX->data.F64[i], newY->data.F32[i], myFunc((float)newX->data.F64[i]));
+                }
+            }
         }
-    }
-
+        psFree(tmpSpline);
+        psFree(newY);
+    }
     psFree(x);
     psFree(newX);
     psFree(y);
-    psFree(tmpSpline);
-    psFree(newY);
 
     psMemCheckCorruption(1);
@@ -177,5 +203,6 @@
 psS32 main()
 {
-    //    t00();
+    psLogSetFormat("HLNM");
+    t00();
     t01();
 }
