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 DocumentationDefine the allowed boundary condition types. These are only supported by standard splines
Definition at line 98 of file Lau1DCubicSpline.hh. Define the allowed interpolation types. Definition at line 88 of file Lau1DCubicSpline.hh. Constructor & Destructor Documentation
Constructor. /param [in] xs the x-values of the knots /param [in] ys the y-values of the knots /param [in] leftBound the left-hand boundary condition /param [in] rightBound the right-hand boundary condition /param [in] dydx0 the gradient at the left-hand boundary of a clamped spline /param [in] dydxn the gradient at the right-hand boundary of a clamped spline Definition at line 41 of file Lau1DCubicSpline.cc.
Destructor. Definition at line 58 of file Lau1DCubicSpline.cc.
Copy constructor - not implemented. Member Function Documentation
Calculate the first derivative at each knot. Definition at line 164 of file Lau1DCubicSpline.cc.
Calculate the first derivatives according to the Akima method. Definition at line 284 of file Lau1DCubicSpline.cc.
Calculate the first derivatives according to the standard method. Definition at line 179 of file Lau1DCubicSpline.cc.
Evaluate the function at given point.
Definition at line 62 of file Lau1DCubicSpline.cc.
Initialise the class. Definition at line 146 of file Lau1DCubicSpline.cc.
Copy assignment operator - not implemented.
Update the boundary conditions for the spline. /param [in] leftBound the left-hand boundary condition /param [in] rightBound the right-hand boundary condition /param [in] dydx0 the gradient at the left-hand boundary of a clamped spline /param [in] dydxn the gradient at the right-hand boundary of a clamped spline Definition at line 119 of file Lau1DCubicSpline.cc.
Update the type of interpolation to perform.
Definition at line 111 of file Lau1DCubicSpline.cc.
Update the y-values of the knots.
Definition at line 105 of file Lau1DCubicSpline.cc. Member Data Documentation
The 'a' coefficients used to determine the derivatives. Definition at line 182 of file Lau1DCubicSpline.hh.
The 'b' coefficients used to determine the derivatives. Definition at line 184 of file Lau1DCubicSpline.hh.
The 'c' coefficients used to determine the derivatives. Definition at line 186 of file Lau1DCubicSpline.hh.
The 'd' coefficients used to determine the derivatives. Definition at line 188 of file Lau1DCubicSpline.hh.
The gradient at the left boundary for a clamped spline. Definition at line 199 of file Lau1DCubicSpline.hh.
The first derivative at each knot. Definition at line 179 of file Lau1DCubicSpline.hh.
The gradient at the right boundary for a clamped spline. Definition at line 201 of file Lau1DCubicSpline.hh.
The left-hand boundary condition on the spline. Definition at line 194 of file Lau1DCubicSpline.hh.
The number of knots in the spline. Definition at line 172 of file Lau1DCubicSpline.hh.
The right-hand boundary condition on the spline. Definition at line 196 of file Lau1DCubicSpline.hh.
The type of interpolation to be performed. Definition at line 191 of file Lau1DCubicSpline.hh.
The x-value at each knot. Definition at line 175 of file Lau1DCubicSpline.hh.
The y-value at each knot. Definition at line 177 of file Lau1DCubicSpline.hh. The documentation for this class was generated from the following files: Generated by ![]() |