Changeset 4971
- Timestamp:
- Sep 7, 2005, 2:17:26 PM (21 years ago)
- Location:
- trunk/psLib/src
- Files:
-
- 6 edited
-
math/math.i (modified) (1 diff)
-
math/psPolynomial.c (modified) (10 diffs)
-
math/psSpline.c (modified) (18 diffs)
-
psErrorText_en.dat (modified) (1 diff)
-
pslib_strict.h (modified) (2 diffs)
-
sys/psMemory.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/math/math.i
r4540 r4971 6 6 %include "psMatrix.h" 7 7 %include "psMinimize.h" 8 %include "psFunctions.h" 8 %include "psPolynomial.h" 9 %include "psSpline.h" 9 10 %include "psRandom.h" 10 11 %include "psStats.h" -
trunk/psLib/src/math/psPolynomial.c
r4970 r4971 1 /** @file ps Functions.c1 /** @file psPolynomial.c 2 2 * 3 3 * @brief Contains basic function allocation, deallocation, and evaluation … … 7 7 * polynomials. It also contains a Gaussian functions. 8 8 * 9 * @version $Revision: 1.11 8$ $Name: not supported by cvs2svn $10 * @date $Date: 2005-09-08 00: 07:59$9 * @version $Revision: 1.119 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2005-09-08 00:14:31 $ 11 11 * 12 12 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 206 206 psF64 xSum = 1.0; 207 207 208 psTrace(".psLib.dataManip.ps Functions.ordPolynomial1DEval", 4,208 psTrace(".psLib.dataManip.psPolynomial.ordPolynomial1DEval", 4, 209 209 "---- Calling ordPolynomial1DEval(%lf)\n", x); 210 psTrace(".psLib.dataManip.ps Functions.ordPolynomial1DEval", 4,210 psTrace(".psLib.dataManip.psPolynomial.ordPolynomial1DEval", 4, 211 211 "Polynomial order is %d\n", poly->n); 212 212 for (loop_x = 0; loop_x < poly->n; loop_x++) { 213 psTrace(".psLib.dataManip.ps Functions.ordPolynomial1DEval", 4,213 psTrace(".psLib.dataManip.psPolynomial.ordPolynomial1DEval", 4, 214 214 "Polynomial coeff[%d] is %lf\n", loop_x, poly->coeff[loop_x]); 215 215 } … … 217 217 for (loop_x = 0; loop_x < poly->n; loop_x++) { 218 218 if (poly->mask[loop_x] == 0) { 219 psTrace(".psLib.dataManip.ps Functions.ordPolynomial1DEval", 10,219 psTrace(".psLib.dataManip.psPolynomial.ordPolynomial1DEval", 10, 220 220 "polysum+= sum*coeff [%lf+= (%lf * %lf)\n", polySum, xSum, poly->coeff[loop_x]); 221 221 polySum += xSum * poly->coeff[loop_x]; … … 546 546 psF32 tmp = 1.0; 547 547 548 psTrace(".psLib.dataManip.ps Functions.psGaussian", 4,548 psTrace(".psLib.dataManip.psPolynomial.psGaussian", 4, 549 549 "---- psGaussian() begin ----\n"); 550 550 … … 553 553 } 554 554 555 psTrace(".psLib.dataManip.ps Functions.psGaussian", 4,555 psTrace(".psLib.dataManip.psPolynomial.psGaussian", 4, 556 556 "---- psGaussian() end ----\n"); 557 557 return(tmp * exp(-((x - mean) * (x - mean)) / (2.0 * sigma * sigma))); … … 759 759 } else { 760 760 psError(PS_ERR_BAD_PARAMETER_TYPE, true, 761 PS_ERRORTEXT_ps Functions_INVALID_POLYNOMIAL_TYPE,761 PS_ERRORTEXT_psPolynomial_INVALID_POLYNOMIAL_TYPE, 762 762 poly->type); 763 763 } … … 792 792 } else { 793 793 psError(PS_ERR_BAD_PARAMETER_TYPE, true, 794 PS_ERRORTEXT_ps Functions_INVALID_POLYNOMIAL_TYPE,794 PS_ERRORTEXT_psPolynomial_INVALID_POLYNOMIAL_TYPE, 795 795 poly->type); 796 796 } … … 839 839 } else { 840 840 psError(PS_ERR_BAD_PARAMETER_TYPE, true, 841 PS_ERRORTEXT_ps Functions_INVALID_POLYNOMIAL_TYPE,841 PS_ERRORTEXT_psPolynomial_INVALID_POLYNOMIAL_TYPE, 842 842 poly->type); 843 843 } … … 895 895 } else { 896 896 psError(PS_ERR_BAD_PARAMETER_TYPE, true, 897 PS_ERRORTEXT_ps Functions_INVALID_POLYNOMIAL_TYPE,897 PS_ERRORTEXT_psPolynomial_INVALID_POLYNOMIAL_TYPE, 898 898 poly->type); 899 899 } -
trunk/psLib/src/math/psSpline.c
r4970 r4971 1 /** @file psFunctions.c1 /** @file psSpline.c 2 2 * 3 3 * @brief Contains basic function allocation, deallocation, and evaluation … … 7 7 * splines. 8 8 * 9 * @version $Revision: 1.12 1$ $Name: not supported by cvs2svn $10 * @date $Date: 2005-09-08 00: 07:59$9 * @version $Revision: 1.122 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2005-09-08 00:14:32 $ 11 11 * 12 12 * … … 112 112 p_psMemSetPersistent(p->data.TYPE, true); \ 113 113 \ 114 psTrace(".psLib.dataManip.ps Functions.fullInterpolate1D##TYPE", 4, \114 psTrace(".psLib.dataManip.psSpline.fullInterpolate1D##TYPE", 4, \ 115 115 "---- fullInterpolate1D##TYPE() begin (%d-order at x=%f) (%d data points)----\n", n-1, x, n); \ 116 116 \ 117 117 for (i=0;i<n;i++) { \ 118 psTrace(".psLib.dataManip.ps Functions.fullInterpolate1D##TYPE", 6, \118 psTrace(".psLib.dataManip.psSpline.fullInterpolate1D##TYPE", 6, \ 119 119 "domain/range is (%f %f)\n", domain[i], range[i]); \ 120 120 } \ … … 122 122 for (i=0;i<n;i++) { \ 123 123 p->data.TYPE[i] = range[i]; \ 124 psTrace(".psLib.dataManip.ps Functions.fullInterpolate1D##TYPE", 6, \124 psTrace(".psLib.dataManip.psSpline.fullInterpolate1D##TYPE", 6, \ 125 125 "p->data.TYPE[%d] is %f\n", i, p->data.TYPE[i]); \ 126 126 \ … … 139 139 /*printf("((%f-%f * %f) + (%f-%f * %f)) / (%f - %f)\n", x, domain[i+m], p->data.TYPE[i], domain[i], x, p->data.TYPE[i+1], domain[i], domain[i+m]); \ 140 140 */ \ 141 psTrace(".psLib.dataManip.ps Functions.fullInterpolate1D##TYPE", 6, \141 psTrace(".psLib.dataManip.psSpline.fullInterpolate1D##TYPE", 6, \ 142 142 "p->data.TYPE[%d] is %f\n", i, p->data.TYPE[i]); \ 143 143 } \ 144 144 } \ 145 psTrace(".psLib.dataManip.ps Functions.fullInterpolate1D##TYPE", 4, \145 psTrace(".psLib.dataManip.psSpline.fullInterpolate1D##TYPE", 4, \ 146 146 "---- fullInterpolate1D##TYPE() end ----\n"); \ 147 147 \ … … 181 181 psS32 origin; 182 182 183 psTrace(".psLib.dataManip.ps Functions.interpolate1DF32", 4,183 psTrace(".psLib.dataManip.psSpline.interpolate1DF32", 4, 184 184 "---- interpolate1DF32() begin ----\n"); 185 185 … … 202 202 } 203 203 204 psTrace(".psLib.dataManip.ps Functions.interpolate1DF32", 4,204 psTrace(".psLib.dataManip.psSpline.interpolate1DF32", 4, 205 205 "---- interpolate1DF32() end ----\n"); 206 206 return(fullInterpolate1DF32(&domain[origin], &range[origin], order+1, x)); … … 349 349 psS32 mid; \ 350 350 \ 351 psTrace(".psLib.dataManip.ps Functions.vectorBinDisect##TYPE", 4, \351 psTrace(".psLib.dataManip.psSpline.vectorBinDisect##TYPE", 4, \ 352 352 "---- Calling vectorBinDisect##TYPE(%f)\n", x); \ 353 353 \ … … 371 371 \ 372 372 while (min != max) { \ 373 psTrace(".psLib.dataManip.ps Functions.vectorBinDisect##TYPE", 4, \373 psTrace(".psLib.dataManip.psSpline.vectorBinDisect##TYPE", 4, \ 374 374 "(min, mid, max) is (%d, %d, %d): (x, bins) is (%f, %f)\n", \ 375 375 min, mid, max, x, bins[mid]); \ 376 376 \ 377 377 if (x == bins[mid]) { \ 378 psTrace(".psLib.dataManip.ps Functions.vectorBinDisect##TYPE", 4, \378 psTrace(".psLib.dataManip.psSpline.vectorBinDisect##TYPE", 4, \ 379 379 "---- Exiting vectorBinDisect##TYPE(): bin %d\n", mid); \ 380 380 return(mid); \ … … 387 387 } \ 388 388 \ 389 psTrace(".psLib.dataManip.ps Functions.vectorBinDisect##TYPE", 4, \389 psTrace(".psLib.dataManip.psSpline.vectorBinDisect##TYPE", 4, \ 390 390 "---- Exiting vectorBinDisect##TYPE(): bin %d\n", min); \ 391 391 return(min); \ … … 441 441 PS_TYPE_NAME(strType,x->type.type); 442 442 psError(PS_ERR_BAD_PARAMETER_TYPE, 443 PS_ERRORTEXT_ps Functions_TYPE_NOT_SUPPORTED,443 PS_ERRORTEXT_psSpline_TYPE_NOT_SUPPORTED, 444 444 strType); 445 445 return 0; … … 447 447 PS_TYPE_NAME(strType,x->type.type); 448 448 psError(PS_ERR_BAD_PARAMETER_TYPE, 449 PS_ERRORTEXT_ps Functions_TYPE_NOT_SUPPORTED,449 PS_ERRORTEXT_psSpline_TYPE_NOT_SUPPORTED, 450 450 strType); 451 451 return 0; … … 453 453 PS_TYPE_NAME(strType,x->type.type); 454 454 psError(PS_ERR_BAD_PARAMETER_TYPE, 455 PS_ERRORTEXT_ps Functions_TYPE_NOT_SUPPORTED,455 PS_ERRORTEXT_psSpline_TYPE_NOT_SUPPORTED, 456 456 strType); 457 457 return 0; … … 487 487 psVector *range32 = NULL; 488 488 psVector *domain32 = NULL; 489 psTrace(".psLib.dataManip.ps Functions.p_psVectorInterpolate", 4,489 psTrace(".psLib.dataManip.psSpline.p_psVectorInterpolate", 4, 490 490 "---- p_psVectorInterpolate() begin ----\n"); 491 491 492 492 if (order > (domain->n - 1)) { 493 493 psError(PS_ERR_BAD_PARAMETER_SIZE, true, 494 PS_ERRORTEXT_ps Functions_NOT_ENOUGH_DATAPOINTS,494 PS_ERRORTEXT_psSpline_NOT_ENOUGH_DATAPOINTS, 495 495 order); 496 496 return(NULL); … … 498 498 499 499 if (x->type.type == PS_TYPE_F32) { 500 psTrace(".psLib.dataManip.ps Functions.p_psVectorInterpolate", 4,500 psTrace(".psLib.dataManip.psSpline.p_psVectorInterpolate", 4, 501 501 "---- p_psVectorInterpolate() end ----\n"); 502 502 return(psScalarAlloc(interpolate1DF32(domain->data.F32, … … 519 519 psFree(domain32); 520 520 521 psTrace(".psLib.dataManip.ps Functions.p_psVectorInterpolate", 4,521 psTrace(".psLib.dataManip.psSpline.p_psVectorInterpolate", 4, 522 522 "---- p_psVectorInterpolate() end ----\n"); 523 523 // XXX: Convert data type to F64? … … 528 528 PS_TYPE_NAME(strType,x->type.type); 529 529 psError(PS_ERR_BAD_PARAMETER_TYPE, 530 PS_ERRORTEXT_ps Functions_TYPE_NOT_SUPPORTED,530 PS_ERRORTEXT_psSpline_TYPE_NOT_SUPPORTED, 531 531 strType); 532 532 } 533 533 534 psTrace(".psLib.dataManip.ps Functions.p_psVectorInterpolate", 4,534 psTrace(".psLib.dataManip.psSpline.p_psVectorInterpolate", 4, 535 535 "return(NULL)\n"); 536 psTrace(".psLib.dataManip.ps Functions.p_psVectorInterpolate", 4,536 psTrace(".psLib.dataManip.psSpline.p_psVectorInterpolate", 4, 537 537 "---- p_psVectorInterpolate() end ----\n"); 538 538 … … 622 622 PS_TYPE_NAME(strType,x->type.type); 623 623 psError(PS_ERR_BAD_PARAMETER_TYPE, 624 PS_ERRORTEXT_ps Functions_TYPE_NOT_SUPPORTED,624 PS_ERRORTEXT_psSpline_TYPE_NOT_SUPPORTED, 625 625 strType); 626 626 return(NULL); -
trunk/psLib/src/psErrorText_en.dat
r4827 r4971 203 203 psStats_STATS_POLY_MEDIAN_OUT_OF_RANGE The requested y-value does not fall with the specified range of x-values. Returning NAN. 204 204 # 205 psFunctions_INVALID_POLYNOMIAL_TYPE Unknown polynomial type 0x%x found. Evaluation failed. 206 psFunctions_TYPE_NOT_SUPPORTED Input psVector type, %s, is not supported. 207 psFunctions_NOT_ENOUGH_DATAPOINTS Given vector does not have enough data points for %d-order interpolation. 205 psPolynomial_INVALID_POLYNOMIAL_TYPE Unknown polynomial type 0x%x found. Evaluation failed. 206 psPolynomial_TYPE_NOT_SUPPORTED Input psVector type, %s, is not supported. 207 psPolynomial_NOT_ENOUGH_DATAPOINTS Given vector does not have enough data points for %d-order interpolation. 208 psSpline_INVALID_POLYNOMIAL_TYPE Unknown polynomial type 0x%x found. Evaluation failed. 209 psSpline_TYPE_NOT_SUPPORTED Input psVector type, %s, is not supported. 210 psSpline_NOT_ENOUGH_DATAPOINTS Given vector does not have enough data points for %d-order interpolation. 208 211 # 209 212 psRandom_UNKNOWN_RANDFOM_NUMBER_GENERATOR_TYPE Unknown Random Number Generator Type -
trunk/psLib/src/pslib_strict.h
r4790 r4971 9 9 * @author Eric Van Alst, MHPCC 10 10 * 11 * @version $Revision: 1. 7$ $Name: not supported by cvs2svn $12 * @date $Date: 2005-0 8-16 21:17:15 $11 * @version $Revision: 1.8 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2005-09-08 00:15:15 $ 13 13 * 14 14 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 72 72 #include "psMinimize.h" 73 73 #include "psRandom.h" 74 #include "psFunctions.h" 74 #include "psPolynomial.h" 75 #include "psSpline.h" 75 76 #include "psStats.h" 76 77 #include "psUnaryOp.h" -
trunk/psLib/src/sys/psMemory.c
r4920 r4971 8 8 * @author Robert Lupton, Princeton University 9 9 * 10 * @version $Revision: 1.6 3$ $Name: not supported by cvs2svn $11 * @date $Date: 2005-0 8-31 02:07:11$10 * @version $Revision: 1.64 $ $Name: not supported by cvs2svn $ 11 * @date $Date: 2005-09-08 00:17:26 $ 12 12 * 13 13 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 37 37 //#include "psScalar.h" 38 38 //#include "psVector.h" 39 //#include "psFunctions.h"40 39 //#include "psTime.h" 41 40 //#include "psCoord.h"
Note:
See TracChangeset
for help on using the changeset viewer.
