Changeset 1464
- Timestamp:
- Aug 10, 2004, 4:37:55 PM (22 years ago)
- Location:
- trunk/psLib/src
- Files:
-
- 6 edited
-
dataManip/psFunctions.h (modified) (9 diffs)
-
dataManip/psMatrix.h (modified) (10 diffs)
-
dataManip/psMatrixVectorArithmetic.h (modified) (3 diffs)
-
math/psMatrix.h (modified) (10 diffs)
-
math/psPolynomial.h (modified) (9 diffs)
-
math/psSpline.h (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/dataManip/psFunctions.h
r1441 r1464 13 13 * @author George Gusciora, MHPCC 14 14 * 15 * @version $Revision: 1.1 8$ $Name: not supported by cvs2svn $16 * @date $Date: 2004-08- 09 23:40:55$15 * @version $Revision: 1.19 $ $Name: not supported by cvs2svn $ 16 * @date $Date: 2004-08-11 02:35:58 $ 17 17 * 18 18 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 31 31 32 32 /** Evaluate a non-normalized Gaussian with the given mean and sigma at the 33 given coordianate. Note that this is not a Gaussian deviate. The 34 evaluated Gaussian is: \f[ exp(-\frac{(x-mean)^2}{2\sigma^2}) \f] */ 35 36 float psGaussian(float x, ///< Value at which to evaluate 37 float mean, ///< Mean for the Gaussian 38 float stddev, ///< Standard deviation for the Gaussian 39 bool normal ///< Indicates whether result should be normalized 40 ); 33 * given coordianate. 34 * 35 * Note that this is not a Gaussian deviate. The evaluated Gaussian is: 36 * \f[ exp(-\frac{(x-mean)^2}{2\sigma^2}) \f] 37 * 38 * @return float value on the gaussian curve given the input parameters 39 */ 40 float psGaussian( 41 float x, ///< Value at which to evaluate 42 float mean, ///< Mean for the Gaussian 43 float stddev, ///< Standard deviation for the Gaussian 44 bool normal ///< Indicates whether result should be normalized 45 ); 41 46 42 47 /** Produce a vector of random numbers from a Gaussian distribution with 43 the specified mean and sigma */ 44 psVector* psGaussianDev(float mean, ///< The mean of the Gaussian 45 float sigma, ///< The sigma of the Gaussian 46 int Npts); ///< The size of the vector 48 * the specified mean and sigma 49 * 50 * @return psVector* vector of random numbers 51 * 52 */ 53 psVector* psGaussianDev( 54 float mean, ///< The mean of the Gaussian 55 float sigma, ///< The sigma of the Gaussian 56 int Npts ///< The size of the vector 57 ); 47 58 48 59 /** One-dimensional polynomial */ 49 60 typedef struct 50 61 { 51 int n; ///< Number of terms52 float *coeff; ///< Coefficients53 float *coeffErr; ///< Error in coefficients54 char *mask; ///< Coefficient mask62 int n; ///< Number of terms 63 float *coeff; ///< Coefficients 64 float *coeffErr; ///< Error in coefficients 65 char *mask; ///< Coefficient mask 55 66 } 56 67 psPolynomial1D; … … 59 70 typedef struct 60 71 { 61 int nX ,62 nY; ///< Number of terms in x andy63 float **coeff; ///< Coefficients64 float **coeffErr; ///< Error in coefficients65 char **mask; ///< Coefficients mask72 int nX; ///< Number of terms in x 73 int nY; ///< Number of terms in y 74 float **coeff; ///< Coefficients 75 float **coeffErr; ///< Error in coefficients 76 char **mask; ///< Coefficients mask 66 77 } 67 78 psPolynomial2D; … … 70 81 typedef struct 71 82 { 72 int nX ,73 nY,74 nZ; ///< Number of terms in x, y andz75 float ***coeff; ///< Coefficients76 float ***coeffErr; ///< Error in coefficients77 char ***mask; ///< Coefficients mask83 int nX; ///< Number of terms in x 84 int nY; ///< Number of terms in y 85 int nZ; ///< Number of terms in z 86 float ***coeff; ///< Coefficients 87 float ***coeffErr; ///< Error in coefficients 88 char ***mask; ///< Coefficients mask 78 89 } 79 90 psPolynomial3D; … … 82 93 typedef struct 83 94 { 84 int nW ,85 nX,86 nY,87 nZ; ///< Number of terms in w, x, y andz88 float ****coeff; ///< Coefficients89 float ****coeffErr; ///< Error in coefficients90 char ****mask; ///< Coefficients mask95 int nW; ///< Number of terms in w 96 int nX; ///< Number of terms in x 97 int nY; ///< Number of terms in y 98 int nZ; ///< Number of terms in z 99 float ****coeff; ///< Coefficients 100 float ****coeffErr; ///< Error in coefficients 101 char ****mask; ///< Coefficients mask 91 102 } 92 103 psPolynomial4D; 93 104 94 /** Functions **************************************************************/ 95 96 /** Constructor */ 97 psPolynomial1D* psPolynomial1DAlloc(int n ///< Number of terms 98 ); 99 100 /** Constructor */ 101 psPolynomial2D* psPolynomial2DAlloc(int nX, int nY ///< Number of terms in x and y 102 ); 103 104 /** Constructor */ 105 psPolynomial3D* psPolynomial3DAlloc(int nX, int nY, int nZ ///< Number of terms in x, y and z 106 ); 107 108 /** Constructor */ 109 psPolynomial4D* psPolynomial4DAlloc(int nW, int nX, int nY, int nZ ///< Number of terms in w, x, y and 110 // z 111 ); 112 113 /** Evaluate 1D polynomial */ 114 float psPolynomial1DEval(float x, ///< Value at which to evaluate 115 const psPolynomial1D* myPoly ///< Coefficients for the polynomial 116 ); 117 118 /** Evaluate 2D polynomial */ 119 float psPolynomial2DEval(float x, ///< Value x at which to evaluate 120 float y, ///< Value y at which to evaluate 121 const psPolynomial2D* myPoly ///< Coefficients for the polynomial 122 ); 123 124 /** Evaluate 3D polynomial */ 125 float psPolynomial3DEval(float x, ///< Value x at which to evaluate 126 float y, ///< Value y at which to evaluate 127 float z, ///< Value z at which to evaluate 128 const psPolynomial3D* myPoly ///< Coefficients for the polynomial 129 ); 130 131 /** Evaluate 4D polynomial */ 132 float psPolynomial4DEval(float w, ///< Value w at which to evaluate 133 float x, ///< Value x at which to evaluate 134 float y, ///< Value y at which to evaluate 135 float z, ///< Value z at which to evaluate 136 const psPolynomial4D* myPoly ///< Coefficients for the polynomial 137 ); 105 106 /** Allocates a psPolynomial1D structure with n terms 107 * 108 * @return psPolynomial1D* new 1-D polynomial struct 109 */ 110 psPolynomial1D* psPolynomial1DAlloc( 111 int n ///< Number of terms 112 ); 113 114 /** Allocates a 2-D polynomial structure 115 * 116 * @return psPolynomial2D* new 2-D polynomial struct 117 */ 118 psPolynomial2D* psPolynomial2DAlloc( 119 int nX, ///< Number of terms in x 120 int nY ///< Number of terms in y 121 ); 122 123 /** Allocates a 3-D polynomial structure 124 * 125 * @return psPolynomial3D* new 3-D polynomial struct 126 */ 127 psPolynomial3D* psPolynomial3DAlloc( 128 int nX, ///< Number of terms in x 129 int nY, ///< Number of terms in y 130 int nZ ///< Number of terms in z 131 ); 132 133 /** Allocates a 4-D polynomial structure 134 * 135 * @return psPolynomial4D* new 4-D polynomial struct 136 */ 137 psPolynomial4D* psPolynomial4DAlloc( 138 int nW, ///< Number of terms in w 139 int nX, ///< Number of terms in x 140 int nY, ///< Number of terms in y 141 int nZ ///< Number of terms in z 142 ); 143 144 /** Evaluates a 1-D polynomial at specific coordinates. 145 * 146 * @return float result of polynomial at given location 147 */ 148 float psPolynomial1DEval( 149 float x, ///< location at which to evaluate 150 const psPolynomial1D* myPoly ///< Coefficients for the polynomial 151 ); 152 153 /** Evaluates a 2-D polynomial at specific coordinates. 154 * 155 * @return float result of polynomial at given location 156 */ 157 float psPolynomial2DEval( 158 float x, ///< x location at which to evaluate 159 float y, ///< y location at which to evaluate 160 const psPolynomial2D* myPoly ///< Coefficients for the polynomial 161 ); 162 163 /** Evaluates a 3-D polynomial at specific coordinates. 164 * 165 * @return float result of polynomial at given location 166 */ 167 float psPolynomial3DEval( 168 float x, ///< x location at which to evaluate 169 float y, ///< y location at which to evaluate 170 float z, ///< z location at which to evaluate 171 const psPolynomial3D* myPoly ///< Coefficients for the polynomial 172 ); 173 174 /** Evaluates a 4-D polynomial at specific coordinates. 175 * 176 * @return float result of polynomial at given location 177 */ 178 float psPolynomial4DEval( 179 float w, ///< w location at which to evaluate 180 float x, ///< x location at which to evaluate 181 float y, ///< y location at which to evaluate 182 float z, ///< z location at which to evaluate 183 const psPolynomial4D* myPoly ///< Coefficients for the polynomial 184 ); 138 185 139 186 /*****************************************************************************/ … … 144 191 typedef struct 145 192 { 146 int n; ///< Number of terms147 double *coeff; ///< Coefficients148 double *coeffErr; ///< Error in coefficients149 char *mask; ///< Coefficient mask193 int n; ///< Number of terms 194 double *coeff; ///< Coefficients 195 double *coeffErr; ///< Error in coefficients 196 char *mask; ///< Coefficient mask 150 197 } 151 198 psDPolynomial1D; … … 154 201 typedef struct 155 202 { 156 int nX ,157 nY; ///< Number of terms in x andy158 double **coeff; ///< Coefficients159 double **coeffErr; ///< Error in coefficients160 char **mask; ///< Coefficients mask203 int nX; ///< Number of terms in x 204 int nY; ///< Number of terms in y 205 double **coeff; ///< Coefficients 206 double **coeffErr; ///< Error in coefficients 207 char **mask; ///< Coefficients mask 161 208 } 162 209 psDPolynomial2D; … … 165 212 typedef struct 166 213 { 167 int nX ,168 nY,169 nZ; ///< Number of terms in x, y andz170 double ***coeff; ///< Coefficients171 double ***coeffErr; ///< Error in coefficients172 char ***mask; ///< Coefficient mask214 int nX; ///< Number of terms in x 215 int nY; ///< Number of terms in y 216 int nZ; ///< Number of terms in z 217 double ***coeff; ///< Coefficients 218 double ***coeffErr; ///< Error in coefficients 219 char ***mask; ///< Coefficient mask 173 220 } 174 221 psDPolynomial3D; … … 177 224 typedef struct 178 225 { 179 int nW ,180 nX,181 nY,182 nZ; ///< Number of terms in w, x, y andz183 double ****coeff; ///< Coefficients184 double ****coeffErr; ///< Error in coefficients185 char ****mask; ///< Coefficients mask226 int nW; ///< Number of terms in w 227 int nX; ///< Number of terms in x 228 int nY; ///< Number of terms in y 229 int nZ; ///< Number of terms in z 230 double ****coeff; ///< Coefficients 231 double ****coeffErr; ///< Error in coefficients 232 char ****mask; ///< Coefficients mask 186 233 } 187 234 psDPolynomial4D; 188 235 189 /** Constructor */ 190 psDPolynomial1D* psDPolynomial1DAlloc(int n ///< Number of terms 191 ); 192 193 /** Constructor */ 194 psDPolynomial2D* psDPolynomial2DAlloc(int nX, int nY ///< Number of terms in x and y 195 ); 196 197 /** Constructor */ 198 psDPolynomial3D* psDPolynomial3DAlloc(int nX, int nY, int nZ ///< Number of terms in x, y and z 199 ); 200 201 /** Constructor */ 202 psDPolynomial4D* psDPolynomial4DAlloc(int nW, int nX, int nY, int nZ ///< Number of terms in w, x, y and 203 // z 204 ); 205 206 /** Evaluate 1D polynomial (double precision) */ 207 double psDPolynomial1DEval(double x, ///< Value at which to evaluate 208 const psDPolynomial1D* myPoly ///< Coefficients for the polynomial 209 ); 210 211 /** Evaluate 2D polynomial (double precision) */ 212 double psDPolynomial2DEval(double x, ///< Value x at which to evaluate 213 double y, ///< Value y at which to evaluate 214 const psDPolynomial2D* myPoly ///< Coefficients for the polynomial 215 ); 216 217 /** Evaluate 3D polynomial (double precision) */ 218 double psDPolynomial3DEval(double x, ///< Value x at which to evaluate 219 double y, ///< Value y at which to evaluate 220 double z, ///< Value z at which to evaluate 221 const psDPolynomial3D* myPoly ///< Coefficients for the polynomial 222 ); 223 224 /** Evaluate 4D polynomial (double precision) */ 225 double psDPolynomial4DEval(double w, ///< Value w at which to evaluate 226 double x, ///< Value x at which to evaluate 227 double y, ///< Value y at which to evaluate 228 double z, ///< Value z at which to evaluate 229 const psDPolynomial4D* myPoly ///< Coefficients for the polynomial 230 ); 236 /** Allocates a double-precision 1-D polynomial structure with n terms 237 * 238 * @return psPolynomial1D* new double-precision 1-D polynomial struct 239 */ 240 psDPolynomial1D* psDPolynomial1DAlloc( 241 int n ///< Number of terms 242 ); 243 244 /** Allocates a double-precision 2-D polynomial structure 245 * 246 * @return psPolynomial2D* new double-precision 2-D polynomial struct 247 */ 248 psDPolynomial2D* psDPolynomial2DAlloc( 249 int nX, ///< Number of terms in x 250 int nY ///< Number of terms in y 251 ); 252 253 /** Allocates a double-precision 3-D polynomial structure 254 * 255 * @return psPolynomial3D* new double-precision 3-D polynomial struct 256 */ 257 psDPolynomial3D* psDPolynomial3DAlloc( 258 int nX, ///< Number of terms in x 259 int nY, ///< Number of terms in y 260 int nZ ///< Number of terms in z 261 ); 262 263 /** Allocates a double-precision 4-D polynomial structure 264 * 265 * @return psPolynomial4D* new double-precision 4-D polynomial struct 266 */ 267 psDPolynomial4D* psDPolynomial4DAlloc( 268 int nW, ///< Number of terms in w 269 int nX, ///< Number of terms in x 270 int nY, ///< Number of terms in y 271 int nZ ///< Number of terms in z 272 ); 273 274 /** Evaluates a double-precision 1-D polynomial at specific coordinates. 275 * 276 * @return float result of polynomial at given location 277 */ 278 double psDPolynomial1DEval( 279 double x, ///< Value at which to evaluate 280 const psDPolynomial1D* myPoly ///< Coefficients for the polynomial 281 ); 282 283 /** Evaluates a double-precision 2-D polynomial at specific coordinates. 284 * 285 * @return float result of polynomial at given location 286 */ 287 double psDPolynomial2DEval( 288 double x, ///< Value x at which to evaluate 289 double y, ///< Value y at which to evaluate 290 const psDPolynomial2D* myPoly ///< Coefficients for the polynomial 291 ); 292 293 /** Evaluates a double-precision 3-D polynomial at specific coordinates. 294 * 295 * @return float result of polynomial at given location 296 */ 297 double psDPolynomial3DEval( 298 double x, ///< Value x at which to evaluate 299 double y, ///< Value y at which to evaluate 300 double z, ///< Value z at which to evaluate 301 const psDPolynomial3D* myPoly ///< Coefficients for the polynomial 302 ); 303 304 /** Evaluates a double-precision 4-D polynomial at specific coordinates. 305 * 306 * @return float result of polynomial at given location 307 */ 308 double psDPolynomial4DEval( 309 double w, ///< Value w at which to evaluate 310 double x, ///< Value x at which to evaluate 311 double y, ///< Value y at which to evaluate 312 double z, ///< Value z at which to evaluate 313 const psDPolynomial4D* myPoly ///< Coefficients for the polynomial 314 ); 231 315 232 316 /* \} */// End of MathGroup Functions -
trunk/psLib/src/dataManip/psMatrix.h
r1441 r1464 22 22 * @author Ross Harman, MHPCC 23 23 * 24 * @version $Revision: 1.1 0$ $Name: not supported by cvs2svn $25 * @date $Date: 2004-08- 09 23:40:55$24 * @version $Revision: 1.11 $ $Name: not supported by cvs2svn $ 25 * @date $Date: 2004-08-11 02:35:58 $ 26 26 * 27 27 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 43 43 * @return psImage* : Pointer to LU decomposed psImage. 44 44 */ 45 psImage* psMatrixLUD(psImage* outImage, ///< Image to return, or NULL. 46 psVector* outPerm, ///< Output permutation vector used by psMatrixLUSolve. 47 psImage* inImage ///< Image to decompose. 48 ); 45 psImage* psMatrixLUD( 46 psImage* outImage, ///< Image to return, or NULL. 47 psVector* outPerm, ///< Output permutation vector used by psMatrixLUSolve. 48 psImage* inImage ///< Image to decompose. 49 ); 49 50 50 51 /** LU Solution of psImage matrix. … … 57 58 * @return psVector* : Pointer to psVector solution of matrix equation. 58 59 */ 59 psVector* psMatrixLUSolve( psVector* outVector, ///< Vector to return, or NULL.60 const psImage* luImage, ///< LU-decomposed matrix.61 const psVector* inVector, ///< Vector right-hand-side of equation.62 const psVector* inPerm ///< Permutation vector resulting from psMatrixLUD63 //function.64 );60 psVector* psMatrixLUSolve( 61 psVector* outVector, ///< Vector to return, or NULL. 62 const psImage* luImage, ///< LU-decomposed matrix. 63 const psVector* inVector, ///< Vector right-hand-side of equation. 64 const psVector* inPerm ///< Permutation vector resulting from psMatrixLUD function. 65 ); 65 66 66 67 /** Invert psImage matrix. … … 73 74 * @return psImage* : Pointer to inverted psImage. 74 75 */ 75 psImage* psMatrixInvert(psImage* outImage, ///< Image to return, or NULL for in-place substitution. 76 const psImage* inImage, ///< Image to be inverted 77 float *restrict det ///< Determinant to return, or NULL 78 ); 76 psImage* psMatrixInvert( 77 psImage* outImage, ///< Image to return, or NULL for in-place substitution. 78 const psImage* inImage, ///< Image to be inverted 79 float *restrict det ///< Determinant to return, or NULL 80 ); 79 81 80 82 /** Calculate psImage matrix determinant. … … 86 88 * @return float: Determinant from psImage. 87 89 */ 88 float *psMatrixDeterminant(const psImage* restrict inMatrix ///< Image used to calculate determinant. 89 ); 90 float *psMatrixDeterminant( 91 const psImage* restrict inMatrix ///< Image used to calculate determinant. 92 ); 90 93 91 94 /** Performs psImage matrix multiplication. … … 98 101 * @return psImage* : Pointer to resulting psImage. 99 102 */ 100 psImage* psMatrixMultiply(psImage* outImage, ///< Matrix to return, or NULL. 101 psImage* inImage1, ///< First input image. 102 psImage* inImage2 ///< Second input image. 103 ); 103 psImage* psMatrixMultiply( 104 psImage* outImage, ///< Matrix to return, or NULL. 105 psImage* inImage1, ///< First input image. 106 psImage* inImage2 ///< Second input image. 107 ); 104 108 105 109 /** Transpose matrix. … … 112 116 * @return psImage* : Pointer to transposed psImage. 113 117 */ 114 psImage* psMatrixTranspose(psImage* outImage, ///< Image to return, or NULL 115 const psImage* inImage ///< Image to transpose 116 ); 118 psImage* psMatrixTranspose( 119 psImage* outImage, ///< Image to return, or NULL 120 const psImage* inImage ///< Image to transpose 121 ); 117 122 118 123 /** Calculate matrix eigenvectors. … … 124 129 * @return psImage* : Pointer to matrix of Eigenvectors. 125 130 */ 126 psImage* psMatrixEigenvectors(psImage* outImage, ///< Eigenvectors to return, or NULL. 127 psImage* inImage ///< Input image. 128 ); 131 psImage* psMatrixEigenvectors( 132 psImage* outImage, ///< Eigenvectors to return, or NULL. 133 psImage* inImage ///< Input image. 134 ); 129 135 130 136 /** Convert matrix to vector. … … 137 143 * @return psVector* : Pointer to psVector. 138 144 */ 139 psVector* psMatrixToVector(psVector* outVector, ///< Vector to return, or NULL. 140 psImage* inImage ///< Image to convert. 141 ); 145 psVector* psMatrixToVector( 146 psVector* outVector, ///< Vector to return, or NULL. 147 psImage* inImage ///< Image to convert. 148 ); 142 149 143 150 /** Convert vector to matrix. … … 150 157 * @return psVector* : Pointer to psIamge. 151 158 */ 152 psImage* psVectorToMatrix(psImage* outImage, ///< Matrix to return, or NULL. 153 psVector* inVector ///< Vector to convert. 154 ); 159 psImage* psVectorToMatrix( 160 psImage* outImage, ///< Matrix to return, or NULL. 161 psVector* inVector ///< Vector to convert. 162 ); 155 163 156 164 /// @} -
trunk/psLib/src/dataManip/psMatrixVectorArithmetic.h
r1441 r1464 30 30 * @author Ross Harman, MHPCC 31 31 * 32 * @version $Revision: 1. 4$ $Name: not supported by cvs2svn $33 * @date $Date: 2004-08- 09 23:40:55 $32 * @version $Revision: 1.5 $ $Name: not supported by cvs2svn $ 33 * @date $Date: 2004-08-11 02:37:55 $ 34 34 * 35 35 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 55 55 * @return psType* : Pointer to either psImage or psVector. 56 56 */ 57 psType* psBinaryOp(void *out, // / Output type, either psImage or psVector. 58 void *in1, // / First input, either psImage or psVector. 59 char *op, // / Operator. 60 void *in2 // / Second input, either psImage or psVector. 61 ); 57 psType* psBinaryOp( 58 void *out, ///< Output type, either psImage or psVector. 59 void *in1, ///< First input, either psImage or psVector. 60 char *op, ///< Operator. 61 void *in2 ///< Second input, either psImage or psVector. 62 ); 62 63 63 64 /** Perform simple unary arithmetic with images or vectors … … 77 78 * @return psType* : Pointer to either psImage or psVector. 78 79 */ 79 psType* psUnaryOp(void *out, // / Output type, either psImage or psVector. 80 void *in, // / Input, either psImage or psVector. 81 char *op // / Operator. 82 ); 80 psType* psUnaryOp( 81 void *out, ///< Output type, either psImage or psVector. 82 void *in, ///< Input, either psImage or psVector. 83 char *op ///< Operator. 84 ); 83 85 84 86 /// @} -
trunk/psLib/src/math/psMatrix.h
r1441 r1464 22 22 * @author Ross Harman, MHPCC 23 23 * 24 * @version $Revision: 1.1 0$ $Name: not supported by cvs2svn $25 * @date $Date: 2004-08- 09 23:40:55$24 * @version $Revision: 1.11 $ $Name: not supported by cvs2svn $ 25 * @date $Date: 2004-08-11 02:35:58 $ 26 26 * 27 27 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 43 43 * @return psImage* : Pointer to LU decomposed psImage. 44 44 */ 45 psImage* psMatrixLUD(psImage* outImage, ///< Image to return, or NULL. 46 psVector* outPerm, ///< Output permutation vector used by psMatrixLUSolve. 47 psImage* inImage ///< Image to decompose. 48 ); 45 psImage* psMatrixLUD( 46 psImage* outImage, ///< Image to return, or NULL. 47 psVector* outPerm, ///< Output permutation vector used by psMatrixLUSolve. 48 psImage* inImage ///< Image to decompose. 49 ); 49 50 50 51 /** LU Solution of psImage matrix. … … 57 58 * @return psVector* : Pointer to psVector solution of matrix equation. 58 59 */ 59 psVector* psMatrixLUSolve( psVector* outVector, ///< Vector to return, or NULL.60 const psImage* luImage, ///< LU-decomposed matrix.61 const psVector* inVector, ///< Vector right-hand-side of equation.62 const psVector* inPerm ///< Permutation vector resulting from psMatrixLUD63 //function.64 );60 psVector* psMatrixLUSolve( 61 psVector* outVector, ///< Vector to return, or NULL. 62 const psImage* luImage, ///< LU-decomposed matrix. 63 const psVector* inVector, ///< Vector right-hand-side of equation. 64 const psVector* inPerm ///< Permutation vector resulting from psMatrixLUD function. 65 ); 65 66 66 67 /** Invert psImage matrix. … … 73 74 * @return psImage* : Pointer to inverted psImage. 74 75 */ 75 psImage* psMatrixInvert(psImage* outImage, ///< Image to return, or NULL for in-place substitution. 76 const psImage* inImage, ///< Image to be inverted 77 float *restrict det ///< Determinant to return, or NULL 78 ); 76 psImage* psMatrixInvert( 77 psImage* outImage, ///< Image to return, or NULL for in-place substitution. 78 const psImage* inImage, ///< Image to be inverted 79 float *restrict det ///< Determinant to return, or NULL 80 ); 79 81 80 82 /** Calculate psImage matrix determinant. … … 86 88 * @return float: Determinant from psImage. 87 89 */ 88 float *psMatrixDeterminant(const psImage* restrict inMatrix ///< Image used to calculate determinant. 89 ); 90 float *psMatrixDeterminant( 91 const psImage* restrict inMatrix ///< Image used to calculate determinant. 92 ); 90 93 91 94 /** Performs psImage matrix multiplication. … … 98 101 * @return psImage* : Pointer to resulting psImage. 99 102 */ 100 psImage* psMatrixMultiply(psImage* outImage, ///< Matrix to return, or NULL. 101 psImage* inImage1, ///< First input image. 102 psImage* inImage2 ///< Second input image. 103 ); 103 psImage* psMatrixMultiply( 104 psImage* outImage, ///< Matrix to return, or NULL. 105 psImage* inImage1, ///< First input image. 106 psImage* inImage2 ///< Second input image. 107 ); 104 108 105 109 /** Transpose matrix. … … 112 116 * @return psImage* : Pointer to transposed psImage. 113 117 */ 114 psImage* psMatrixTranspose(psImage* outImage, ///< Image to return, or NULL 115 const psImage* inImage ///< Image to transpose 116 ); 118 psImage* psMatrixTranspose( 119 psImage* outImage, ///< Image to return, or NULL 120 const psImage* inImage ///< Image to transpose 121 ); 117 122 118 123 /** Calculate matrix eigenvectors. … … 124 129 * @return psImage* : Pointer to matrix of Eigenvectors. 125 130 */ 126 psImage* psMatrixEigenvectors(psImage* outImage, ///< Eigenvectors to return, or NULL. 127 psImage* inImage ///< Input image. 128 ); 131 psImage* psMatrixEigenvectors( 132 psImage* outImage, ///< Eigenvectors to return, or NULL. 133 psImage* inImage ///< Input image. 134 ); 129 135 130 136 /** Convert matrix to vector. … … 137 143 * @return psVector* : Pointer to psVector. 138 144 */ 139 psVector* psMatrixToVector(psVector* outVector, ///< Vector to return, or NULL. 140 psImage* inImage ///< Image to convert. 141 ); 145 psVector* psMatrixToVector( 146 psVector* outVector, ///< Vector to return, or NULL. 147 psImage* inImage ///< Image to convert. 148 ); 142 149 143 150 /** Convert vector to matrix. … … 150 157 * @return psVector* : Pointer to psIamge. 151 158 */ 152 psImage* psVectorToMatrix(psImage* outImage, ///< Matrix to return, or NULL. 153 psVector* inVector ///< Vector to convert. 154 ); 159 psImage* psVectorToMatrix( 160 psImage* outImage, ///< Matrix to return, or NULL. 161 psVector* inVector ///< Vector to convert. 162 ); 155 163 156 164 /// @} -
trunk/psLib/src/math/psPolynomial.h
r1441 r1464 13 13 * @author George Gusciora, MHPCC 14 14 * 15 * @version $Revision: 1.1 8$ $Name: not supported by cvs2svn $16 * @date $Date: 2004-08- 09 23:40:55$15 * @version $Revision: 1.19 $ $Name: not supported by cvs2svn $ 16 * @date $Date: 2004-08-11 02:35:58 $ 17 17 * 18 18 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 31 31 32 32 /** Evaluate a non-normalized Gaussian with the given mean and sigma at the 33 given coordianate. Note that this is not a Gaussian deviate. The 34 evaluated Gaussian is: \f[ exp(-\frac{(x-mean)^2}{2\sigma^2}) \f] */ 35 36 float psGaussian(float x, ///< Value at which to evaluate 37 float mean, ///< Mean for the Gaussian 38 float stddev, ///< Standard deviation for the Gaussian 39 bool normal ///< Indicates whether result should be normalized 40 ); 33 * given coordianate. 34 * 35 * Note that this is not a Gaussian deviate. The evaluated Gaussian is: 36 * \f[ exp(-\frac{(x-mean)^2}{2\sigma^2}) \f] 37 * 38 * @return float value on the gaussian curve given the input parameters 39 */ 40 float psGaussian( 41 float x, ///< Value at which to evaluate 42 float mean, ///< Mean for the Gaussian 43 float stddev, ///< Standard deviation for the Gaussian 44 bool normal ///< Indicates whether result should be normalized 45 ); 41 46 42 47 /** Produce a vector of random numbers from a Gaussian distribution with 43 the specified mean and sigma */ 44 psVector* psGaussianDev(float mean, ///< The mean of the Gaussian 45 float sigma, ///< The sigma of the Gaussian 46 int Npts); ///< The size of the vector 48 * the specified mean and sigma 49 * 50 * @return psVector* vector of random numbers 51 * 52 */ 53 psVector* psGaussianDev( 54 float mean, ///< The mean of the Gaussian 55 float sigma, ///< The sigma of the Gaussian 56 int Npts ///< The size of the vector 57 ); 47 58 48 59 /** One-dimensional polynomial */ 49 60 typedef struct 50 61 { 51 int n; ///< Number of terms52 float *coeff; ///< Coefficients53 float *coeffErr; ///< Error in coefficients54 char *mask; ///< Coefficient mask62 int n; ///< Number of terms 63 float *coeff; ///< Coefficients 64 float *coeffErr; ///< Error in coefficients 65 char *mask; ///< Coefficient mask 55 66 } 56 67 psPolynomial1D; … … 59 70 typedef struct 60 71 { 61 int nX ,62 nY; ///< Number of terms in x andy63 float **coeff; ///< Coefficients64 float **coeffErr; ///< Error in coefficients65 char **mask; ///< Coefficients mask72 int nX; ///< Number of terms in x 73 int nY; ///< Number of terms in y 74 float **coeff; ///< Coefficients 75 float **coeffErr; ///< Error in coefficients 76 char **mask; ///< Coefficients mask 66 77 } 67 78 psPolynomial2D; … … 70 81 typedef struct 71 82 { 72 int nX ,73 nY,74 nZ; ///< Number of terms in x, y andz75 float ***coeff; ///< Coefficients76 float ***coeffErr; ///< Error in coefficients77 char ***mask; ///< Coefficients mask83 int nX; ///< Number of terms in x 84 int nY; ///< Number of terms in y 85 int nZ; ///< Number of terms in z 86 float ***coeff; ///< Coefficients 87 float ***coeffErr; ///< Error in coefficients 88 char ***mask; ///< Coefficients mask 78 89 } 79 90 psPolynomial3D; … … 82 93 typedef struct 83 94 { 84 int nW ,85 nX,86 nY,87 nZ; ///< Number of terms in w, x, y andz88 float ****coeff; ///< Coefficients89 float ****coeffErr; ///< Error in coefficients90 char ****mask; ///< Coefficients mask95 int nW; ///< Number of terms in w 96 int nX; ///< Number of terms in x 97 int nY; ///< Number of terms in y 98 int nZ; ///< Number of terms in z 99 float ****coeff; ///< Coefficients 100 float ****coeffErr; ///< Error in coefficients 101 char ****mask; ///< Coefficients mask 91 102 } 92 103 psPolynomial4D; 93 104 94 /** Functions **************************************************************/ 95 96 /** Constructor */ 97 psPolynomial1D* psPolynomial1DAlloc(int n ///< Number of terms 98 ); 99 100 /** Constructor */ 101 psPolynomial2D* psPolynomial2DAlloc(int nX, int nY ///< Number of terms in x and y 102 ); 103 104 /** Constructor */ 105 psPolynomial3D* psPolynomial3DAlloc(int nX, int nY, int nZ ///< Number of terms in x, y and z 106 ); 107 108 /** Constructor */ 109 psPolynomial4D* psPolynomial4DAlloc(int nW, int nX, int nY, int nZ ///< Number of terms in w, x, y and 110 // z 111 ); 112 113 /** Evaluate 1D polynomial */ 114 float psPolynomial1DEval(float x, ///< Value at which to evaluate 115 const psPolynomial1D* myPoly ///< Coefficients for the polynomial 116 ); 117 118 /** Evaluate 2D polynomial */ 119 float psPolynomial2DEval(float x, ///< Value x at which to evaluate 120 float y, ///< Value y at which to evaluate 121 const psPolynomial2D* myPoly ///< Coefficients for the polynomial 122 ); 123 124 /** Evaluate 3D polynomial */ 125 float psPolynomial3DEval(float x, ///< Value x at which to evaluate 126 float y, ///< Value y at which to evaluate 127 float z, ///< Value z at which to evaluate 128 const psPolynomial3D* myPoly ///< Coefficients for the polynomial 129 ); 130 131 /** Evaluate 4D polynomial */ 132 float psPolynomial4DEval(float w, ///< Value w at which to evaluate 133 float x, ///< Value x at which to evaluate 134 float y, ///< Value y at which to evaluate 135 float z, ///< Value z at which to evaluate 136 const psPolynomial4D* myPoly ///< Coefficients for the polynomial 137 ); 105 106 /** Allocates a psPolynomial1D structure with n terms 107 * 108 * @return psPolynomial1D* new 1-D polynomial struct 109 */ 110 psPolynomial1D* psPolynomial1DAlloc( 111 int n ///< Number of terms 112 ); 113 114 /** Allocates a 2-D polynomial structure 115 * 116 * @return psPolynomial2D* new 2-D polynomial struct 117 */ 118 psPolynomial2D* psPolynomial2DAlloc( 119 int nX, ///< Number of terms in x 120 int nY ///< Number of terms in y 121 ); 122 123 /** Allocates a 3-D polynomial structure 124 * 125 * @return psPolynomial3D* new 3-D polynomial struct 126 */ 127 psPolynomial3D* psPolynomial3DAlloc( 128 int nX, ///< Number of terms in x 129 int nY, ///< Number of terms in y 130 int nZ ///< Number of terms in z 131 ); 132 133 /** Allocates a 4-D polynomial structure 134 * 135 * @return psPolynomial4D* new 4-D polynomial struct 136 */ 137 psPolynomial4D* psPolynomial4DAlloc( 138 int nW, ///< Number of terms in w 139 int nX, ///< Number of terms in x 140 int nY, ///< Number of terms in y 141 int nZ ///< Number of terms in z 142 ); 143 144 /** Evaluates a 1-D polynomial at specific coordinates. 145 * 146 * @return float result of polynomial at given location 147 */ 148 float psPolynomial1DEval( 149 float x, ///< location at which to evaluate 150 const psPolynomial1D* myPoly ///< Coefficients for the polynomial 151 ); 152 153 /** Evaluates a 2-D polynomial at specific coordinates. 154 * 155 * @return float result of polynomial at given location 156 */ 157 float psPolynomial2DEval( 158 float x, ///< x location at which to evaluate 159 float y, ///< y location at which to evaluate 160 const psPolynomial2D* myPoly ///< Coefficients for the polynomial 161 ); 162 163 /** Evaluates a 3-D polynomial at specific coordinates. 164 * 165 * @return float result of polynomial at given location 166 */ 167 float psPolynomial3DEval( 168 float x, ///< x location at which to evaluate 169 float y, ///< y location at which to evaluate 170 float z, ///< z location at which to evaluate 171 const psPolynomial3D* myPoly ///< Coefficients for the polynomial 172 ); 173 174 /** Evaluates a 4-D polynomial at specific coordinates. 175 * 176 * @return float result of polynomial at given location 177 */ 178 float psPolynomial4DEval( 179 float w, ///< w location at which to evaluate 180 float x, ///< x location at which to evaluate 181 float y, ///< y location at which to evaluate 182 float z, ///< z location at which to evaluate 183 const psPolynomial4D* myPoly ///< Coefficients for the polynomial 184 ); 138 185 139 186 /*****************************************************************************/ … … 144 191 typedef struct 145 192 { 146 int n; ///< Number of terms147 double *coeff; ///< Coefficients148 double *coeffErr; ///< Error in coefficients149 char *mask; ///< Coefficient mask193 int n; ///< Number of terms 194 double *coeff; ///< Coefficients 195 double *coeffErr; ///< Error in coefficients 196 char *mask; ///< Coefficient mask 150 197 } 151 198 psDPolynomial1D; … … 154 201 typedef struct 155 202 { 156 int nX ,157 nY; ///< Number of terms in x andy158 double **coeff; ///< Coefficients159 double **coeffErr; ///< Error in coefficients160 char **mask; ///< Coefficients mask203 int nX; ///< Number of terms in x 204 int nY; ///< Number of terms in y 205 double **coeff; ///< Coefficients 206 double **coeffErr; ///< Error in coefficients 207 char **mask; ///< Coefficients mask 161 208 } 162 209 psDPolynomial2D; … … 165 212 typedef struct 166 213 { 167 int nX ,168 nY,169 nZ; ///< Number of terms in x, y andz170 double ***coeff; ///< Coefficients171 double ***coeffErr; ///< Error in coefficients172 char ***mask; ///< Coefficient mask214 int nX; ///< Number of terms in x 215 int nY; ///< Number of terms in y 216 int nZ; ///< Number of terms in z 217 double ***coeff; ///< Coefficients 218 double ***coeffErr; ///< Error in coefficients 219 char ***mask; ///< Coefficient mask 173 220 } 174 221 psDPolynomial3D; … … 177 224 typedef struct 178 225 { 179 int nW ,180 nX,181 nY,182 nZ; ///< Number of terms in w, x, y andz183 double ****coeff; ///< Coefficients184 double ****coeffErr; ///< Error in coefficients185 char ****mask; ///< Coefficients mask226 int nW; ///< Number of terms in w 227 int nX; ///< Number of terms in x 228 int nY; ///< Number of terms in y 229 int nZ; ///< Number of terms in z 230 double ****coeff; ///< Coefficients 231 double ****coeffErr; ///< Error in coefficients 232 char ****mask; ///< Coefficients mask 186 233 } 187 234 psDPolynomial4D; 188 235 189 /** Constructor */ 190 psDPolynomial1D* psDPolynomial1DAlloc(int n ///< Number of terms 191 ); 192 193 /** Constructor */ 194 psDPolynomial2D* psDPolynomial2DAlloc(int nX, int nY ///< Number of terms in x and y 195 ); 196 197 /** Constructor */ 198 psDPolynomial3D* psDPolynomial3DAlloc(int nX, int nY, int nZ ///< Number of terms in x, y and z 199 ); 200 201 /** Constructor */ 202 psDPolynomial4D* psDPolynomial4DAlloc(int nW, int nX, int nY, int nZ ///< Number of terms in w, x, y and 203 // z 204 ); 205 206 /** Evaluate 1D polynomial (double precision) */ 207 double psDPolynomial1DEval(double x, ///< Value at which to evaluate 208 const psDPolynomial1D* myPoly ///< Coefficients for the polynomial 209 ); 210 211 /** Evaluate 2D polynomial (double precision) */ 212 double psDPolynomial2DEval(double x, ///< Value x at which to evaluate 213 double y, ///< Value y at which to evaluate 214 const psDPolynomial2D* myPoly ///< Coefficients for the polynomial 215 ); 216 217 /** Evaluate 3D polynomial (double precision) */ 218 double psDPolynomial3DEval(double x, ///< Value x at which to evaluate 219 double y, ///< Value y at which to evaluate 220 double z, ///< Value z at which to evaluate 221 const psDPolynomial3D* myPoly ///< Coefficients for the polynomial 222 ); 223 224 /** Evaluate 4D polynomial (double precision) */ 225 double psDPolynomial4DEval(double w, ///< Value w at which to evaluate 226 double x, ///< Value x at which to evaluate 227 double y, ///< Value y at which to evaluate 228 double z, ///< Value z at which to evaluate 229 const psDPolynomial4D* myPoly ///< Coefficients for the polynomial 230 ); 236 /** Allocates a double-precision 1-D polynomial structure with n terms 237 * 238 * @return psPolynomial1D* new double-precision 1-D polynomial struct 239 */ 240 psDPolynomial1D* psDPolynomial1DAlloc( 241 int n ///< Number of terms 242 ); 243 244 /** Allocates a double-precision 2-D polynomial structure 245 * 246 * @return psPolynomial2D* new double-precision 2-D polynomial struct 247 */ 248 psDPolynomial2D* psDPolynomial2DAlloc( 249 int nX, ///< Number of terms in x 250 int nY ///< Number of terms in y 251 ); 252 253 /** Allocates a double-precision 3-D polynomial structure 254 * 255 * @return psPolynomial3D* new double-precision 3-D polynomial struct 256 */ 257 psDPolynomial3D* psDPolynomial3DAlloc( 258 int nX, ///< Number of terms in x 259 int nY, ///< Number of terms in y 260 int nZ ///< Number of terms in z 261 ); 262 263 /** Allocates a double-precision 4-D polynomial structure 264 * 265 * @return psPolynomial4D* new double-precision 4-D polynomial struct 266 */ 267 psDPolynomial4D* psDPolynomial4DAlloc( 268 int nW, ///< Number of terms in w 269 int nX, ///< Number of terms in x 270 int nY, ///< Number of terms in y 271 int nZ ///< Number of terms in z 272 ); 273 274 /** Evaluates a double-precision 1-D polynomial at specific coordinates. 275 * 276 * @return float result of polynomial at given location 277 */ 278 double psDPolynomial1DEval( 279 double x, ///< Value at which to evaluate 280 const psDPolynomial1D* myPoly ///< Coefficients for the polynomial 281 ); 282 283 /** Evaluates a double-precision 2-D polynomial at specific coordinates. 284 * 285 * @return float result of polynomial at given location 286 */ 287 double psDPolynomial2DEval( 288 double x, ///< Value x at which to evaluate 289 double y, ///< Value y at which to evaluate 290 const psDPolynomial2D* myPoly ///< Coefficients for the polynomial 291 ); 292 293 /** Evaluates a double-precision 3-D polynomial at specific coordinates. 294 * 295 * @return float result of polynomial at given location 296 */ 297 double psDPolynomial3DEval( 298 double x, ///< Value x at which to evaluate 299 double y, ///< Value y at which to evaluate 300 double z, ///< Value z at which to evaluate 301 const psDPolynomial3D* myPoly ///< Coefficients for the polynomial 302 ); 303 304 /** Evaluates a double-precision 4-D polynomial at specific coordinates. 305 * 306 * @return float result of polynomial at given location 307 */ 308 double psDPolynomial4DEval( 309 double w, ///< Value w at which to evaluate 310 double x, ///< Value x at which to evaluate 311 double y, ///< Value y at which to evaluate 312 double z, ///< Value z at which to evaluate 313 const psDPolynomial4D* myPoly ///< Coefficients for the polynomial 314 ); 231 315 232 316 /* \} */// End of MathGroup Functions -
trunk/psLib/src/math/psSpline.h
r1441 r1464 13 13 * @author George Gusciora, MHPCC 14 14 * 15 * @version $Revision: 1.1 8$ $Name: not supported by cvs2svn $16 * @date $Date: 2004-08- 09 23:40:55$15 * @version $Revision: 1.19 $ $Name: not supported by cvs2svn $ 16 * @date $Date: 2004-08-11 02:35:58 $ 17 17 * 18 18 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 31 31 32 32 /** Evaluate a non-normalized Gaussian with the given mean and sigma at the 33 given coordianate. Note that this is not a Gaussian deviate. The 34 evaluated Gaussian is: \f[ exp(-\frac{(x-mean)^2}{2\sigma^2}) \f] */ 35 36 float psGaussian(float x, ///< Value at which to evaluate 37 float mean, ///< Mean for the Gaussian 38 float stddev, ///< Standard deviation for the Gaussian 39 bool normal ///< Indicates whether result should be normalized 40 ); 33 * given coordianate. 34 * 35 * Note that this is not a Gaussian deviate. The evaluated Gaussian is: 36 * \f[ exp(-\frac{(x-mean)^2}{2\sigma^2}) \f] 37 * 38 * @return float value on the gaussian curve given the input parameters 39 */ 40 float psGaussian( 41 float x, ///< Value at which to evaluate 42 float mean, ///< Mean for the Gaussian 43 float stddev, ///< Standard deviation for the Gaussian 44 bool normal ///< Indicates whether result should be normalized 45 ); 41 46 42 47 /** Produce a vector of random numbers from a Gaussian distribution with 43 the specified mean and sigma */ 44 psVector* psGaussianDev(float mean, ///< The mean of the Gaussian 45 float sigma, ///< The sigma of the Gaussian 46 int Npts); ///< The size of the vector 48 * the specified mean and sigma 49 * 50 * @return psVector* vector of random numbers 51 * 52 */ 53 psVector* psGaussianDev( 54 float mean, ///< The mean of the Gaussian 55 float sigma, ///< The sigma of the Gaussian 56 int Npts ///< The size of the vector 57 ); 47 58 48 59 /** One-dimensional polynomial */ 49 60 typedef struct 50 61 { 51 int n; ///< Number of terms52 float *coeff; ///< Coefficients53 float *coeffErr; ///< Error in coefficients54 char *mask; ///< Coefficient mask62 int n; ///< Number of terms 63 float *coeff; ///< Coefficients 64 float *coeffErr; ///< Error in coefficients 65 char *mask; ///< Coefficient mask 55 66 } 56 67 psPolynomial1D; … … 59 70 typedef struct 60 71 { 61 int nX ,62 nY; ///< Number of terms in x andy63 float **coeff; ///< Coefficients64 float **coeffErr; ///< Error in coefficients65 char **mask; ///< Coefficients mask72 int nX; ///< Number of terms in x 73 int nY; ///< Number of terms in y 74 float **coeff; ///< Coefficients 75 float **coeffErr; ///< Error in coefficients 76 char **mask; ///< Coefficients mask 66 77 } 67 78 psPolynomial2D; … … 70 81 typedef struct 71 82 { 72 int nX ,73 nY,74 nZ; ///< Number of terms in x, y andz75 float ***coeff; ///< Coefficients76 float ***coeffErr; ///< Error in coefficients77 char ***mask; ///< Coefficients mask83 int nX; ///< Number of terms in x 84 int nY; ///< Number of terms in y 85 int nZ; ///< Number of terms in z 86 float ***coeff; ///< Coefficients 87 float ***coeffErr; ///< Error in coefficients 88 char ***mask; ///< Coefficients mask 78 89 } 79 90 psPolynomial3D; … … 82 93 typedef struct 83 94 { 84 int nW ,85 nX,86 nY,87 nZ; ///< Number of terms in w, x, y andz88 float ****coeff; ///< Coefficients89 float ****coeffErr; ///< Error in coefficients90 char ****mask; ///< Coefficients mask95 int nW; ///< Number of terms in w 96 int nX; ///< Number of terms in x 97 int nY; ///< Number of terms in y 98 int nZ; ///< Number of terms in z 99 float ****coeff; ///< Coefficients 100 float ****coeffErr; ///< Error in coefficients 101 char ****mask; ///< Coefficients mask 91 102 } 92 103 psPolynomial4D; 93 104 94 /** Functions **************************************************************/ 95 96 /** Constructor */ 97 psPolynomial1D* psPolynomial1DAlloc(int n ///< Number of terms 98 ); 99 100 /** Constructor */ 101 psPolynomial2D* psPolynomial2DAlloc(int nX, int nY ///< Number of terms in x and y 102 ); 103 104 /** Constructor */ 105 psPolynomial3D* psPolynomial3DAlloc(int nX, int nY, int nZ ///< Number of terms in x, y and z 106 ); 107 108 /** Constructor */ 109 psPolynomial4D* psPolynomial4DAlloc(int nW, int nX, int nY, int nZ ///< Number of terms in w, x, y and 110 // z 111 ); 112 113 /** Evaluate 1D polynomial */ 114 float psPolynomial1DEval(float x, ///< Value at which to evaluate 115 const psPolynomial1D* myPoly ///< Coefficients for the polynomial 116 ); 117 118 /** Evaluate 2D polynomial */ 119 float psPolynomial2DEval(float x, ///< Value x at which to evaluate 120 float y, ///< Value y at which to evaluate 121 const psPolynomial2D* myPoly ///< Coefficients for the polynomial 122 ); 123 124 /** Evaluate 3D polynomial */ 125 float psPolynomial3DEval(float x, ///< Value x at which to evaluate 126 float y, ///< Value y at which to evaluate 127 float z, ///< Value z at which to evaluate 128 const psPolynomial3D* myPoly ///< Coefficients for the polynomial 129 ); 130 131 /** Evaluate 4D polynomial */ 132 float psPolynomial4DEval(float w, ///< Value w at which to evaluate 133 float x, ///< Value x at which to evaluate 134 float y, ///< Value y at which to evaluate 135 float z, ///< Value z at which to evaluate 136 const psPolynomial4D* myPoly ///< Coefficients for the polynomial 137 ); 105 106 /** Allocates a psPolynomial1D structure with n terms 107 * 108 * @return psPolynomial1D* new 1-D polynomial struct 109 */ 110 psPolynomial1D* psPolynomial1DAlloc( 111 int n ///< Number of terms 112 ); 113 114 /** Allocates a 2-D polynomial structure 115 * 116 * @return psPolynomial2D* new 2-D polynomial struct 117 */ 118 psPolynomial2D* psPolynomial2DAlloc( 119 int nX, ///< Number of terms in x 120 int nY ///< Number of terms in y 121 ); 122 123 /** Allocates a 3-D polynomial structure 124 * 125 * @return psPolynomial3D* new 3-D polynomial struct 126 */ 127 psPolynomial3D* psPolynomial3DAlloc( 128 int nX, ///< Number of terms in x 129 int nY, ///< Number of terms in y 130 int nZ ///< Number of terms in z 131 ); 132 133 /** Allocates a 4-D polynomial structure 134 * 135 * @return psPolynomial4D* new 4-D polynomial struct 136 */ 137 psPolynomial4D* psPolynomial4DAlloc( 138 int nW, ///< Number of terms in w 139 int nX, ///< Number of terms in x 140 int nY, ///< Number of terms in y 141 int nZ ///< Number of terms in z 142 ); 143 144 /** Evaluates a 1-D polynomial at specific coordinates. 145 * 146 * @return float result of polynomial at given location 147 */ 148 float psPolynomial1DEval( 149 float x, ///< location at which to evaluate 150 const psPolynomial1D* myPoly ///< Coefficients for the polynomial 151 ); 152 153 /** Evaluates a 2-D polynomial at specific coordinates. 154 * 155 * @return float result of polynomial at given location 156 */ 157 float psPolynomial2DEval( 158 float x, ///< x location at which to evaluate 159 float y, ///< y location at which to evaluate 160 const psPolynomial2D* myPoly ///< Coefficients for the polynomial 161 ); 162 163 /** Evaluates a 3-D polynomial at specific coordinates. 164 * 165 * @return float result of polynomial at given location 166 */ 167 float psPolynomial3DEval( 168 float x, ///< x location at which to evaluate 169 float y, ///< y location at which to evaluate 170 float z, ///< z location at which to evaluate 171 const psPolynomial3D* myPoly ///< Coefficients for the polynomial 172 ); 173 174 /** Evaluates a 4-D polynomial at specific coordinates. 175 * 176 * @return float result of polynomial at given location 177 */ 178 float psPolynomial4DEval( 179 float w, ///< w location at which to evaluate 180 float x, ///< x location at which to evaluate 181 float y, ///< y location at which to evaluate 182 float z, ///< z location at which to evaluate 183 const psPolynomial4D* myPoly ///< Coefficients for the polynomial 184 ); 138 185 139 186 /*****************************************************************************/ … … 144 191 typedef struct 145 192 { 146 int n; ///< Number of terms147 double *coeff; ///< Coefficients148 double *coeffErr; ///< Error in coefficients149 char *mask; ///< Coefficient mask193 int n; ///< Number of terms 194 double *coeff; ///< Coefficients 195 double *coeffErr; ///< Error in coefficients 196 char *mask; ///< Coefficient mask 150 197 } 151 198 psDPolynomial1D; … … 154 201 typedef struct 155 202 { 156 int nX ,157 nY; ///< Number of terms in x andy158 double **coeff; ///< Coefficients159 double **coeffErr; ///< Error in coefficients160 char **mask; ///< Coefficients mask203 int nX; ///< Number of terms in x 204 int nY; ///< Number of terms in y 205 double **coeff; ///< Coefficients 206 double **coeffErr; ///< Error in coefficients 207 char **mask; ///< Coefficients mask 161 208 } 162 209 psDPolynomial2D; … … 165 212 typedef struct 166 213 { 167 int nX ,168 nY,169 nZ; ///< Number of terms in x, y andz170 double ***coeff; ///< Coefficients171 double ***coeffErr; ///< Error in coefficients172 char ***mask; ///< Coefficient mask214 int nX; ///< Number of terms in x 215 int nY; ///< Number of terms in y 216 int nZ; ///< Number of terms in z 217 double ***coeff; ///< Coefficients 218 double ***coeffErr; ///< Error in coefficients 219 char ***mask; ///< Coefficient mask 173 220 } 174 221 psDPolynomial3D; … … 177 224 typedef struct 178 225 { 179 int nW ,180 nX,181 nY,182 nZ; ///< Number of terms in w, x, y andz183 double ****coeff; ///< Coefficients184 double ****coeffErr; ///< Error in coefficients185 char ****mask; ///< Coefficients mask226 int nW; ///< Number of terms in w 227 int nX; ///< Number of terms in x 228 int nY; ///< Number of terms in y 229 int nZ; ///< Number of terms in z 230 double ****coeff; ///< Coefficients 231 double ****coeffErr; ///< Error in coefficients 232 char ****mask; ///< Coefficients mask 186 233 } 187 234 psDPolynomial4D; 188 235 189 /** Constructor */ 190 psDPolynomial1D* psDPolynomial1DAlloc(int n ///< Number of terms 191 ); 192 193 /** Constructor */ 194 psDPolynomial2D* psDPolynomial2DAlloc(int nX, int nY ///< Number of terms in x and y 195 ); 196 197 /** Constructor */ 198 psDPolynomial3D* psDPolynomial3DAlloc(int nX, int nY, int nZ ///< Number of terms in x, y and z 199 ); 200 201 /** Constructor */ 202 psDPolynomial4D* psDPolynomial4DAlloc(int nW, int nX, int nY, int nZ ///< Number of terms in w, x, y and 203 // z 204 ); 205 206 /** Evaluate 1D polynomial (double precision) */ 207 double psDPolynomial1DEval(double x, ///< Value at which to evaluate 208 const psDPolynomial1D* myPoly ///< Coefficients for the polynomial 209 ); 210 211 /** Evaluate 2D polynomial (double precision) */ 212 double psDPolynomial2DEval(double x, ///< Value x at which to evaluate 213 double y, ///< Value y at which to evaluate 214 const psDPolynomial2D* myPoly ///< Coefficients for the polynomial 215 ); 216 217 /** Evaluate 3D polynomial (double precision) */ 218 double psDPolynomial3DEval(double x, ///< Value x at which to evaluate 219 double y, ///< Value y at which to evaluate 220 double z, ///< Value z at which to evaluate 221 const psDPolynomial3D* myPoly ///< Coefficients for the polynomial 222 ); 223 224 /** Evaluate 4D polynomial (double precision) */ 225 double psDPolynomial4DEval(double w, ///< Value w at which to evaluate 226 double x, ///< Value x at which to evaluate 227 double y, ///< Value y at which to evaluate 228 double z, ///< Value z at which to evaluate 229 const psDPolynomial4D* myPoly ///< Coefficients for the polynomial 230 ); 236 /** Allocates a double-precision 1-D polynomial structure with n terms 237 * 238 * @return psPolynomial1D* new double-precision 1-D polynomial struct 239 */ 240 psDPolynomial1D* psDPolynomial1DAlloc( 241 int n ///< Number of terms 242 ); 243 244 /** Allocates a double-precision 2-D polynomial structure 245 * 246 * @return psPolynomial2D* new double-precision 2-D polynomial struct 247 */ 248 psDPolynomial2D* psDPolynomial2DAlloc( 249 int nX, ///< Number of terms in x 250 int nY ///< Number of terms in y 251 ); 252 253 /** Allocates a double-precision 3-D polynomial structure 254 * 255 * @return psPolynomial3D* new double-precision 3-D polynomial struct 256 */ 257 psDPolynomial3D* psDPolynomial3DAlloc( 258 int nX, ///< Number of terms in x 259 int nY, ///< Number of terms in y 260 int nZ ///< Number of terms in z 261 ); 262 263 /** Allocates a double-precision 4-D polynomial structure 264 * 265 * @return psPolynomial4D* new double-precision 4-D polynomial struct 266 */ 267 psDPolynomial4D* psDPolynomial4DAlloc( 268 int nW, ///< Number of terms in w 269 int nX, ///< Number of terms in x 270 int nY, ///< Number of terms in y 271 int nZ ///< Number of terms in z 272 ); 273 274 /** Evaluates a double-precision 1-D polynomial at specific coordinates. 275 * 276 * @return float result of polynomial at given location 277 */ 278 double psDPolynomial1DEval( 279 double x, ///< Value at which to evaluate 280 const psDPolynomial1D* myPoly ///< Coefficients for the polynomial 281 ); 282 283 /** Evaluates a double-precision 2-D polynomial at specific coordinates. 284 * 285 * @return float result of polynomial at given location 286 */ 287 double psDPolynomial2DEval( 288 double x, ///< Value x at which to evaluate 289 double y, ///< Value y at which to evaluate 290 const psDPolynomial2D* myPoly ///< Coefficients for the polynomial 291 ); 292 293 /** Evaluates a double-precision 3-D polynomial at specific coordinates. 294 * 295 * @return float result of polynomial at given location 296 */ 297 double psDPolynomial3DEval( 298 double x, ///< Value x at which to evaluate 299 double y, ///< Value y at which to evaluate 300 double z, ///< Value z at which to evaluate 301 const psDPolynomial3D* myPoly ///< Coefficients for the polynomial 302 ); 303 304 /** Evaluates a double-precision 4-D polynomial at specific coordinates. 305 * 306 * @return float result of polynomial at given location 307 */ 308 double psDPolynomial4DEval( 309 double w, ///< Value w at which to evaluate 310 double x, ///< Value x at which to evaluate 311 double y, ///< Value y at which to evaluate 312 double z, ///< Value z at which to evaluate 313 const psDPolynomial4D* myPoly ///< Coefficients for the polynomial 314 ); 231 315 232 316 /* \} */// End of MathGroup Functions
Note:
See TracChangeset
for help on using the changeset viewer.
