Changeset 1722 for trunk/psLib/src/math/psPolynomial.h
- Timestamp:
- Sep 7, 2004, 8:11:14 PM (22 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/math/psPolynomial.h (modified) (20 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/math/psPolynomial.h
r1464 r1722 1 2 1 /** @file psFunctions.h 3 2 * \brief Standard Mathematical Functions. … … 13 12 * @author George Gusciora, MHPCC 14 13 * 15 * @version $Revision: 1. 19$ $Name: not supported by cvs2svn $16 * @date $Date: 2004-0 8-11 02:35:58$14 * @version $Revision: 1.20 $ $Name: not supported by cvs2svn $ 15 * @date $Date: 2004-09-08 06:04:10 $ 17 16 * 18 17 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 57 56 ); 58 57 58 typedef enum { 59 PS_POLYNOMIAL_ORD, ///< Ordinary Polynomial 60 PS_POLYNOMIAL_CHEB ///< Chebyshev Polynomial 61 } psPolynomialType; 62 59 63 /** One-dimensional polynomial */ 60 64 typedef struct 61 65 { 66 psPolynomialType type; ///< Polynomial type 62 67 int n; ///< Number of terms 63 68 float *coeff; ///< Coefficients … … 70 75 typedef struct 71 76 { 77 psPolynomialType type; ///< Polynomial type 72 78 int nX; ///< Number of terms in x 73 79 int nY; ///< Number of terms in y … … 81 87 typedef struct 82 88 { 89 psPolynomialType type; ///< Polynomial type 83 90 int nX; ///< Number of terms in x 84 91 int nY; ///< Number of terms in y … … 93 100 typedef struct 94 101 { 102 psPolynomialType type; ///< Polynomial type 95 103 int nW; ///< Number of terms in w 96 104 int nX; ///< Number of terms in x … … 109 117 */ 110 118 psPolynomial1D* psPolynomial1DAlloc( 111 int n ///< Number of terms 119 int n, ///< Number of terms 120 psPolynomialType type ///< Polynomial Type 112 121 ); 113 122 … … 118 127 psPolynomial2D* psPolynomial2DAlloc( 119 128 int nX, ///< Number of terms in x 120 int nY ///< Number of terms in y 129 int nY, ///< Number of terms in y 130 psPolynomialType type ///< Polynomial Type 121 131 ); 122 132 … … 128 138 int nX, ///< Number of terms in x 129 139 int nY, ///< Number of terms in y 130 int nZ ///< Number of terms in z 140 int nZ, ///< Number of terms in z 141 psPolynomialType type ///< Polynomial Type 131 142 ); 132 143 … … 139 150 int nX, ///< Number of terms in x 140 151 int nY, ///< Number of terms in y 141 int nZ ///< Number of terms in z 152 int nZ, ///< Number of terms in z 153 psPolynomialType type ///< Polynomial Type 142 154 ); 143 155 … … 184 196 ); 185 197 198 psVector *psPolynomial1DEvalVector(const psVector *x, ///< x locations at which to evaluate 199 const psPolynomial1D *myPoly ///< Coefficients for the polynomial 200 ); 201 202 psVector *psPolynomial2DEvalVector(const psVector *x, ///< x locations at which to evaluate 203 const psVector *y, ///< y locations at which to evaluate 204 const psPolynomial2D *myPoly ///< Coefficients for the polynomial 205 ); 206 207 psVector *psPolynomial3DEvalVector(const psVector *x, ///< x locations at which to evaluate 208 const psVector *y, ///< y locations at which to evaluate 209 const psVector *z, ///< z locations at which to evaluate 210 const psPolynomial3D *myPoly ///< Coefficients for the polynomial 211 ); 212 213 psVector *psPolynomial4DEvalVector(const psVector *w, ///< w locations at which to evaluate 214 const psVector *x, ///< x locations at which to evaluate 215 const psVector *y, ///< y locations at which to evaluate 216 const psVector *z, ///< z locations at which to evaluate 217 const psPolynomial4D *myPoly ///< Coefficients for the polynomial 218 ); 219 186 220 /*****************************************************************************/ 187 221 … … 191 225 typedef struct 192 226 { 227 psPolynomialType type; ///< Polynomial type 193 228 int n; ///< Number of terms 194 229 double *coeff; ///< Coefficients … … 201 236 typedef struct 202 237 { 238 psPolynomialType type; ///< Polynomial type 203 239 int nX; ///< Number of terms in x 204 240 int nY; ///< Number of terms in y … … 212 248 typedef struct 213 249 { 250 psPolynomialType type; ///< Polynomial type 214 251 int nX; ///< Number of terms in x 215 252 int nY; ///< Number of terms in y … … 224 261 typedef struct 225 262 { 263 psPolynomialType type; ///< Polynomial type 226 264 int nW; ///< Number of terms in w 227 265 int nX; ///< Number of terms in x … … 239 277 */ 240 278 psDPolynomial1D* psDPolynomial1DAlloc( 241 int n ///< Number of terms 279 int n, ///< Number of terms 280 psPolynomialType type ///< Polynomial Type 242 281 ); 243 282 … … 248 287 psDPolynomial2D* psDPolynomial2DAlloc( 249 288 int nX, ///< Number of terms in x 250 int nY ///< Number of terms in y 289 int nY, ///< Number of terms in y 290 psPolynomialType type ///< Polynomial Type 251 291 ); 252 292 … … 258 298 int nX, ///< Number of terms in x 259 299 int nY, ///< Number of terms in y 260 int nZ ///< Number of terms in z 300 int nZ, ///< Number of terms in z 301 psPolynomialType type ///< Polynomial Type 261 302 ); 262 303 … … 269 310 int nX, ///< Number of terms in x 270 311 int nY, ///< Number of terms in y 271 int nZ ///< Number of terms in z 312 int nZ, ///< Number of terms in z 313 psPolynomialType type ///< Polynomial Type 272 314 ); 273 315 … … 314 356 ); 315 357 358 psVector *psDPolynomial1DEvalVector(const psVector *x, ///< x locations at which to evaluate 359 const psDPolynomial1D *myPoly ///< Coefficients for the polynomial 360 ); 361 362 psVector *psDPolynomial2DEvalVector(const psVector *x, ///< x locations at which to evaluate 363 const psVector *y, ///< y locations at which to evaluate 364 const psDPolynomial2D *myPoly ///< Coefficients for the polynomial 365 ); 366 367 psVector *psDPolynomial3DEvalVector(const psVector *x, ///< x locations at which to evaluate 368 const psVector *y, ///< y locations at which to evaluate 369 const psVector *z, ///< z locations at which to evaluate 370 const psDPolynomial3D *myPoly ///< Coefficients for the polynomial 371 ); 372 373 psVector *psDPolynomial4DEvalVector(const psVector *w, ///< w locations at which to evaluate 374 const psVector *x, ///< x locations at which to evaluate 375 const psVector *y, ///< y locations at which to evaluate 376 const psVector *z, ///< z locations at which to evaluate 377 const psDPolynomial4D *myPoly ///< Coefficients for the polynomial 378 ); 379 380 381 382 typedef struct 383 { 384 int n; 385 psPolynomial1D **spline; 386 float *domains; 387 } 388 psSpline1D; 389 390 psSpline1D *psSpline1DAlloc(int n, 391 int order, 392 float min, 393 float max); 394 395 psSpline1D *psSpline1DAllocGeneric(const psVector *bounds, 396 int order); 397 398 float psSpline1DEval(const psSpline1D *spline, 399 float x); 400 401 psVector *psSpline1DEvalVector(const psVector *x, 402 const psSpline1D *spline); 403 316 404 /* \} */// End of MathGroup Functions 317 405
Note:
See TracChangeset
for help on using the changeset viewer.
