Public Types |
Public Member Functions |
Private Member Functions |
Private Attributes |
List of all members
Lau1DCubicSpline Class Reference Class for defining a 1D cubic spline based on a set of knots. More...
Detailed DescriptionClass for defining a 1D cubic spline based on a set of knots. Class for defining a 1D cubic spline based on a set of knots. Interpolation between the knots is performed either by one of two types of cubic spline (standard or Akima) or by linear interpolation. The splines are defined by a piecewise cubic function which, between knots i and i+1, has the form f_i(x) = (1 - t)*y_i + t*y_i+1 + t*(1 - t)(a*(1 - t) + b*t) where t = (x - x_i)/(x_i+1 - x_i), a = k_i *(x_i+1 - x_i) - (y_i+1 - y_i), b = -k_i+1*(x_i+1 - x_i) + (y_i+1 - y_i) and k_i is (by construction) the first derivative at knot i. f(x) and f'(x) are continuous at the internal knots by construction. For the standard splines, f''(x) is required to be continuous at all internal knots placing n-2 constraints on the n parameters, k_i. The final two constraints are set by the boundary conditions. At each boundary, the function may be: (i) Clamped : f'(x) = C at the last knot (ii) Natural : f''(x) = 0 at the last knot (iii) Not a knot : f'''(x) continuous at the second last knot The algorithms used in these splines can be found on: http://en.wikipedia.org/wiki/Spline_interpolation#Algorithm_to_find_the_interpolating_cubic_spline http://en.wikipedia.org/wiki/Tridiagonal_matrix_algorithm For the Akima splines, the values of k_i are determined from the slopes of the four nearest segments (a_i-1, a_i, a_i+1 and a_i+2) as k_i = ( | a_i+2 - a_i+1 | a_i + | a_i - a_i-1 | a_i+1 ) / ( | a_i+2 - a_i+1 | + | a_i - a_i-1 | ) and as k_i = ( a_i + a_i+1 ) / 2 in the special case a_i-1 == a_i != a_i+1 == a_i+2. Boundary conditions are specified by the relations a_2 - a_1 = a_1 - a_0 = a_0 - a_-1 and a_n-1 - a_n-2 = a_n - a_n-1 = a_n+1 - a_n The algorithms used in these splines can be found in: J.ACM vol. 17 no. 4 pp 589-602 Definition at line 84 of file Lau1DCubicSpline.hh. Member Enumeration Documentation◆ LauSplineBoundaryTypeDefine the allowed boundary condition types. These are only supported by standard splines
Definition at line 98 of file Lau1DCubicSpline.hh. ◆ LauSplineTypeDefine the allowed interpolation types. Definition at line 88 of file Lau1DCubicSpline.hh. Constructor & Destructor Documentation◆ Lau1DCubicSpline()
Constructor.
Definition at line 38 of file Lau1DCubicSpline.cc. Member Function Documentation◆ evaluate()
Evaluate the function at given point.
Definition at line 61 of file Lau1DCubicSpline.cc. ◆ updateBoundaryConditions()
Update the boundary conditions for the spline.
Definition at line 120 of file Lau1DCubicSpline.cc. ◆ updateType()
Update the type of interpolation to perform.
Definition at line 112 of file Lau1DCubicSpline.cc. ◆ updateYValues()
Update the y-values of the knots.
Definition at line 106 of file Lau1DCubicSpline.cc. The documentation for this class was generated from the following files:
Generated by ![]() |