Changeset 217
- Timestamp:
- Mar 11, 2004, 10:45:43 AM (22 years ago)
- File:
-
- 1 edited
-
trunk/archive/pslib/include/psFunctions.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/archive/pslib/include/psFunctions.h
r153 r217 13 13 ); 14 14 15 /** Polynomial: one dimension */ 15 /************************************************************************************************************/ 16 17 /** One-dimensional polynomial */ 18 typedef struct { 19 int n; //!< Number of terms 20 float *restrict coeff; //!< Coefficients 21 float *restrict coeffErr; //!< Error in coefficients 22 char *restrict mask; //!< Coefficient mask 23 } psPolynomial1D; 24 25 /** Two-dimensional polynomial */ 26 typedef struct { 27 int nX, nY; //!< Number of terms in x and y 28 float *restrict *restrict coeff; //!< Coefficients 29 float *restrict *restrict coeffErr; //!< Error in coefficients 30 char *restrict *restrict mask; //!< Coefficients mask 31 } psPolynomial2D; 32 33 34 /** Double-precision one-dimensional polynomial */ 35 typedef struct { 36 int n; //!< Number of terms 37 double *restrict coeff; //!< Coefficients 38 double *restrict coeffErr; //!< Error in coefficients 39 char *restrict mask; //!< Coefficient mask 40 } psDPolynomial1D; 41 42 /** Double-precision two-dimensional polynomial */ 43 typedef struct { 44 int nX, nY; //!< Number of terms in x and y 45 double *restrict *restrict coeff; //!< Coefficients 46 double *restrict *restrict coeffErr; //!< Error in coefficients 47 char *restrict *restrict mask; //!< Coefficients mask 48 } psDPolynomial2D; 49 50 51 /** Constructors */ 52 psPolynomial1D *psPolynomial1DAlloc(int n //!< Number of terms 53 ); 54 psPolynomial2D *psPolynomial2DAlloc(int nX, int nY //!< Number of terms in x and y 55 ); 56 psPolynomial1D *psDPolynomial1DAlloc(int n //!< Number of terms 57 ); 58 psPolynomial2D *psDPolynomial2DAlloc(int nX, int nY //!< Number of terms in x and y 59 ); 60 61 /** Destructors */ 62 void psPolynomial1DFree(psPolynomial1D *restrict myPoly //!< Polynomial to destroy 63 ); 64 void psPolynomial2DFree(psPolynomial2D *restrict myPoly //!< Polynomial to destroy 65 ); 66 void psDPolynomial1DFree(psPolynomial1D *restrict myPoly //!< Polynomial to destroy 67 ); 68 void psDPolynomial2DFree(psPolynomial1D *restrict myPoly //!< Polynomial to destroy 69 ); 70 71 72 /** Evaluate 1D polynomial */ 16 73 float 17 ps Polynomial1d(float x,//!< Value at which to evaluate18 const psFloatArray *restrict coeffs//!< Coefficients for the polynomial19 );74 psEvalPolynomial1D(float x, //!< Value at which to evaluate 75 const psPolynomial1D *restrict myPoly //!< Coefficients for the polynomial 76 ); 20 77 21 /** Polynomial: two dimensions*/78 /** Evaluate 2D polynomial */ 22 79 float 23 psPolynomial2d(float x, //!< Value x at which to evaluate 24 float y, //!< Value y at which to evaluate 25 int orderx, //!< Polynomial order in x 26 int ordery, //!< Polynomial order in y 27 const psFloatArray *coeffs //!< Coefficients for the polynomial 28 ); 80 psEvalPolynomial2D(float x, //!< Value x at which to evaluate 81 float y, //!< Value y at which to evaluate 82 const psPolynomial2D *restrict myPoly //!< Coefficients for the polynomial 83 ); 84 85 /** Evaluate 1D polynomial (double precision) */ 86 double 87 psEvalDPolynomial1D(double x, //!< Value at which to evaluate 88 const psDPolynomial1D *restrict myPoly //!< Coefficients for the polynomial 89 ); 90 91 /** Evaluate 2D polynomial (double precision) */ 92 double 93 psEvalDPolynomial2D(double x, //!< Value x at which to evaluate 94 double y, //!< Value y at which to evaluate 95 const psDPolynomial2D *restrict myPoly //!< Coefficients for the polynomial 96 ); 29 97 30 98 #endif
Note:
See TracChangeset
for help on using the changeset viewer.
