- Timestamp:
- Mar 29, 2009, 6:15:31 PM (17 years ago)
- Location:
- branches/cnb_branches/cnb_branch_20090301
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
psLib/src/math/psSpline.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/cnb_branches/cnb_branch_20090301
-
branches/cnb_branches/cnb_branch_20090301/psLib/src/math/psSpline.c
r12434 r23594 103 103 tabulated function at n points, this routine calculates the second 104 104 derivatives of the interpolating cubic splines at those n points. 105 105 106 106 The first and second derivatives at the endpoints were previously undefined in 107 107 the SDR. From bugzilla #???, they are required to be 0.0, implementing natural 108 108 splines. 109 109 110 110 Endpoints are defined by 111 111 PS_LEFT_SPLINE_DERIV 112 112 PS_RIGHT_SPLINE_DERIV 113 113 114 114 This routine assumes that vectors x and y are of the appropriate types/sizes 115 115 (F32). 116 116 117 117 XXX: use recycled vectors for internal data. 118 118 XXX: do an F64 version? … … 177 177 } 178 178 179 psSpline1D *psSpline1DAlloc( )179 psSpline1D *psSpline1DAlloc(void) 180 180 { 181 181 psSpline1D *tmpSpline = (psSpline1D *) psAlloc(sizeof(psSpline1D)); … … 192 192 psVectorFitSpline1D(): given a set of x/y vectors, this routine generates the 193 193 linear or cublic splines which satisfy those data points. 194 194 195 195 The formula for calculating the spline polynomials is derived from Numerical 196 196 Recipes in C. The basic idea is that the polynomial is … … 206 206 into a polynomial in terms of x, and then saving the coefficients of the 207 207 powers of x in the spline polynomials. This gets pretty complicated. 208 208 209 209 XXX: What types must be supported? 210 210 *****************************************************************************/ … … 354 354 (vectorBinDisectF32()). Then it evaluates the spline at that x location 355 355 by a call to the 1D polynomial functions. 356 356 357 357 XXX: The spline eval functions require input and output to be F32. however 358 358 the spline fit functions require F32 and F64. 359 359 360 360 XXX: This only works if spline->knots if psF32. Must we add support for psU32 and 361 361 psF64?
Note:
See TracChangeset
for help on using the changeset viewer.
