- Timestamp:
- Feb 4, 2023, 12:09:57 PM (3 years ago)
- Location:
- branches/eam_branches/ipp-20220316/psLib
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
src/math/psSpline.h (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20220316/psLib
-
Property svn:mergeinfo
set to (toggle deleted branches)
/branches/IPP-308_move_backups_folder/psLib merged eligible /branches/czw_branch/20160809/psLib merged eligible /branches/czw_branch/20170908/psLib merged eligible /branches/eam_branches/ipp-20191011/psLib merged eligible /branches/eam_branches/ipp-20211108/psLib merged eligible /branches/eam_branches/ipp-dev-20210817/psLib merged eligible /branches/eam_branches/psLib.20230123 merged eligible /tags/ipp-ops-20220303-rc/psLib merged eligible /tags/ipp-ops-20220705/psLib merged eligible /tags/ipp-ps1-20210510/psLib merged eligible /tags/ipp-ps1-20210708/psLib merged eligible /trunk/psLib merged eligible /branches/ipp-259_genericise_backups/psLib 40910-40966
-
Property svn:mergeinfo
set to (toggle deleted branches)
-
branches/eam_branches/ipp-20220316/psLib/src/math/psSpline.h
r23486 r42368 5 5 * and evaluate splines. 6 6 * 7 * @author GLG, MHPCC 7 * @author GLG (MHPCC) 8 * reworked by EAM (IfA) 8 9 * 9 10 * @version $Revision: 1.62 $ $Name: not supported by cvs2svn $ … … 27 28 #include "psPolynomial.h" 28 29 29 #define PS_LEFT_SPLINE_DERIV 0.0 30 #define PS_RIGHT_SPLINE_DERIV 0.0 31 32 /** One-Dimensional Spline */ 30 /** One-Dimensional Spline 31 This structure represents a 1D cubic spline. Note the option for 32 equally-spaced knots allows a quick selection of the correct spline 33 segment. The values (xMin, xMax, xDel) are stored for ease of access. 34 */ 33 35 typedef struct 34 36 { 35 unsigned int n; ///< The number of spline pieces 36 psPolynomial1D **spline; ///< An array of n pointers to the spline polynomials 37 psVector *knots; ///< The boundaries between each spline piece. Size is n+1. 38 psF32 *p_psDeriv2; ///< For cubic splines, the second derivative at each domain point. Size is n+1. 37 unsigned int n; ///< The number of knots 38 psF32 *xKnots; ///< x-coordinate of the knots 39 psF32 *yKnots; ///< y-coordinate of the knots 40 psF32 *d2yKnots; ///< 2nd derivative of y at the knots 41 bool equalSpacing; // if knots are equally spaced, the seqment choice can be optimized 42 psF32 xMin; // for equally-spaced knots, the value at the lower bound (xKnots[0]) 43 psF32 xMax; // for equally-spaced knots, the value at the upper bound (xKnots[n]) 44 psF32 xDel; // for equally-spaced knots, the spacing (xKnots[n] - xKnots[0])/n 39 45 } 40 46 psSpline1D; 41 47 42 /** Allocates a psSpline1D structure 43 * 44 * Allocator for psSpline1D. 48 /** Allocator for psSpline1D. 45 49 * 46 50 * @return psSpline1D* new 1-D spline struct 47 51 */ 48 52 psSpline1D *psSpline1DAlloc(void) PS_ATTR_MALLOC; 53 54 /** Create an empty 1D spline **/ 55 psSpline1D *psSpline1DCreate( 56 int nKnots); ///< number of knots 49 57 50 58 /** Evaluates 1-D spline polynomials at a specific coordinate. … … 53 61 */ 54 62 float psSpline1DEval( 55 const psSpline1D *spline, ///< Coefficients for spline polynomials 63 const psSpline1D *spline, ///< spline pointer 64 float x ///< location at which to evaluate 65 ); 66 67 /** Evaluates 1-D spline polynomials at a specific coordinate. 68 * 69 * @return float result of spline polynomials evaluated at given location 70 */ 71 float psSpline1DEval_Segment( 72 const psSpline1D *spline, ///< spline pointer 73 int n, // choice of segment 56 74 float x ///< location at which to evaluate 57 75 ); … … 71 89 * generates the linear splines which satisfy those data points. 72 90 * 91 * XXX EAM: add option to generate / select a subset of knots from the data 92 * 73 93 * @return psSpline1D*: the calculated one-dimensional splines 74 94 */ 75 psSpline1D *ps VectorFitSpline1D(95 psSpline1D *psSpline1DFitVector( 76 96 const psVector* x, ///< Ordinates (or NULL to just use the indices) 77 const psVector* y ///< Coordinates 97 const psVector* y, ///< Coordinates. 98 psF32 dyLower, ///< 1st derivative at lower bound 99 psF32 dyUpper ///< 1st derivative at upper bound 78 100 ); 79 101 … … 87 109 psPtr ptr ///< the pointer whose type to check 88 110 ); 111 112 // check for equal spacing and set internal boolean if true 113 bool psSpline1DisEqualSpacing (psSpline1D *spline); 114 115 // convert the cubic spline elements to a simply ordinary polynomial for segment n 116 psPolynomial1D *psSpline1DToPoly (psSpline1D *spline, int n); 89 117 90 118 /*****************************************************************************
Note:
See TracChangeset
for help on using the changeset viewer.
