Changeset 220
- Timestamp:
- Mar 12, 2004, 10:25:47 AM (22 years ago)
- File:
-
- 1 edited
-
trunk/archive/pslib/include/psFunctions.h (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/archive/pslib/include/psFunctions.h
r217 r220 31 31 } psPolynomial2D; 32 32 33 /** Three-dimensional polynomial */ 34 typedef struct { 35 int nX, nY, nZ; //!< Number of terms in x, y and z 36 float *restrict *restrict *restrict coeff; //!< Coefficients 37 float *restrict *restrict *restrict coeffErr; //!< Error in coefficients 38 char *restrict *restrict *restrict mask; //!< Coefficients mask 39 } psPolynomial3D; 40 41 /** Four-dimensional polynomial */ 42 typedef struct { 43 int nW, nX, nY, nZ; //!< Number of terms in w, x, y and z 44 float *restrict *restrict *restrict *restrict coeff; //!< Coefficients 45 float *restrict *restrict *restrict *restrict coeffErr; //!< Error in coefficients 46 char *restrict *restrict *restrict *restrict mask; //!< Coefficients mask 47 } psPolynomial4D; 48 49 50 /** Constructors */ 51 psPolynomial1D *psPolynomial1DAlloc(int n //!< Number of terms 52 ); 53 psPolynomial2D *psPolynomial2DAlloc(int nX, int nY //!< Number of terms in x and y 54 ); 55 psPolynomial3D *psPolynomial3DAlloc(int nX, int nY, int nZ //!< Number of terms in x, y and z 56 ); 57 psPolynomial4D *psPolynomial4DAlloc(int nW, int nX, int nY, int nZ //!< Number of terms in w, x, y and z 58 ); 59 60 /** Destructors */ 61 void psPolynomial1DFree(psPolynomial1D *restrict myPoly //!< Polynomial to destroy 62 ); 63 void psPolynomial2DFree(psPolynomial2D *restrict myPoly //!< Polynomial to destroy 64 ); 65 void psPolynomial3DFree(psPolynomial3D *restrict myPoly //!< Polynomial to destroy 66 ); 67 void psPolynomial4DFree(psPolynomial4D *restrict myPoly //!< Polynomial to destroy 68 ); 69 70 71 /** Evaluate 1D polynomial */ 72 float 73 psEvalPolynomial1D(float x, //!< Value at which to evaluate 74 const psPolynomial1D *restrict myPoly //!< Coefficients for the polynomial 75 ); 76 77 /** Evaluate 2D polynomial */ 78 float 79 psEvalPolynomial2D(float x, //!< Value x at which to evaluate 80 float y, //!< Value y at which to evaluate 81 const psPolynomial2D *restrict myPoly //!< Coefficients for the polynomial 82 ); 83 84 /** Evaluate 3D polynomial */ 85 float 86 psEvalPolynomial3D(float x, //!< Value x at which to evaluate 87 float y, //!< Value y at which to evaluate 88 float z, //!< Value z at which to evaluate 89 const psPolynomial3D *restrict myPoly //!< Coefficients for the polynomial 90 ); 91 92 /** Evaluate 4D polynomial */ 93 float 94 psEvalPolynomial4D(float w, //!< Value w at which to evaluate 95 float x, //!< Value x at which to evaluate 96 float y, //!< Value y at which to evaluate 97 float z, //!< Value z at which to evaluate 98 const psPolynomial4D *restrict myPoly //!< Coefficients for the polynomial 99 ); 100 101 /************************************************************************************************************/ 102 103 /* Double-precision polynomials, mainly for use in astrometry */ 33 104 34 105 /** Double-precision one-dimensional polynomial */ … … 48 119 } psDPolynomial2D; 49 120 121 /** Double-precision three-dimensional polynomial */ 122 typedef struct { 123 int nX, nY, nZ; //!< Number of terms in x, y and z 124 double *restrict *restrict *restrict coeff; //!< Coefficients 125 double *restrict *restrict *restrict coeffErr; //!< Error in coefficients 126 char *restrict *restrict *restrict mask; //!< Coefficient mask 127 } psDPolynomial3D; 128 129 /** Double-precision four-dimensional polynomial */ 130 typedef struct { 131 int nW, nX, nY, nZ; //!< Number of terms in w, x, y and z 132 double *restrict *restrict *restrict *restrict coeff; //!< Coefficients 133 double *restrict *restrict *restrict *restrict coeffErr; //!< Error in coefficients 134 char *restrict *restrict *restrict *restrict mask; //!< Coefficients mask 135 } psDPolynomial4D; 50 136 51 137 /** Constructors */ 52 psPolynomial1D *psPolynomial1DAlloc(int n //!< Number of terms53 );54 psPolynomial2D *psPolynomial2DAlloc(int nX, int nY //!< Number of terms in x and y55 );56 138 psPolynomial1D *psDPolynomial1DAlloc(int n //!< Number of terms 57 139 ); 58 140 psPolynomial2D *psDPolynomial2DAlloc(int nX, int nY //!< Number of terms in x and y 59 141 ); 142 psPolynomial3D *psDPolynomial3DAlloc(int nX, int nY, int nZ //!< Number of terms in x, y and z 143 ); 144 psPolynomial4D *psDPolynomial4DAlloc(int nW, int nX, int nY, int nZ //!< Number of terms in w, x, y and z 145 ); 146 60 147 61 148 /** Destructors */ 62 void psPolynomial1DFree(psPolynomial1D *restrict myPoly //!< Polynomial to destroy63 );64 void psPolynomial2DFree(psPolynomial2D *restrict myPoly //!< Polynomial to destroy65 );66 149 void psDPolynomial1DFree(psPolynomial1D *restrict myPoly //!< Polynomial to destroy 67 150 ); 68 void psDPolynomial2DFree(psPolynomial1D *restrict myPoly //!< Polynomial to destroy 151 void psDPolynomial2DFree(psPolynomial2D *restrict myPoly //!< Polynomial to destroy 152 ); 153 void psDPolynomial3DFree(psPolynomial3D *restrict myPoly //!< Polynomial to destroy 154 ); 155 void psDPolynomial4DFree(psPolynomial4D *restrict myPoly //!< Polynomial to destroy 69 156 ); 70 157 71 72 /** Evaluate 1D polynomial */73 float74 psEvalPolynomial1D(float x, //!< Value at which to evaluate75 const psPolynomial1D *restrict myPoly //!< Coefficients for the polynomial76 );77 78 /** Evaluate 2D polynomial */79 float80 psEvalPolynomial2D(float x, //!< Value x at which to evaluate81 float y, //!< Value y at which to evaluate82 const psPolynomial2D *restrict myPoly //!< Coefficients for the polynomial83 );84 158 85 159 /** Evaluate 1D polynomial (double precision) */ … … 96 170 ); 97 171 172 /** Evaluate 3D polynomial (double precision) */ 173 double 174 psEvalDPolynomial3D(double x, //!< Value x at which to evaluate 175 double y, //!< Value y at which to evaluate 176 double z, //!< Value z at which to evaluate 177 const psDPolynomial3D *restrict myPoly //!< Coefficients for the polynomial 178 ); 179 180 /** Evaluate 4D polynomial (double precision) */ 181 double 182 psEvalDPolynomial4D(double w, //!< Value w at which to evaluate 183 double x, //!< Value x at which to evaluate 184 double y, //!< Value y at which to evaluate 185 double z, //!< Value z at which to evaluate 186 const psDPolynomial4D *restrict myPoly //!< Coefficients for the polynomial 187 ); 188 189 98 190 #endif
Note:
See TracChangeset
for help on using the changeset viewer.
