Index: /trunk/archive/pslib/include/psFunctions.h
===================================================================
--- /trunk/archive/pslib/include/psFunctions.h	(revision 216)
+++ /trunk/archive/pslib/include/psFunctions.h	(revision 217)
@@ -13,18 +13,86 @@
 	   );
 
-/** Polynomial: one dimension */
+/************************************************************************************************************/
+
+/** One-dimensional polynomial */
+typedef struct {
+    int n;				//!< Number of terms
+    float *restrict coeff;		//!< Coefficients
+    float *restrict coeffErr;		//!< Error in coefficients
+    char *restrict mask;		//!< Coefficient mask
+} psPolynomial1D;
+
+/** Two-dimensional polynomial */
+typedef struct {
+    int nX, nY;				//!< Number of terms in x and y
+    float *restrict *restrict coeff;	//!< Coefficients
+    float *restrict *restrict coeffErr;	//!< Error in coefficients
+    char *restrict *restrict mask;	//!< Coefficients mask
+} psPolynomial2D;
+
+
+/** Double-precision one-dimensional polynomial */
+typedef struct {
+    int n;				//!< Number of terms
+    double *restrict coeff;		//!< Coefficients
+    double *restrict coeffErr;		//!< Error in coefficients
+    char *restrict mask;		//!< Coefficient mask
+} psDPolynomial1D;
+
+/** Double-precision two-dimensional polynomial */
+typedef struct {
+    int nX, nY;				//!< Number of terms in x and y
+    double *restrict *restrict coeff;	//!< Coefficients
+    double *restrict *restrict coeffErr; //!< Error in coefficients
+    char *restrict *restrict mask;	//!< Coefficients mask
+} psDPolynomial2D;
+
+
+/** Constructors */
+psPolynomial1D *psPolynomial1DAlloc(int n //!< Number of terms
+				    );
+psPolynomial2D *psPolynomial2DAlloc(int nX, int nY //!< Number of terms in x and y
+				    );
+psPolynomial1D *psDPolynomial1DAlloc(int n //!< Number of terms
+				     );
+psPolynomial2D *psDPolynomial2DAlloc(int nX, int nY //!< Number of terms in x and y
+				     );
+
+/** Destructors */
+void psPolynomial1DFree(psPolynomial1D *restrict myPoly //!< Polynomial to destroy
+			);
+void psPolynomial2DFree(psPolynomial2D *restrict myPoly //!< Polynomial to destroy
+			);
+void psDPolynomial1DFree(psPolynomial1D *restrict myPoly //!< Polynomial to destroy
+			 );
+void psDPolynomial2DFree(psPolynomial1D *restrict myPoly //!< Polynomial to destroy
+			 );
+
+
+/** Evaluate 1D polynomial */
 float
-psPolynomial1d(float x,			//!< Value at which to evaluate
-	       const psFloatArray *restrict coeffs //!< Coefficients for the polynomial
-	       );
+psEvalPolynomial1D(float x,		//!< Value at which to evaluate
+		   const psPolynomial1D *restrict myPoly //!< Coefficients for the polynomial
+		   );
 
-/** Polynomial: two dimensions */
+/** Evaluate 2D polynomial */
 float
-psPolynomial2d(float x,			//!< Value x at which to evaluate
-	       float y,			//!< Value y at which to evaluate
-	       int orderx,		//!< Polynomial order in x
-	       int ordery,		//!< Polynomial order in y
-	       const psFloatArray *coeffs //!< Coefficients for the polynomial
-	       );
+psEvalPolynomial2D(float x,		//!< Value x at which to evaluate
+		   float y,		//!< Value y at which to evaluate
+		   const psPolynomial2D *restrict myPoly //!< Coefficients for the polynomial
+		   );
+
+/** Evaluate 1D polynomial (double precision) */
+double
+psEvalDPolynomial1D(double x,		//!< Value at which to evaluate
+		    const psDPolynomial1D *restrict myPoly //!< Coefficients for the polynomial
+		    );
+
+/** Evaluate 2D polynomial (double precision) */
+double
+psEvalDPolynomial2D(double x,		//!< Value x at which to evaluate
+		    double y,		//!< Value y at which to evaluate
+		    const psDPolynomial2D *restrict myPoly //!< Coefficients for the polynomial
+		    );
 
 #endif
