Index: trunk/psLib/src/math/psSpline.c
===================================================================
--- trunk/psLib/src/math/psSpline.c	(revision 889)
+++ trunk/psLib/src/math/psSpline.c	(revision 1020)
@@ -4,8 +4,9 @@
  *         routines.
  *
- *  @author George Gusciora, MHPCC
+ *  This file will hold the functions for allocated, freeing, and evaluating
+ *  polynomials.  It also contains a Gaussian functions.
  *
- *  @version $Revision: 1.11 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-06-07 00:32:53 $
+ *  @version $Revision: 1.12 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-06-14 19:32:42 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -103,4 +104,5 @@
 psPolynomial1D *psPolynomial1DAlloc(int n)
 {
+    int i = 0;
     psPolynomial1D *newPoly = NULL;
 
@@ -110,4 +112,9 @@
     newPoly->coeffErr = (float *) psAlloc(n * sizeof(float));
     newPoly->mask     = (char *)  psAlloc(n * sizeof(char));
+    for (i=0;i<n;i++) {
+        newPoly->coeff[i] = 0.0;
+        newPoly->coeffErr[i] = 0.0;
+        newPoly->mask[i] = 0.0;
+    }
 
     return(newPoly);
@@ -117,4 +124,5 @@
 {
     int x = 0;
+    int y = 0;
     psPolynomial2D *newPoly = NULL;
 
@@ -131,5 +139,11 @@
         newPoly->mask[x]     = (char *)  psAlloc(nY * sizeof(char));
     }
-
+    for (x=0;x<nX;x++) {
+        for (y=0;y<nY;y++) {
+            newPoly->coeff[x][y] = 0.0;
+            newPoly->coeffErr[x][y] = 0.0;
+            newPoly->mask[x][y] = 0;
+        }
+    }
 
     return(newPoly);
@@ -140,4 +154,5 @@
     int x = 0;
     int y = 0;
+    int z = 0;
     psPolynomial3D *newPoly = NULL;
 
@@ -160,4 +175,13 @@
         }
     }
+    for (x=0;x<nX;x++) {
+        for (y=0;y<nY;y++) {
+            for (z=0;z<nZ;z++) {
+                newPoly->coeff[x][y][z] = 0.0;
+                newPoly->coeffErr[x][y][z] = 0.0;
+                newPoly->mask[x][y][z] = 0;
+            }
+        }
+    }
 
     return(newPoly);
@@ -169,4 +193,5 @@
     int x = 0;
     int y = 0;
+    int z = 0;
     psPolynomial4D *newPoly = NULL;
 
@@ -195,4 +220,15 @@
         }
     }
+    for (w=0;w<nW;w++) {
+        for (x=0;x<nX;x++) {
+            for (y=0;y<nY;y++) {
+                for (z=0;z<nZ;z++) {
+                    newPoly->coeff[w][x][y][z] = 0.0;
+                    newPoly->coeffErr[w][x][y][z] = 0.0;
+                    newPoly->mask[w][x][y][z] = 0;
+                }
+            }
+        }
+    }
 
     return(newPoly);
@@ -394,4 +430,5 @@
 psDPolynomial1D *psDPolynomial1DAlloc(int n)
 {
+    int i = 0;
     psDPolynomial1D *newPoly = NULL;
 
@@ -401,4 +438,9 @@
     newPoly->coeffErr = (double *) psAlloc(n * sizeof(double));
     newPoly->mask     = (char *)  psAlloc(n * sizeof(char));
+    for (i=0;i<n;i++) {
+        newPoly->coeff[i] = 0.0;
+        newPoly->coeffErr[i] = 0.0;
+        newPoly->mask[i] = 0.0;
+    }
 
     return(newPoly);
@@ -408,4 +450,5 @@
 {
     int x = 0;
+    int y = 0;
     psDPolynomial2D *newPoly = NULL;
 
@@ -422,4 +465,11 @@
         newPoly->mask[x]     = (char *)  psAlloc(nY * sizeof(char));
     }
+    for (x=0;x<nX;x++) {
+        for (y=0;y<nY;y++) {
+            newPoly->coeff[x][y] = 0.0;
+            newPoly->coeffErr[x][y] = 0.0;
+            newPoly->mask[x][y] = 0;
+        }
+    }
 
     return(newPoly);
@@ -430,4 +480,5 @@
     int x = 0;
     int y = 0;
+    int z = 0;
     psDPolynomial3D *newPoly = NULL;
 
@@ -450,4 +501,13 @@
         }
     }
+    for (x=0;x<nX;x++) {
+        for (y=0;y<nY;y++) {
+            for (z=0;z<nZ;z++) {
+                newPoly->coeff[x][y][z] = 0.0;
+                newPoly->coeffErr[x][y][z] = 0.0;
+                newPoly->mask[x][y][z] = 0;
+            }
+        }
+    }
 
     return(newPoly);
@@ -459,4 +519,5 @@
     int x = 0;
     int y = 0;
+    int z = 0;
     psDPolynomial4D *newPoly = NULL;
 
@@ -485,4 +546,15 @@
         }
     }
+    for (w=0;w<nW;w++) {
+        for (x=0;x<nX;x++) {
+            for (y=0;y<nY;y++) {
+                for (z=0;z<nZ;z++) {
+                    newPoly->coeff[w][x][y][z] = 0.0;
+                    newPoly->coeffErr[w][x][y][z] = 0.0;
+                    newPoly->mask[w][x][y][z] = 0;
+                }
+            }
+        }
+    }
 
     return(newPoly);
