Changeset 4162 for trunk/psLib/src/math
- Timestamp:
- Jun 8, 2005, 1:40:46 PM (21 years ago)
- Location:
- trunk/psLib/src/math
- Files:
-
- 13 edited
-
psBinaryOp.h (modified) (3 diffs)
-
psCompare.h (modified) (44 diffs)
-
psConstants.h (modified) (3 diffs)
-
psMatrix.h (modified) (3 diffs)
-
psMinimize.h (modified) (4 diffs)
-
psPolynomial.c (modified) (2 diffs)
-
psPolynomial.h (modified) (4 diffs)
-
psRandom.h (modified) (2 diffs)
-
psSpline.c (modified) (2 diffs)
-
psSpline.h (modified) (4 diffs)
-
psStats.c (modified) (5 diffs)
-
psStats.h (modified) (7 diffs)
-
psUnaryOp.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/math/psBinaryOp.h
r3182 r4162 1 2 1 /** @file psBinaryOp.h 3 2 * … … 31 30 * @author Robert DeSonia, MHPCC 32 31 * 33 * @version $Revision: 1. 1$ $Name: not supported by cvs2svn $34 * @date $Date: 2005-0 2-10 02:36:41$32 * @version $Revision: 1.2 $ $Name: not supported by cvs2svn $ 33 * @date $Date: 2005-06-08 23:40:45 $ 35 34 * 36 35 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 65 64 /// @} 66 65 67 #endif 66 #endif // #ifndef PSBINARY_OP_H -
trunk/psLib/src/math/psCompare.h
r3264 r4162 6 6 * @ingroup Compare 7 7 * 8 * @version $Revision: 1. 6$ $Name: not supported by cvs2svn $9 * @date $Date: 2005-0 2-17 19:26:23$8 * @version $Revision: 1.7 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2005-06-08 23:40:45 $ 10 10 * 11 11 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii 12 12 */ 13 13 14 #if !defined(PS_COMPARE_H)14 #ifndef PS_COMPARE_H 15 15 #define PS_COMPARE_H 16 16 … … 24 24 * e.g., for psList of pointers to numeric values. 25 25 * 26 * @return int an integer less than, equal to, or greater than zero if 27 * the first argument is considered to be respectively less 28 * than, equal to, or greater than the second. 26 * @return int an integer less than, equal to, or greater than zero if 27 * the first argument is considered to be respectively less 28 * than, equal to, or greater than the second. 29 29 */ 30 30 typedef int (*psComparePtrFcn) ( … … 35 35 /** A comparison function for sorting. 36 36 * 37 * @return int an integer less than, equal to, or greater than zero if 38 * the first argument is considered to be respectively less 39 * than, equal to, or greater than the second. 37 * @return int an integer less than, equal to, or greater than zero if 38 * the first argument is considered to be respectively less 39 * than, equal to, or greater than the second. 40 40 */ 41 41 typedef int (*psCompareFcn) ( … … 46 46 /** Compare function of psS8 data. For use with psListSort. 47 47 * 48 * @return int an integer less than, equal to, or greater than zero if 49 * the first argument is considered to be respectively less 50 * than, equal to, or greater than the second. 48 * @return int an integer less than, equal to, or greater than zero if 49 * the first argument is considered to be respectively less 50 * than, equal to, or greater than the second. 51 51 */ 52 52 int psCompareS8Ptr( … … 57 57 /** Compare function of psS16 data. For use with psListSort. 58 58 * 59 * @return int an integer less than, equal to, or greater than zero if 60 * the first argument is considered to be respectively less 61 * than, equal to, or greater than the second. 59 * @return int an integer less than, equal to, or greater than zero if 60 * the first argument is considered to be respectively less 61 * than, equal to, or greater than the second. 62 62 */ 63 63 int psCompareS16Ptr( … … 68 68 /** Compare function of psS32 data. For use with psListSort. 69 69 * 70 * @return int an integer less than, equal to, or greater than zero if 71 * the first argument is considered to be respectively less 72 * than, equal to, or greater than the second. 70 * @return int an integer less than, equal to, or greater than zero if 71 * the first argument is considered to be respectively less 72 * than, equal to, or greater than the second. 73 73 */ 74 74 int psCompareS32Ptr( … … 79 79 /** Compare function of psS64 data. For use with psListSort. 80 80 * 81 * @return int an integer less than, equal to, or greater than zero if 82 * the first argument is considered to be respectively less 83 * than, equal to, or greater than the second. 81 * @return int an integer less than, equal to, or greater than zero if 82 * the first argument is considered to be respectively less 83 * than, equal to, or greater than the second. 84 84 */ 85 85 int psCompareS64Ptr( … … 90 90 /** Compare function of psU8 data. For use with psListSort. 91 91 * 92 * @return int an integer less than, equal to, or greater than zero if 93 * the first argument is considered to be respectively less 94 * than, equal to, or greater than the second. 92 * @return int an integer less than, equal to, or greater than zero if 93 * the first argument is considered to be respectively less 94 * than, equal to, or greater than the second. 95 95 */ 96 96 int psCompareU8Ptr( … … 101 101 /** Compare function of psU16 data. For use with psListSort. 102 102 * 103 * @return int an integer less than, equal to, or greater than zero if 104 * the first argument is considered to be respectively less 105 * than, equal to, or greater than the second. 103 * @return int an integer less than, equal to, or greater than zero if 104 * the first argument is considered to be respectively less 105 * than, equal to, or greater than the second. 106 106 */ 107 107 int psCompareU16Ptr( … … 112 112 /** Compare function of psU32 data. For use with psListSort. 113 113 * 114 * @return int an integer less than, equal to, or greater than zero if 115 * the first argument is considered to be respectively less 116 * than, equal to, or greater than the second. 114 * @return int an integer less than, equal to, or greater than zero if 115 * the first argument is considered to be respectively less 116 * than, equal to, or greater than the second. 117 117 */ 118 118 int psCompareU32Ptr( … … 123 123 /** Compare function of psU64 data. For use with psListSort. 124 124 * 125 * @return int an integer less than, equal to, or greater than zero if 126 * the first argument is considered to be respectively less 127 * than, equal to, or greater than the second. 125 * @return int an integer less than, equal to, or greater than zero if 126 * the first argument is considered to be respectively less 127 * than, equal to, or greater than the second. 128 128 */ 129 129 int psCompareU64Ptr( … … 134 134 /** Compare function of psF32 data. For use with psListSort. 135 135 * 136 * @return int an integer less than, equal to, or greater than zero if 137 * the first argument is considered to be respectively less 138 * than, equal to, or greater than the second. 136 * @return int an integer less than, equal to, or greater than zero if 137 * the first argument is considered to be respectively less 138 * than, equal to, or greater than the second. 139 139 */ 140 140 int psCompareF32Ptr( … … 145 145 /** Compare function of psF64 data. For use with psListSort. 146 146 * 147 * @return int an integer less than, equal to, or greater than zero if 148 * the first argument is considered to be respectively less 149 * than, equal to, or greater than the second. 147 * @return int an integer less than, equal to, or greater than zero if 148 * the first argument is considered to be respectively less 149 * than, equal to, or greater than the second. 150 150 */ 151 151 int psCompareF64Ptr( … … 156 156 /** Compare function of psS8 data. For use with psListSort for descending ordering. 157 157 * 158 * @return int an integer less than, equal to, or greater than zero if 159 * the first argument is considered to be respectively greater 160 * than, equal to, or less than the second. 158 * @return int an integer less than, equal to, or greater than zero if 159 * the first argument is considered to be respectively greater 160 * than, equal to, or less than the second. 161 161 */ 162 162 int psCompareDescendingS8Ptr( … … 167 167 /** Compare function of psS16 data. For use with psListSort for descending ordering. 168 168 * 169 * @return int an integer less than, equal to, or greater than zero if 170 * the first argument is considered to be respectively greater 171 * than, equal to, or less than the second. 169 * @return int an integer less than, equal to, or greater than zero if 170 * the first argument is considered to be respectively greater 171 * than, equal to, or less than the second. 172 172 */ 173 173 int psCompareDescendingS16Ptr( … … 178 178 /** Compare function of psS32 data. For use with psListSort for descending ordering. 179 179 * 180 * @return int an integer less than, equal to, or greater than zero if 181 * the first argument is considered to be respectively greater 182 * than, equal to, or less than the second. 180 * @return int an integer less than, equal to, or greater than zero if 181 * the first argument is considered to be respectively greater 182 * than, equal to, or less than the second. 183 183 */ 184 184 int psCompareDescendingS32Ptr( … … 189 189 /** Compare function of psS64 data. For use with psListSort for descending ordering. 190 190 * 191 * @return int an integer less than, equal to, or greater than zero if 192 * the first argument is considered to be respectively greater 193 * than, equal to, or less than the second. 191 * @return int an integer less than, equal to, or greater than zero if 192 * the first argument is considered to be respectively greater 193 * than, equal to, or less than the second. 194 194 */ 195 195 int psCompareDescendingS64Ptr( … … 200 200 /** Compare function of psU8 data. For use with psListSort for descending ordering. 201 201 * 202 * @return int an integer less than, equal to, or greater than zero if 203 * the first argument is considered to be respectively greater 204 * than, equal to, or less than the second. 202 * @return int an integer less than, equal to, or greater than zero if 203 * the first argument is considered to be respectively greater 204 * than, equal to, or less than the second. 205 205 */ 206 206 int psCompareDescendingU8Ptr( … … 211 211 /** Compare function of psU16 data. For use with psListSort for descending ordering. 212 212 * 213 * @return int an integer less than, equal to, or greater than zero if 214 * the first argument is considered to be respectively greater 215 * than, equal to, or less than the second. 213 * @return int an integer less than, equal to, or greater than zero if 214 * the first argument is considered to be respectively greater 215 * than, equal to, or less than the second. 216 216 */ 217 217 int psCompareDescendingU16Ptr( … … 222 222 /** Compare function of psU32 data. For use with psListSort for descending ordering. 223 223 * 224 * @return int an integer less than, equal to, or greater than zero if 225 * the first argument is considered to be respectively greater 226 * than, equal to, or lessg than the second. 224 * @return int an integer less than, equal to, or greater than zero if 225 * the first argument is considered to be respectively greater 226 * than, equal to, or lessg than the second. 227 227 */ 228 228 int psCompareDescendingU32Ptr( … … 233 233 /** Compare function of psU64 data. For use with psListSort for descending ordering. 234 234 * 235 * @return int an integer less than, equal to, or greater than zero if 236 * the first argument is considered to be respectively greater 237 * than, equal to, or lessg than the second. 235 * @return int an integer less than, equal to, or greater than zero if 236 * the first argument is considered to be respectively greater 237 * than, equal to, or lessg than the second. 238 238 */ 239 239 int psCompareDescendingU64Ptr( … … 244 244 /** Compare function of psF32 data. For use with psListSort for descending ordering. 245 245 * 246 * @return int an integer less than, equal to, or greater than zero if 247 * the first argument is considered to be respectively greater 248 * than, equal to, or lessg than the second. 246 * @return int an integer less than, equal to, or greater than zero if 247 * the first argument is considered to be respectively greater 248 * than, equal to, or lessg than the second. 249 249 */ 250 250 int psCompareDescendingF32Ptr( … … 255 255 /** Compare function of psF64 data. For use with psListSort for descending ordering. 256 256 * 257 * @return int an integer less than, equal to, or greater than zero if 258 * the first argument is considered to be respectively greater 259 * than, equal to, or lessg than the second. 257 * @return int an integer less than, equal to, or greater than zero if 258 * the first argument is considered to be respectively greater 259 * than, equal to, or lessg than the second. 260 260 */ 261 261 int psCompareDescendingF64Ptr( … … 266 266 /** Compare function of psS8 data. 267 267 * 268 * @return int an integer less than, equal to, or greater than zero if 269 * the first argument is considered to be respectively less 270 * than, equal to, or greater than the second. 268 * @return int an integer less than, equal to, or greater than zero if 269 * the first argument is considered to be respectively less 270 * than, equal to, or greater than the second. 271 271 */ 272 272 int psCompareS8( … … 278 278 /** Compare function of psS16 data. 279 279 * 280 * @return int an integer less than, equal to, or greater than zero if 281 * the first argument is considered to be respectively less 282 * than, equal to, or greater than the second. 280 * @return int an integer less than, equal to, or greater than zero if 281 * the first argument is considered to be respectively less 282 * than, equal to, or greater than the second. 283 283 */ 284 284 int psCompareS16( … … 290 290 /** Compare function of psS32 data. 291 291 * 292 * @return int an integer less than, equal to, or greater than zero if 293 * the first argument is considered to be respectively less 294 * than, equal to, or greater than the second. 292 * @return int an integer less than, equal to, or greater than zero if 293 * the first argument is considered to be respectively less 294 * than, equal to, or greater than the second. 295 295 */ 296 296 int psCompareS32( … … 302 302 /** Compare function of psS64 data. 303 303 * 304 * @return int an integer less than, equal to, or greater than zero if 305 * the first argument is considered to be respectively less 306 * than, equal to, or greater than the second. 304 * @return int an integer less than, equal to, or greater than zero if 305 * the first argument is considered to be respectively less 306 * than, equal to, or greater than the second. 307 307 */ 308 308 int psCompareS64( … … 314 314 /** Compare function of psU8 data. 315 315 * 316 * @return int an integer less than, equal to, or greater than zero if 317 * the first argument is considered to be respectively less 318 * than, equal to, or greater than the second. 316 * @return int an integer less than, equal to, or greater than zero if 317 * the first argument is considered to be respectively less 318 * than, equal to, or greater than the second. 319 319 */ 320 320 int psCompareU8( … … 326 326 /** Compare function of psU16 data. 327 327 * 328 * @return int an integer less than, equal to, or greater than zero if 329 * the first argument is considered to be respectively less 330 * than, equal to, or greater than the second. 328 * @return int an integer less than, equal to, or greater than zero if 329 * the first argument is considered to be respectively less 330 * than, equal to, or greater than the second. 331 331 */ 332 332 int psCompareU16( … … 338 338 /** Compare function of psU32 data. 339 339 * 340 * @return int an integer less than, equal to, or greater than zero if 341 * the first argument is considered to be respectively less 342 * than, equal to, or greater than the second. 340 * @return int an integer less than, equal to, or greater than zero if 341 * the first argument is considered to be respectively less 342 * than, equal to, or greater than the second. 343 343 */ 344 344 int psCompareU32( … … 350 350 /** Compare function of psU64 data. 351 351 * 352 * @return int an integer less than, equal to, or greater than zero if 353 * the first argument is considered to be respectively less 354 * than, equal to, or greater than the second. 352 * @return int an integer less than, equal to, or greater than zero if 353 * the first argument is considered to be respectively less 354 * than, equal to, or greater than the second. 355 355 */ 356 356 int psCompareU64( … … 362 362 /** Compare function of psF32 data. 363 363 * 364 * @return int an integer less than, equal to, or greater than zero if 365 * the first argument is considered to be respectively less 366 * than, equal to, or greater than the second. 364 * @return int an integer less than, equal to, or greater than zero if 365 * the first argument is considered to be respectively less 366 * than, equal to, or greater than the second. 367 367 */ 368 368 int psCompareF32( … … 374 374 /** Compare function of psF64 data. 375 375 * 376 * @return int an integer less than, equal to, or greater than zero if 377 * the first argument is considered to be respectively less 378 * than, equal to, or greater than the second. 376 * @return int an integer less than, equal to, or greater than zero if 377 * the first argument is considered to be respectively less 378 * than, equal to, or greater than the second. 379 379 */ 380 380 int psCompareF64( … … 386 386 /** Compare function of psS8 data. 387 387 * 388 * @return int an integer less than, equal to, or greater than zero if 389 * the first argument is considered to be respectively greater 390 * than, equal to, or less than the second. 388 * @return int an integer less than, equal to, or greater than zero if 389 * the first argument is considered to be respectively greater 390 * than, equal to, or less than the second. 391 391 */ 392 392 int psCompareDescendingS8( … … 398 398 /** Compare function of psS16 data. 399 399 * 400 * @return int an integer less than, equal to, or greater than zero if 401 * the first argument is considered to be respectively greater 402 * than, equal to, or less than the second. 400 * @return int an integer less than, equal to, or greater than zero if 401 * the first argument is considered to be respectively greater 402 * than, equal to, or less than the second. 403 403 */ 404 404 int psCompareDescendingS16( … … 410 410 /** Compare function of psS32 data. 411 411 * 412 * @return int an integer less than, equal to, or greater than zero if 413 * the first argument is considered to be respectively greater 414 * than, equal to, or less than the second. 412 * @return int an integer less than, equal to, or greater than zero if 413 * the first argument is considered to be respectively greater 414 * than, equal to, or less than the second. 415 415 */ 416 416 int psCompareDescendingS32( … … 422 422 /** Compare function of psS64 data. 423 423 * 424 * @return int an integer less than, equal to, or greater than zero if 425 * the first argument is considered to be respectively greater 426 * than, equal to, or less than the second. 424 * @return int an integer less than, equal to, or greater than zero if 425 * the first argument is considered to be respectively greater 426 * than, equal to, or less than the second. 427 427 */ 428 428 int psCompareDescendingS64( … … 434 434 /** Compare function of psU8 data. 435 435 * 436 * @return int an integer less than, equal to, or greater than zero if 437 * the first argument is considered to be respectively greater 438 * than, equal to, or less than the second. 436 * @return int an integer less than, equal to, or greater than zero if 437 * the first argument is considered to be respectively greater 438 * than, equal to, or less than the second. 439 439 */ 440 440 int psCompareDescendingU8( … … 446 446 /** Compare function of psU16 data. 447 447 * 448 * @return int an integer less than, equal to, or greater than zero if 449 * the first argument is considered to be respectively greater 450 * than, equal to, or less than the second. 448 * @return int an integer less than, equal to, or greater than zero if 449 * the first argument is considered to be respectively greater 450 * than, equal to, or less than the second. 451 451 */ 452 452 int psCompareDescendingU16( … … 458 458 /** Compare function of psU32 data. 459 459 * 460 * @return int an integer less than, equal to, or greater than zero if 461 * the first argument is considered to be respectively greater 462 * than, equal to, or less than the second. 460 * @return int an integer less than, equal to, or greater than zero if 461 * the first argument is considered to be respectively greater 462 * than, equal to, or less than the second. 463 463 */ 464 464 int psCompareDescendingU32( … … 470 470 /** Compare function of psU64 data. 471 471 * 472 * @return int an integer less than, equal to, or greater than zero if 473 * the first argument is considered to be respectively greater 474 * than, equal to, or less than the second. 472 * @return int an integer less than, equal to, or greater than zero if 473 * the first argument is considered to be respectively greater 474 * than, equal to, or less than the second. 475 475 */ 476 476 int psCompareDescendingU64( … … 482 482 /** Compare function of psF32 data. 483 483 * 484 * @return int an integer less than, equal to, or greater than zero if 485 * the first argument is considered to be respectively greater 486 * than, equal to, or less than the second. 484 * @return int an integer less than, equal to, or greater than zero if 485 * the first argument is considered to be respectively greater 486 * than, equal to, or less than the second. 487 487 */ 488 488 int psCompareDescendingF32( … … 494 494 /** Compare function of psF64 data. 495 495 * 496 * @return int an integer less than, equal to, or greater than zero if 497 * the first argument is considered to be respectively greater 498 * than, equal to, or less than the second. 496 * @return int an integer less than, equal to, or greater than zero if 497 * the first argument is considered to be respectively greater 498 * than, equal to, or less than the second. 499 499 */ 500 500 int psCompareDescendingF64( … … 506 506 /// @} 507 507 508 #endif 508 #endif // #ifndef PS_COMPARE_H -
trunk/psLib/src/math/psConstants.h
r4108 r4162 6 6 * @author GLG, MHPCC 7 7 * 8 * @version $Revision: 1.7 2$ $Name: not supported by cvs2svn $9 * @date $Date: 2005-06-0 4 00:49:48$8 * @version $Revision: 1.73 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2005-06-08 23:40:45 $ 10 10 * 11 11 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 45 45 #define M_1_PI 0.3183098861837906715377675267450287 /* 1/pi */ 46 46 #define M_2_PI 0.6366197723675813430755350534900574 /* 2/pi */ 47 #endif 48 #define PS_PI 3.1415926535897932384626433832795029 /* pi */ 47 #endif // #ifndef M_PI 49 48 50 49 #define DEG_TO_RAD(DEGREES) ((DEGREES) * M_PI / 180.0) … … 699 698 *****************************************************************************/ 700 699 #define PS_MAX(A, B) \ 701 (((A) > (B)) ? (A) : (B)) \700 (((A) > (B)) ? (A) : (B)) 702 701 703 702 #define PS_MIN(A, B) \ 704 (((A) < (B)) ? (A) : (B)) \703 (((A) < (B)) ? (A) : (B)) 705 704 706 705 #define PS_SQR(A) \ 707 ((A) * (A)) \ 708 709 #ifdef DARWIN 710 #define PS_SQRT_F32(A) ((float) sqrt(A)) 711 #else 712 #define PS_SQRT_F32(A) (sqrtf(A)) 713 #endif 706 ((A) * (A)) -
trunk/psLib/src/math/psMatrix.h
r3264 r4162 1 2 1 /** @file psMatrix.h 3 2 * … … 22 21 * @author Ross Harman, MHPCC 23 22 * 24 * @version $Revision: 1.1 5$ $Name: not supported by cvs2svn $25 * @date $Date: 2005-0 2-17 19:26:23$23 * @version $Revision: 1.16 $ $Name: not supported by cvs2svn $ 24 * @date $Date: 2005-06-08 23:40:45 $ 26 25 * 27 26 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 164 163 /// @} 165 164 166 #endif 165 #endif // #ifndef PSMATRIX_H -
trunk/psLib/src/math/psMinimize.h
r3855 r4162 8 8 * @author GLG, MHPCC 9 9 * 10 * @version $Revision: 1.4 2$ $Name: not supported by cvs2svn $11 * @date $Date: 2005-0 5-05 22:23:29$10 * @version $Revision: 1.43 $ $Name: not supported by cvs2svn $ 11 * @date $Date: 2005-06-08 23:40:45 $ 12 12 * 13 13 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 15 15 */ 16 16 17 #if !defined(PS_MINIMIZE_H)17 #ifndef PS_MINIMIZE_H 18 18 #define PS_MINIMIZE_H 19 19 … … 53 53 /** Derive a polynomial fit. 54 54 * 55 * psVectorFitPolynomial1d returns the polynomial that best fits the 56 * observations. The input parameters are a polynomial that specifies the 57 * fit order, myPoly, which will be altered and returned with the best-fit 58 * coefficients; and the observations, x, y and yErr. The independent 59 * variable list, x may be NULL, in which case the vector index is used. 60 * The dependent variable error, yErr may be null, in which case the solution 61 * is determined in the assumption that all data errors are equal. This 55 * psVectorFitPolynomial1d returns the polynomial that best fits the 56 * observations. The input parameters are a polynomial that specifies the 57 * fit order, myPoly, which will be altered and returned with the best-fit 58 * coefficients; and the observations, x, y and yErr. The independent 59 * variable list, x may be NULL, in which case the vector index is used. 60 * The dependent variable error, yErr may be null, in which case the solution 61 * is determined in the assumption that all data errors are equal. This 62 62 * function must be valid only for types psF32, psF64. 63 63 * … … 142 142 /* \} */// End of MathGroup Functions 143 143 144 #endif 144 #endif // #ifndef PS_MINIMIZE_H 145 145 -
trunk/psLib/src/math/psPolynomial.c
r4029 r4162 7 7 * polynomials. It also contains a Gaussian functions. 8 8 * 9 * @version $Revision: 1.10 4$ $Name: not supported by cvs2svn $10 * @date $Date: 2005-0 5-25 20:26:55 $9 * @version $Revision: 1.105 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2005-06-08 23:40:45 $ 11 11 * 12 12 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 1024 1024 1025 1025 if (normal == true) { 1026 tmp = 1.0 / PS_SQRT_F32(2.0 * M_PI * (sigma * sigma));1026 tmp = 1.0 / sqrtf(2.0 * M_PI * (sigma * sigma)); 1027 1027 } 1028 1028 -
trunk/psLib/src/math/psPolynomial.h
r3598 r4162 12 12 * @author GLG, MHPCC 13 13 * 14 * @version $Revision: 1.4 4$ $Name: not supported by cvs2svn $15 * @date $Date: 2005-0 3-31 23:01:46$14 * @version $Revision: 1.45 $ $Name: not supported by cvs2svn $ 15 * @date $Date: 2005-06-08 23:40:45 $ 16 16 * 17 17 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii 18 18 */ 19 19 20 #if !defined(PS_FUNCTIONS_H)20 #ifndef PS_FUNCTIONS_H 21 21 #define PS_FUNCTIONS_H 22 22 … … 34 34 35 35 /** Evaluate a non-normalized Gaussian with the given mean and sigma at the 36 * given coordianate. 37 * 38 * Note that this is not a Gaussian deviate. The evaluated Gaussian is: 39 * \f[ exp(-\frac{(x-mean)^2}{2\sigma^2}) \f] 36 * given coordianate. 37 * 38 * Note that this is not a Gaussian deviate. The evaluated Gaussian is: 39 * \f[ exp(-\frac{(x-mean)^2}{2\sigma^2}) \f] 40 40 * 41 41 * @return psF32 value on the gaussian curve given the input parameters … … 49 49 50 50 /** Produce a vector of random numbers from a Gaussian distribution with 51 * the specified mean and sigma 52 * 51 * the specified mean and sigma 52 * 53 53 * @return psVector* vector of random numbers 54 * 54 * 55 55 */ 56 56 psVector* p_psGaussianDev( … … 433 433 const psVector* y, 434 434 psF32 X); 435 #endif 436 437 /* \} */// End of MathGroup Functions438 439 #endif 440 435 #endif // #if 0 436 437 /** \} */ // End of MathGroup Functions 438 439 #endif // #ifndef PS_FUNCTIONS_H 440 -
trunk/psLib/src/math/psRandom.h
r3264 r4162 10 10 * @author GLG, MHPCC 11 11 * 12 * @version $Revision: 1. 3$ $Name: not supported by cvs2svn $13 * @date $Date: 2005-0 2-17 19:26:23$12 * @version $Revision: 1.4 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2005-06-08 23:40:45 $ 14 14 * 15 15 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii 16 16 */ 17 17 18 #if !defined(PS_RANDOM_H)18 #ifndef PS_RANDOM_H 19 19 #define PS_RANDOM_H 20 20 … … 56 56 /* \} */// End of MathGroup Functions 57 57 58 #endif 59 58 #endif // #ifndef PS_RANDOM_H -
trunk/psLib/src/math/psSpline.c
r4029 r4162 7 7 * polynomials. It also contains a Gaussian functions. 8 8 * 9 * @version $Revision: 1.10 4$ $Name: not supported by cvs2svn $10 * @date $Date: 2005-0 5-25 20:26:55 $9 * @version $Revision: 1.105 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2005-06-08 23:40:45 $ 11 11 * 12 12 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 1024 1024 1025 1025 if (normal == true) { 1026 tmp = 1.0 / PS_SQRT_F32(2.0 * M_PI * (sigma * sigma));1026 tmp = 1.0 / sqrtf(2.0 * M_PI * (sigma * sigma)); 1027 1027 } 1028 1028 -
trunk/psLib/src/math/psSpline.h
r3598 r4162 12 12 * @author GLG, MHPCC 13 13 * 14 * @version $Revision: 1.4 4$ $Name: not supported by cvs2svn $15 * @date $Date: 2005-0 3-31 23:01:46$14 * @version $Revision: 1.45 $ $Name: not supported by cvs2svn $ 15 * @date $Date: 2005-06-08 23:40:45 $ 16 16 * 17 17 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii 18 18 */ 19 19 20 #if !defined(PS_FUNCTIONS_H)20 #ifndef PS_FUNCTIONS_H 21 21 #define PS_FUNCTIONS_H 22 22 … … 34 34 35 35 /** Evaluate a non-normalized Gaussian with the given mean and sigma at the 36 * given coordianate. 37 * 38 * Note that this is not a Gaussian deviate. The evaluated Gaussian is: 39 * \f[ exp(-\frac{(x-mean)^2}{2\sigma^2}) \f] 36 * given coordianate. 37 * 38 * Note that this is not a Gaussian deviate. The evaluated Gaussian is: 39 * \f[ exp(-\frac{(x-mean)^2}{2\sigma^2}) \f] 40 40 * 41 41 * @return psF32 value on the gaussian curve given the input parameters … … 49 49 50 50 /** Produce a vector of random numbers from a Gaussian distribution with 51 * the specified mean and sigma 52 * 51 * the specified mean and sigma 52 * 53 53 * @return psVector* vector of random numbers 54 * 54 * 55 55 */ 56 56 psVector* p_psGaussianDev( … … 433 433 const psVector* y, 434 434 psF32 X); 435 #endif 436 437 /* \} */// End of MathGroup Functions438 439 #endif 440 435 #endif // #if 0 436 437 /** \} */ // End of MathGroup Functions 438 439 #endif // #ifndef PS_FUNCTIONS_H 440 -
trunk/psLib/src/math/psStats.c
r4138 r4162 14 14 * stats->binsize 15 15 * 16 * @version $Revision: 1.13 1$ $Name: not supported by cvs2svn $17 * @date $Date: 2005-06-0 7 23:11:54$16 * @version $Revision: 1.132 $ $Name: not supported by cvs2svn $ 17 * @date $Date: 2005-06-08 23:40:45 $ 18 18 * 19 19 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 878 878 } else { 879 879 countFloat = (psF32)countInt; 880 stats->sampleStdev = PS_SQRT_F32((sumSquares - (sumDiffs * sumDiffs / countFloat)) / (countFloat - 1));880 stats->sampleStdev = sqrtf((sumSquares - (sumDiffs * sumDiffs / countFloat)) / (countFloat - 1)); 881 881 } 882 882 } … … 992 992 // data ranges are used correctly. 993 993 if (errors != NULL) { 994 stats->sampleStdev = (1.0 / PS_SQRT_F32(errorDivisor));994 stats->sampleStdev = (1.0 / sqrtf(errorDivisor)); 995 995 } else { 996 996 countFloat = (psF32)countInt; 997 stats->sampleStdev = PS_SQRT_F32((sumSquares - (sumDiffs * sumDiffs / countFloat)) / (countFloat - 1));997 stats->sampleStdev = sqrtf((sumSquares - (sumDiffs * sumDiffs / countFloat)) / (countFloat - 1)); 998 998 999 999 } … … 1627 1627 } 1628 1628 } 1629 myStdev = PS_SQRT_F32((sumSquares - (sumDiffs * sumDiffs / countFloat)) / (countFloat - 1));1629 myStdev = sqrtf((sumSquares - (sumDiffs * sumDiffs / countFloat)) / (countFloat - 1)); 1630 1630 1631 1631 p_psNormalizeVectorRangeF32(robustHistogramVector, 0.0, 1.0); … … 1657 1657 "WARNING: failed fit a 1D polynomial.\n"); 1658 1658 } 1659 psF32 polyFitSigma = PS_SQRT_F32(-0.5 / tmpPoly->coeff[2]);1659 psF32 polyFitSigma = sqrtf(-0.5 / tmpPoly->coeff[2]); 1660 1660 psF32 polyFitMean = tmpPoly->coeff[1] * PS_SQR(polyFitSigma); 1661 1661 // psF32 polyFitNorm = exp(tmpPoly->coedd[0] + PS_SQR(polyFitMean) / (2.0 * PS_SQR(polyFitSigma))); -
trunk/psLib/src/math/psStats.h
r4138 r4162 14 14 * @author GLG, MHPCC 15 15 * 16 * @version $Revision: 1.4 1$ $Name: not supported by cvs2svn $17 * @date $Date: 2005-06-0 7 23:11:54$16 * @version $Revision: 1.42 $ $Name: not supported by cvs2svn $ 17 * @date $Date: 2005-06-08 23:40:45 $ 18 18 * 19 19 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii 20 20 */ 21 #if !defined(PS_STATS_H)21 #ifndef PS_STATS_H 22 22 #define PS_STATS_H 23 23 … … 112 112 /** The basic histogram structure which contains bounds and bins. 113 113 * 114 * In this structure, the vector bounds specifies the boundaries of the 115 * histogram bins, and must of type psF32, while nums specifies the number 116 * of entries in the bin, and must of type psU32. The value of bounds.n must 117 * therefore be 1 greater than than nums.n. The two values minNum and maxNum 118 * are the number of data values which fell below the lower limit bound or 114 * In this structure, the vector bounds specifies the boundaries of the 115 * histogram bins, and must of type psF32, while nums specifies the number 116 * of entries in the bin, and must of type psU32. The value of bounds.n must 117 * therefore be 1 greater than than nums.n. The two values minNum and maxNum 118 * are the number of data values which fell below the lower limit bound or 119 119 * above the upper limit bound, respectively. 120 120 */ … … 130 130 131 131 /** Allocator for psHistogram where the bounds of the bins are implicitly 132 * specified through simply specifying an upper and lower limit along with 133 * the size of the bins. 132 * specified through simply specifying an upper and lower limit along with 133 * the size of the bins. 134 134 * 135 135 * @return psHistogram* Newly allocated psHistogram … … 142 142 143 143 /** Allocator for psHistogram where the bounds of the bins are explicitly 144 * specified. 144 * specified. 145 145 * 146 146 * @return psHistogram* Newly allocated psHistogram … … 152 152 /** Calculate a histogram 153 153 * 154 * The following function populates the histogram bins from the specified 154 * The following function populates the histogram bins from the specified 155 155 * vector (in). It alters and returns the histogram out structure. The input 156 156 * vector may be of types psU8, psU16, psF32, psF64. … … 169 169 * 170 170 * @return psBool If more than one statistic result is set in stats->options, 171 * false is returned and the value parameter is not set, 171 * false is returned and the value parameter is not set, 172 172 * otherwise true is returned. 173 173 */ … … 193 193 /// @} 194 194 195 #endif 195 #endif // #ifndef PS_STATS_H -
trunk/psLib/src/math/psUnaryOp.h
r3182 r4162 30 30 * @author Robert DeSonia, MHPCC 31 31 * 32 * @version $Revision: 1. 1$ $Name: not supported by cvs2svn $33 * @date $Date: 2005-0 2-10 02:36:41$32 * @version $Revision: 1.2 $ $Name: not supported by cvs2svn $ 33 * @date $Date: 2005-06-08 23:40:45 $ 34 34 * 35 35 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 67 67 /// @} 68 68 69 #endif 69 #endif // #ifndef PSUNARY_OP_H
Note:
See TracChangeset
for help on using the changeset viewer.
