Changeset 1722
- Timestamp:
- Sep 7, 2004, 8:11:14 PM (22 years ago)
- Location:
- trunk/psLib
- Files:
-
- 8 edited
-
src/dataManip/psStats.c (modified) (4 diffs)
-
src/math/psPolynomial.h (modified) (20 diffs)
-
src/math/psSpline.h (modified) (20 diffs)
-
src/math/psStats.c (modified) (4 diffs)
-
src/sys/psTrace.h (modified) (2 diffs)
-
src/sysUtils/psTrace.h (modified) (2 diffs)
-
test/dataManip/tst_psFunc00.c (modified) (8 diffs)
-
test/dataManip/tst_psMinimize04.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/dataManip/psStats.c
r1440 r1722 1 2 1 /** @file psStats.c 3 2 * \brief basic statistical operations … … 10 9 * @author George Gusciora, MHPCC 11 10 * 12 * @version $Revision: 1.5 3$ $Name: not supported by cvs2svn $13 * @date $Date: 2004-0 8-09 23:34:57$11 * @version $Revision: 1.54 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2004-09-08 06:04:30 $ 14 13 * 15 14 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 1041 1040 psVector* y = psVectorAlloc(3, PS_TYPE_F64); 1042 1041 psVector* yErr = psVectorAlloc(3, PS_TYPE_F64); 1043 psPolynomial1D* myPoly = psPolynomial1DAlloc(2 );1042 psPolynomial1D* myPoly = psPolynomial1DAlloc(2, PS_POLYNOMIAL_ORD); 1044 1043 1045 1044 if ((binNum > 0) && (binNum < (histogram->nums->n + 1))) { … … 1132 1131 psVector* y = psVectorAlloc(3, PS_TYPE_F64); 1133 1132 psVector* yErr = psVectorAlloc(3, PS_TYPE_F64); 1134 psPolynomial1D* myPoly = psPolynomial1DAlloc(2 );1133 psPolynomial1D* myPoly = psPolynomial1DAlloc(2, PS_POLYNOMIAL_ORD); 1135 1134 psVector* cumulativeRobustSumsFullRange = NULL; 1136 1135 psVector* cumulativeRobustSumsDlRange = NULL; -
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 -
trunk/psLib/src/math/psSpline.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 -
trunk/psLib/src/math/psStats.c
r1440 r1722 1 2 1 /** @file psStats.c 3 2 * \brief basic statistical operations … … 10 9 * @author George Gusciora, MHPCC 11 10 * 12 * @version $Revision: 1.5 3$ $Name: not supported by cvs2svn $13 * @date $Date: 2004-0 8-09 23:34:57$11 * @version $Revision: 1.54 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2004-09-08 06:04:30 $ 14 13 * 15 14 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 1041 1040 psVector* y = psVectorAlloc(3, PS_TYPE_F64); 1042 1041 psVector* yErr = psVectorAlloc(3, PS_TYPE_F64); 1043 psPolynomial1D* myPoly = psPolynomial1DAlloc(2 );1042 psPolynomial1D* myPoly = psPolynomial1DAlloc(2, PS_POLYNOMIAL_ORD); 1044 1043 1045 1044 if ((binNum > 0) && (binNum < (histogram->nums->n + 1))) { … … 1132 1131 psVector* y = psVectorAlloc(3, PS_TYPE_F64); 1133 1132 psVector* yErr = psVectorAlloc(3, PS_TYPE_F64); 1134 psPolynomial1D* myPoly = psPolynomial1DAlloc(2 );1133 psPolynomial1D* myPoly = psPolynomial1DAlloc(2, PS_POLYNOMIAL_ORD); 1135 1134 psVector* cumulativeRobustSumsFullRange = NULL; 1136 1135 psVector* cumulativeRobustSumsDlRange = NULL; -
trunk/psLib/src/sys/psTrace.h
r1720 r1722 9 9 * @author George Gusciora, MHPCC 10 10 * 11 * @version $Revision: 1. 19$ $Name: not supported by cvs2svn $12 * @date $Date: 2004-09-08 06:0 3:43$11 * @version $Revision: 1.20 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2004-09-08 06:07:57 $ 13 13 * 14 14 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 65 65 66 66 /// Set trace level 67 boolpsTraceSetLevel(const char *facil, ///< facilty of interest68 int level) ///< desired trace level67 int psTraceSetLevel(const char *facil, ///< facilty of interest 68 int level) ///< desired trace level 69 69 ; 70 70 -
trunk/psLib/src/sysUtils/psTrace.h
r1721 r1722 9 9 * @author George Gusciora, MHPCC 10 10 * 11 * @version $Revision: 1. 19$ $Name: not supported by cvs2svn $12 * @date $Date: 2004-09-08 06:0 3:43$11 * @version $Revision: 1.20 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2004-09-08 06:07:57 $ 13 13 * 14 14 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 65 65 66 66 /// Set trace level 67 boolpsTraceSetLevel(const char *facil, ///< facilty of interest68 int level) ///< desired trace level67 int psTraceSetLevel(const char *facil, ///< facilty of interest 68 int level) ///< desired trace level 69 69 ; 70 70 -
trunk/psLib/test/dataManip/tst_psFunc00.c
r1406 r1722 42 42 "Allocate/Deallocate the psPolynomial1D structure."); 43 43 44 my1DPoly = psPolynomial1DAlloc(AN );44 my1DPoly = psPolynomial1DAlloc(AN, PS_POLYNOMIAL_ORD); 45 45 for (a = 0; a < AN ; a++) { 46 46 my1DPoly->coeff[a] = MISC_FLOAT_NUMBER; … … 70 70 "psFunctions functions", 71 71 "Allocate/Deallocate the psPolynomial2D structure."); 72 my2DPoly = psPolynomial2DAlloc(AN, BN );72 my2DPoly = psPolynomial2DAlloc(AN, BN, PS_POLYNOMIAL_ORD); 73 73 for (a = 0; a < AN ; a++) { 74 74 for (b = 0; b < BN ; b++) { … … 98 98 "psFunctions functions", 99 99 "Allocate/Deallocate the psPolynomial3D structure."); 100 my3DPoly = psPolynomial3DAlloc(AN, BN, CN );100 my3DPoly = psPolynomial3DAlloc(AN, BN, CN, PS_POLYNOMIAL_ORD); 101 101 for (a = 0; a < AN ; a++) { 102 102 for (b = 0; b < BN ; b++) { … … 130 130 "psFunctions functions", 131 131 "Allocate/Deallocate the psPolynomial4D structure."); 132 my4DPoly = psPolynomial4DAlloc(AN, BN, CN, DN );132 my4DPoly = psPolynomial4DAlloc(AN, BN, CN, DN, PS_POLYNOMIAL_ORD); 133 133 for (a = 0; a < AN ; a++) { 134 134 for (b = 0; b < BN ; b++) { … … 167 167 "Allocate/Deallocate the psDPolynomial1D structure."); 168 168 169 my1DPolyD = psDPolynomial1DAlloc(AN );169 my1DPolyD = psDPolynomial1DAlloc(AN, PS_POLYNOMIAL_ORD); 170 170 for (a = 0; a < AN ; a++) { 171 171 my1DPolyD->coeff[a] = MISC_FLOAT_NUMBER; … … 191 191 "psFunctions functions", 192 192 "Allocate/Deallocate the psDPolynomial2D structure."); 193 my2DPolyD = psDPolynomial2DAlloc(AN, BN );193 my2DPolyD = psDPolynomial2DAlloc(AN, BN, PS_POLYNOMIAL_ORD); 194 194 for (a = 0; a < AN ; a++) { 195 195 for (b = 0; b < BN ; b++) { … … 219 219 "psFunctions functions", 220 220 "Allocate/Deallocate the psDPolynomial3D structure."); 221 my3DPolyD = psDPolynomial3DAlloc(AN, BN, CN );221 my3DPolyD = psDPolynomial3DAlloc(AN, BN, CN, PS_POLYNOMIAL_ORD); 222 222 for (a = 0; a < AN ; a++) { 223 223 for (b = 0; b < BN ; b++) { … … 251 251 "psFunctions functions", 252 252 "Allocate/Deallocate the psDPolynomial4D structure."); 253 my4DPolyD = psDPolynomial4DAlloc(AN, BN, CN, DN );253 my4DPolyD = psDPolynomial4DAlloc(AN, BN, CN, DN, PS_POLYNOMIAL_ORD); 254 254 for (a = 0; a < AN ; a++) { 255 255 for (b = 0; b < BN ; b++) { -
trunk/psLib/test/dataManip/tst_psMinimize04.c
r1406 r1722 33 33 int memLeaks = 0; 34 34 35 myPoly = psPolynomial1DAlloc(POLY_ORDER+1 );35 myPoly = psPolynomial1DAlloc(POLY_ORDER+1, PS_POLYNOMIAL_ORD); 36 36 x = psVectorAlloc(NUM_DATA, PS_TYPE_F64); 37 37 y = psVectorAlloc(NUM_DATA, PS_TYPE_F64);
Note:
See TracChangeset
for help on using the changeset viewer.
