Rational |
public class RationalCubicSpline : CurveBase, IInterpolationFunction, IInterpolationCurve
The RationalCubicSpline type exposes the following members.
| Name | Description | |
|---|---|---|
| RationalCubicSpline | Initializes a new instance of the `RationalCubicSpline` class. |
| Name | Description | |
|---|---|---|
| Smoothing | Gets or sets the value of the smoothing parameter. A value of p = 0 results in a standard cubic spline. A value of -1 < p < 0 results in "unsmoothing", i.e. overshooting oscillations. A value of p > 0 yields increasing smoothness. p to infinity results in a linear interpolation. A value smaller than or equal to -1.0 leads to an error. |
| Name | Description | |
|---|---|---|
| CubicSplineCoefficients |
Calculate the spline coefficients y2(i) and y3(i) for a natural cubic
spline, given the abscissa x(i), the ordinate y(i), and the 1st
derivative y1(i).
(Inherited from CurveBase) | |
| CubicSplineHorner |
Return the interpolation value P(u) for a piecewise cubic curve determined
by the abscissa vector x, the ordinate vector y,
and derivative coefficient vectors y1, y2, and y3, using the Horner scheme.
(Inherited from CurveBase) | |
| CubicSplineHorner1stDerivative |
Return the first derivative P'(u) of the piecewise cubic curve evaluated using Horner's scheme.
(Inherited from CurveBase) | |
| Differences | Calculates the difference vector dx(i) from vector x(i) and ensures that x is strictly monotone increasing or decreasing. Can be called with both arguments referring to the same vector in order to do it in place. | |
| Equals | Determines whether the specified object is equal to the current object. (Inherited from Object) | |
| Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object) | |
| GetBoundaryConditions | Gets the boundary condition. | |
| GetBoundaryConditions(Double, Double) | Gets the boundary condition and the two condition parameters. | |
| GetCurvePoints |
Get curve points to draw an interpolation curve between the abscissa values xlo and xhi.
It calls the virtual methods MpCurveBase::GetXOfU() and GetYOfU() to obtain the
interpolation values. Note, that before method DrawCurve() can be called
the method Interpolate() must have been called. Otherwise, not interpolation
is available.
(Inherited from CurveBase) | |
| GetHashCode | Serves as the default hash function. (Inherited from Object) | |
| GetType | Gets the Type of the current instance. (Inherited from Object) | |
| GetXOfU |
Get the abscissa value in dependence on parameter u.
(Overrides CurveBaseGetXOfU(Double)) | |
| GetYOfU |
Gets the ordinate value on dependence on parameter u.
(Overrides CurveBaseGetYOfU(Double)) | |
| GetYOfX | Returns the y value in dependence of a given x value. | |
| Interpolate | (Overrides CurveBaseInterpolate(IReadOnlyListDouble, IReadOnlyListDouble)) | |
| InverseDifferences | Calculates the inverse difference vector dx(i) from vector x(i) and ensures that x is strictly monotone increasing or decreasing. Can be called with both arguments referring to the same vector in order to do it in place. | |
| MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object) | |
| Parametrize |
Curve length parametrization. Returns the accumulated "distances"
between the points (x(i),y(i)) and (x(i+1),y(i+1)) in t(i+1)
for i = lo ... hi. t(lo) = 0.0 always.
(Inherited from CurveBase) | |
| SetBoundaryConditions | Sets the boundary conditions. | |
| SplineA | Computes the coefficient vector used by `SplineB1` and `SplineB2`. | |
| SplineB1 | Computes the 1st derivative vector for interior points, given boundary values and the coefficients computed by `SplineA`. | |
| SplineB2 | Computes the 2nd derivative vector for interior points, given boundary values and the coefficients computed by `SplineA`. | |
| SplineC1 | Calculates the spline coefficients a(i), b(i), c(i), d(i) for a spline with a given 1st derivative vector. Uses the coefficients calculated by `SplineA` and `SplineB1`. | |
| ToString | Returns a string that represents the current object. (Inherited from Object) |
| Name | Description | |
|---|---|---|
| a | ||
| b | ||
| boundary | ||
| c | ||
| d | ||
| dx | ||
| dy | ||
| p | ||
| r1 | ||
| r2 | ||
| x | Reference to the vector of the independent variable. (Inherited from CurveBase) | |
| y | Reference to the vector of the dependent variable. (Inherited from CurveBase) |
The basis functions for rational cubic splines are g1 = u g2 = t with t = (x - x(i)) / (x(i+1) - x(i)) g3 = u^3 / (p*t + 1) u = 1 - t g4 = t^3 / (p*u + 1) A rational spline with coefficients a(i),b(i),c(i),d(i) is determined by f(i)(x) = a(i)*g1 + b(i)*g2 + c(i)*g3 + d(i)*g4 Choosing the smoothing parameter p: ----------------------------------- Use the method void MpRationalCubicSpline::SetSmoothing (double smoothing) to set the value of the smoothing parameter. A value of p = 0 for the smoothing parameter results in a standard cubic spline. A value of p with -1 < p < 0 results in "unsmoothing", i.e. overshooting oscillations. A value of p with p > 0 gives increasing smoothness. p to infinity results in a linear interpolation. A value smaller than or equal to -1.0 leads to an error. Choosing the boundary conditions: --------------------------------- Use the method void MpRationalCubicSpline::SetBoundaryConditions (int boundary, double b1, double b2) to set the boundary conditions. The following values are possible: Natural natural boundaries, i.e. the 2nd derivatives are zero at both boundaries. This is the default value. FiniteDifferences use finite difference approximation for 1st derivatives. Supply1stDerivative user supplied values for 1st derivatives are given in b1 and b2 i.e. f'(x_lo) in b1 f'(x_hi) in b2 Supply2ndDerivative user supplied values for 2nd derivatives are given in b1 and b2 i.e. f''(x_lo) in b1 f''(x_hi) in b2 Periodic periodic boundary conditions for periodic curves or functions. NOT YET IMPLEMENTED IN THIS VERSION. If the parameters b1,b2 are omitted the default value is 0.0. Input parameters: ----------------- Vector x(lo,hi) The abscissa vector Vector y(lo,hi) The ordinate vector If the spline is not parametric then the abscissa must be strictly monotone increasing or decreasing! References: ----------- Dr.rer.nat. Helmuth Spaeth, Spline-Algorithmen zur Konstruktion glatter Kurven und Flaechen, 3. Auflage, R. Oldenburg Verlag, Muenchen, Wien, 1983.