Index: /trunk/psLib/src/dataManip/psFunctions.c
===================================================================
--- /trunk/psLib/src/dataManip/psFunctions.c	(revision 1764)
+++ /trunk/psLib/src/dataManip/psFunctions.c	(revision 1765)
@@ -7,6 +7,6 @@
  *  polynomials.  It also contains a Gaussian functions.
  *
- *  @version $Revision: 1.31 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-09-09 22:20:31 $
+ *  @version $Revision: 1.32 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-09-09 23:39:36 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -1580,4 +1580,6 @@
     NOTE: "n" specifies the number of spline polynomials.  Therefore, there
     must exist n+1 points in "domains".
+ 
+XXX: Ensure that domain[i+1] != domain[i]
  *****************************************************************************/
 psSpline1D *psSpline1DAlloc(int numSplines,
@@ -1611,4 +1613,7 @@
 }
 
+/*****************************************************************************
+XXX: Ensure that domain[i+1] != domain[i]
+ *****************************************************************************/
 psSpline1D *psSpline1DAllocGeneric(const psVector *bounds,
                                    int order)
@@ -1720,4 +1725,6 @@
 {
     int i;
+    float slope;
+
     if (data->n != (1 + spline->n)) {
         psLogMsg(__func__, PS_LOG_WARN,
@@ -1726,12 +1733,18 @@
         return(NULL);
     }
+    // XXX: verify your math
     if (1 == (spline->spline[0])->n) {
+        for (i=0;i<spline->n;i++) {
+            slope = (data->data.F32[i+1] - data->data.F32[i]) /
+                    (spline->domains[i+1] - spline->domains[i]);
+            (spline->spline[0])->coeff[0] = data->data.F32[i] -
+                                            (slope * spline->domains[i]);
+            (spline->spline[0])->coeff[1] = slope;
+        }
+
         psLogMsg(__func__, PS_LOG_WARN,
                  "Linear splines have not been implemented.");
         return(NULL);
-        for (i=0;i<spline->n;i++) {}
-
-    }
-    else if (3 == (spline->spline[0])->n) {
+    } else if (3 == (spline->spline[0])->n) {
         psLogMsg(__func__, PS_LOG_WARN,
                  "Cubic splines have not been implemented.");
Index: /trunk/psLib/src/math/psPolynomial.c
===================================================================
--- /trunk/psLib/src/math/psPolynomial.c	(revision 1764)
+++ /trunk/psLib/src/math/psPolynomial.c	(revision 1765)
@@ -7,6 +7,6 @@
  *  polynomials.  It also contains a Gaussian functions.
  *
- *  @version $Revision: 1.31 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-09-09 22:20:31 $
+ *  @version $Revision: 1.32 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-09-09 23:39:36 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -1580,4 +1580,6 @@
     NOTE: "n" specifies the number of spline polynomials.  Therefore, there
     must exist n+1 points in "domains".
+ 
+XXX: Ensure that domain[i+1] != domain[i]
  *****************************************************************************/
 psSpline1D *psSpline1DAlloc(int numSplines,
@@ -1611,4 +1613,7 @@
 }
 
+/*****************************************************************************
+XXX: Ensure that domain[i+1] != domain[i]
+ *****************************************************************************/
 psSpline1D *psSpline1DAllocGeneric(const psVector *bounds,
                                    int order)
@@ -1720,4 +1725,6 @@
 {
     int i;
+    float slope;
+
     if (data->n != (1 + spline->n)) {
         psLogMsg(__func__, PS_LOG_WARN,
@@ -1726,12 +1733,18 @@
         return(NULL);
     }
+    // XXX: verify your math
     if (1 == (spline->spline[0])->n) {
+        for (i=0;i<spline->n;i++) {
+            slope = (data->data.F32[i+1] - data->data.F32[i]) /
+                    (spline->domains[i+1] - spline->domains[i]);
+            (spline->spline[0])->coeff[0] = data->data.F32[i] -
+                                            (slope * spline->domains[i]);
+            (spline->spline[0])->coeff[1] = slope;
+        }
+
         psLogMsg(__func__, PS_LOG_WARN,
                  "Linear splines have not been implemented.");
         return(NULL);
-        for (i=0;i<spline->n;i++) {}
-
-    }
-    else if (3 == (spline->spline[0])->n) {
+    } else if (3 == (spline->spline[0])->n) {
         psLogMsg(__func__, PS_LOG_WARN,
                  "Cubic splines have not been implemented.");
Index: /trunk/psLib/src/math/psSpline.c
===================================================================
--- /trunk/psLib/src/math/psSpline.c	(revision 1764)
+++ /trunk/psLib/src/math/psSpline.c	(revision 1765)
@@ -7,6 +7,6 @@
  *  polynomials.  It also contains a Gaussian functions.
  *
- *  @version $Revision: 1.31 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-09-09 22:20:31 $
+ *  @version $Revision: 1.32 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-09-09 23:39:36 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -1580,4 +1580,6 @@
     NOTE: "n" specifies the number of spline polynomials.  Therefore, there
     must exist n+1 points in "domains".
+ 
+XXX: Ensure that domain[i+1] != domain[i]
  *****************************************************************************/
 psSpline1D *psSpline1DAlloc(int numSplines,
@@ -1611,4 +1613,7 @@
 }
 
+/*****************************************************************************
+XXX: Ensure that domain[i+1] != domain[i]
+ *****************************************************************************/
 psSpline1D *psSpline1DAllocGeneric(const psVector *bounds,
                                    int order)
@@ -1720,4 +1725,6 @@
 {
     int i;
+    float slope;
+
     if (data->n != (1 + spline->n)) {
         psLogMsg(__func__, PS_LOG_WARN,
@@ -1726,12 +1733,18 @@
         return(NULL);
     }
+    // XXX: verify your math
     if (1 == (spline->spline[0])->n) {
+        for (i=0;i<spline->n;i++) {
+            slope = (data->data.F32[i+1] - data->data.F32[i]) /
+                    (spline->domains[i+1] - spline->domains[i]);
+            (spline->spline[0])->coeff[0] = data->data.F32[i] -
+                                            (slope * spline->domains[i]);
+            (spline->spline[0])->coeff[1] = slope;
+        }
+
         psLogMsg(__func__, PS_LOG_WARN,
                  "Linear splines have not been implemented.");
         return(NULL);
-        for (i=0;i<spline->n;i++) {}
-
-    }
-    else if (3 == (spline->spline[0])->n) {
+    } else if (3 == (spline->spline[0])->n) {
         psLogMsg(__func__, PS_LOG_WARN,
                  "Cubic splines have not been implemented.");
