Changeset 4971 for trunk/psLib/src/math/psSpline.c
- Timestamp:
- Sep 7, 2005, 2:17:26 PM (21 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/math/psSpline.c (modified) (18 diffs)
Legend:
- Unmodified
- Added
- Removed
-
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);
Note:
See TracChangeset
for help on using the changeset viewer.
