Changeset 2788 for trunk/psLib/src/math/psPolynomial.h
- Timestamp:
- Dec 21, 2004, 7:09:32 PM (22 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/math/psPolynomial.h (modified) (16 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/math/psPolynomial.h
r2600 r2788 12 12 * @author GLG, MHPCC 13 13 * 14 * @version $Revision: 1.3 7$ $Name: not supported by cvs2svn $15 * @date $Date: 2004-12- 02 21:12:51$14 * @version $Revision: 1.38 $ $Name: not supported by cvs2svn $ 15 * @date $Date: 2004-12-22 05:09:32 $ 16 16 * 17 17 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 39 39 * \f[ exp(-\frac{(x-mean)^2}{2\sigma^2}) \f] 40 40 * 41 * @return floatvalue on the gaussian curve given the input parameters42 */ 43 floatpsGaussian(44 floatx, ///< Value at which to evaluate45 floatmean, ///< Mean for the Gaussian46 floatstddev, ///< Standard deviation for the Gaussian41 * @return psF32 value on the gaussian curve given the input parameters 42 */ 43 psF32 psGaussian( 44 psF32 x, ///< Value at which to evaluate 45 psF32 mean, ///< Mean for the Gaussian 46 psF32 stddev, ///< Standard deviation for the Gaussian 47 47 psBool normal ///< Indicates whether result should be normalized 48 48 ); … … 55 55 */ 56 56 psVector* p_psGaussianDev( 57 floatmean, ///< The mean of the Gaussian58 floatsigma, ///< The sigma of the Gaussian57 psF32 mean, ///< The mean of the Gaussian 58 psF32 sigma, ///< The sigma of the Gaussian 59 59 psS32 Npts ///< The size of the vector 60 60 ); … … 70 70 psPolynomialType type; ///< Polynomial type 71 71 psS32 n; ///< Number of terms 72 float*coeff; ///< Coefficients73 float*coeffErr; ///< Error in coefficients74 char*mask; ///< Coefficient mask72 psF32 *coeff; ///< Coefficients 73 psF32 *coeffErr; ///< Error in coefficients 74 psU8 *mask; ///< Coefficient mask 75 75 } 76 76 psPolynomial1D; … … 82 82 psS32 nX; ///< Number of terms in x 83 83 psS32 nY; ///< Number of terms in y 84 float**coeff; ///< Coefficients85 float**coeffErr; ///< Error in coefficients86 char**mask; ///< Coefficients mask84 psF32 **coeff; ///< Coefficients 85 psF32 **coeffErr; ///< Error in coefficients 86 psU8 **mask; ///< Coefficients mask 87 87 } 88 88 psPolynomial2D; … … 95 95 psS32 nY; ///< Number of terms in y 96 96 psS32 nZ; ///< Number of terms in z 97 float***coeff; ///< Coefficients98 float***coeffErr; ///< Error in coefficients99 char***mask; ///< Coefficients mask97 psF32 ***coeff; ///< Coefficients 98 psF32 ***coeffErr; ///< Error in coefficients 99 psU8 ***mask; ///< Coefficients mask 100 100 } 101 101 psPolynomial3D; … … 109 109 psS32 nY; ///< Number of terms in y 110 110 psS32 nZ; ///< Number of terms in z 111 float****coeff; ///< Coefficients112 float****coeffErr; ///< Error in coefficients113 char****mask; ///< Coefficients mask111 psF32 ****coeff; ///< Coefficients 112 psF32 ****coeffErr; ///< Error in coefficients 113 psU8 ****mask; ///< Coefficients mask 114 114 } 115 115 psPolynomial4D; … … 160 160 /** Evaluates a 1-D polynomial at specific coordinates. 161 161 * 162 * @return floatresult of polynomial at given location163 */ 164 floatpsPolynomial1DEval(162 * @return psF32 result of polynomial at given location 163 */ 164 psF32 psPolynomial1DEval( 165 165 const psPolynomial1D* myPoly, ///< Coefficients for the polynomial 166 floatx ///< location at which to evaluate166 psF32 x ///< location at which to evaluate 167 167 ); 168 168 169 169 /** Evaluates a 2-D polynomial at specific coordinates. 170 170 * 171 * @return floatresult of polynomial at given location172 */ 173 floatpsPolynomial2DEval(171 * @return psF32 result of polynomial at given location 172 */ 173 psF32 psPolynomial2DEval( 174 174 const psPolynomial2D* myPoly, ///< Coefficients for the polynomial 175 floatx, ///< x location at which to evaluate176 floaty ///< y location at which to evaluate175 psF32 x, ///< x location at which to evaluate 176 psF32 y ///< y location at which to evaluate 177 177 ); 178 178 179 179 /** Evaluates a 3-D polynomial at specific coordinates. 180 180 * 181 * @return floatresult of polynomial at given location182 */ 183 floatpsPolynomial3DEval(181 * @return psF32 result of polynomial at given location 182 */ 183 psF32 psPolynomial3DEval( 184 184 const psPolynomial3D* myPoly, ///< Coefficients for the polynomial 185 floatx, ///< x location at which to evaluate186 floaty, ///< y location at which to evaluate187 floatz ///< z location at which to evaluate185 psF32 x, ///< x location at which to evaluate 186 psF32 y, ///< y location at which to evaluate 187 psF32 z ///< z location at which to evaluate 188 188 ); 189 189 190 190 /** Evaluates a 4-D polynomial at specific coordinates. 191 191 * 192 * @return floatresult of polynomial at given location193 */ 194 floatpsPolynomial4DEval(192 * @return psF32 result of polynomial at given location 193 */ 194 psF32 psPolynomial4DEval( 195 195 const psPolynomial4D* myPoly, ///< Coefficients for the polynomial 196 floatw, ///< w location at which to evaluate197 floatx, ///< x location at which to evaluate198 floaty, ///< y location at which to evaluate199 floatz ///< z location at which to evaluate196 psF32 w, ///< w location at which to evaluate 197 psF32 x, ///< x location at which to evaluate 198 psF32 y, ///< y location at which to evaluate 199 psF32 z ///< z location at which to evaluate 200 200 ); 201 201 … … 235 235 psPolynomialType type; ///< Polynomial type 236 236 psS32 n; ///< Number of terms 237 double*coeff; ///< Coefficients238 double*coeffErr; ///< Error in coefficients239 char*mask; ///< Coefficient mask237 psF64 *coeff; ///< Coefficients 238 psF64 *coeffErr; ///< Error in coefficients 239 psU8 *mask; ///< Coefficient mask 240 240 } 241 241 psDPolynomial1D; … … 247 247 psS32 nX; ///< Number of terms in x 248 248 psS32 nY; ///< Number of terms in y 249 double**coeff; ///< Coefficients250 double**coeffErr; ///< Error in coefficients251 char**mask; ///< Coefficients mask249 psF64 **coeff; ///< Coefficients 250 psF64 **coeffErr; ///< Error in coefficients 251 psU8 **mask; ///< Coefficients mask 252 252 } 253 253 psDPolynomial2D; … … 260 260 psS32 nY; ///< Number of terms in y 261 261 psS32 nZ; ///< Number of terms in z 262 double***coeff; ///< Coefficients263 double***coeffErr; ///< Error in coefficients264 char***mask; ///< Coefficient mask262 psF64 ***coeff; ///< Coefficients 263 psF64 ***coeffErr; ///< Error in coefficients 264 psU8 ***mask; ///< Coefficient mask 265 265 } 266 266 psDPolynomial3D; … … 274 274 psS32 nY; ///< Number of terms in y 275 275 psS32 nZ; ///< Number of terms in z 276 double****coeff; ///< Coefficients277 double****coeffErr; ///< Error in coefficients278 char****mask; ///< Coefficients mask276 psF64 ****coeff; ///< Coefficients 277 psF64 ****coeffErr; ///< Error in coefficients 278 psU8 ****mask; ///< Coefficients mask 279 279 } 280 280 psDPolynomial4D; … … 324 324 /** Evaluates a double-precision 1-D polynomial at specific coordinates. 325 325 * 326 * @return floatresult of polynomial at given location327 */ 328 doublepsDPolynomial1DEval(326 * @return psF32 result of polynomial at given location 327 */ 328 psF64 psDPolynomial1DEval( 329 329 const psDPolynomial1D* myPoly, ///< Coefficients for the polynomial 330 doublex ///< Value at which to evaluate330 psF64 x ///< Value at which to evaluate 331 331 ); 332 332 333 333 /** Evaluates a double-precision 2-D polynomial at specific coordinates. 334 334 * 335 * @return floatresult of polynomial at given location336 */ 337 doublepsDPolynomial2DEval(335 * @return psF32 result of polynomial at given location 336 */ 337 psF64 psDPolynomial2DEval( 338 338 const psDPolynomial2D* myPoly, ///< Coefficients for the polynomial 339 doublex, ///< Value x at which to evaluate340 doubley ///< Value y at which to evaluate339 psF64 x, ///< Value x at which to evaluate 340 psF64 y ///< Value y at which to evaluate 341 341 ); 342 342 343 343 /** Evaluates a double-precision 3-D polynomial at specific coordinates. 344 344 * 345 * @return floatresult of polynomial at given location346 */ 347 doublepsDPolynomial3DEval(345 * @return psF32 result of polynomial at given location 346 */ 347 psF64 psDPolynomial3DEval( 348 348 const psDPolynomial3D* myPoly, ///< Coefficients for the polynomial 349 doublex, ///< Value x at which to evaluate350 doubley, ///< Value y at which to evaluate351 doublez ///< Value z at which to evaluate349 psF64 x, ///< Value x at which to evaluate 350 psF64 y, ///< Value y at which to evaluate 351 psF64 z ///< Value z at which to evaluate 352 352 ); 353 353 354 354 /** Evaluates a double-precision 4-D polynomial at specific coordinates. 355 355 * 356 * @return floatresult of polynomial at given location357 */ 358 doublepsDPolynomial4DEval(356 * @return psF32 result of polynomial at given location 357 */ 358 psF64 psDPolynomial4DEval( 359 359 const psDPolynomial4D* myPoly, ///< Coefficients for the polynomial 360 doublew, ///< Value w at which to evaluate361 doublex, ///< Value x at which to evaluate362 doubley, ///< Value y at which to evaluate363 doublez ///< Value z at which to evaluate360 psF64 w, ///< Value w at which to evaluate 361 psF64 x, ///< Value x at which to evaluate 362 psF64 y, ///< Value y at which to evaluate 363 psF64 z ///< Value z at which to evaluate 364 364 ); 365 365 … … 396 396 psS32 n; ///< The number of spline polynomials 397 397 psPolynomial1D **spline; ///< An array of n pointers to the spline polynomials 398 float*p_psDeriv2; ///< For cubic splines, the second derivative at each domain point. Size is n+1.399 float*domains; ///< The boundaries between each spline piece. Size is n+1.398 psF32 *p_psDeriv2; ///< For cubic splines, the second derivative at each domain point. Size is n+1. 399 psF32 *domains; ///< The boundaries between each spline piece. Size is n+1. 400 400 } 401 401 psSpline1D; … … 403 403 psSpline1D *psSpline1DAlloc(psS32 n, 404 404 psS32 order, 405 floatmin,406 floatmax);405 psF32 min, 406 psF32 max); 407 407 408 408 psSpline1D *psSpline1DAllocGeneric(const psVector *bounds, 409 409 psS32 order); 410 410 411 floatpsSpline1DEval(412 floatx,411 psF32 psSpline1DEval( 412 psF32 x, 413 413 const psSpline1D *spline 414 414 ); … … 427 427 psScalar *x); 428 428 429 floatp_psNRSpline1DEval(psSpline1D *spline,429 psF32 p_psNRSpline1DEval(psSpline1D *spline, 430 430 const psVector* restrict x, 431 431 const psVector* restrict y, 432 floatX);432 psF32 X); 433 433 434 434 /* \} */// End of MathGroup Functions
Note:
See TracChangeset
for help on using the changeset viewer.
