Storage container for a cubic spline interpolation. More...
#include <cubic_spline.hpp>
Public Member Functions | |
CubicSpline () | |
Default constructor. More... | |
template<typename Derived > | |
CubicSpline (const BluePrint< Derived > &blueprint) | |
Blueprint constructor. More... | |
double | dderivative (double x) const |
Spline second derivative. More... | |
double | derivative (double x) const |
Spline derivative. More... | |
const Array< double > & | domain () |
The discretised domain for this spline. More... | |
double | operator() (const double &x) const |
Spline function. More... | |
const Array< CubicPolynomial > & | polynomials () |
The polynomial sequence. More... | |
virtual | ~CubicSpline () |
Public Member Functions inherited from ecl::BluePrintFactory< CubicSpline > | |
virtual | ~BluePrintFactory () |
Private Attributes | |
Array< CubicPolynomial > | cubic_polynomials |
Array< double > | discretised_domain |
Friends | |
class | blueprints::C2CubicSpline |
class | blueprints::DerivativeHeuristicCubicSpline |
template<typename OutputStream > | |
OutputStream & | operator<< (OutputStream &ostream, const CubicSpline &cubic_spline) |
Streaming output insertion operator for for cubic splines. More... | |
Additional Inherited Members | |
Static Public Member Functions inherited from ecl::BluePrintFactory< CubicSpline > | |
static blueprints::C2CubicSpline | ContinuousDerivatives (const Array< double > &x_set, const Array< double > &y_set, const double ydot_0, const double ydot_f) |
Cubic spline blueprint satisfying y, y' and y'' continuity requirements. More... | |
static blueprints::DerivativeHeuristicCubicSpline | DerivativeHeuristic (const Array< double > &x_set, const Array< double > &y_set, const double ydot_0, const double ydot_f) |
Cubic spline blueprint derived from a y' heuristic. More... | |
static blueprints::C2CubicSpline | Natural (const Array< double > &x_set, const Array< double > &y_set) |
Cubic spline blueprint satisfying y, y' and y'' continuity with y''_0 = y''_f = 0. More... | |
Storage container for a cubic spline interpolation.
Storage container for a cubic spline interpolation. This is a very standard cubic spline container. Use the corresponding blueprints for construction of the splines.
There are various ways of constructing the cubic spline, though almost always a C1 or C2 continuous function is desired. To achieve this, either a heuristic or a C2 constraint can be fixed, resulting in a derivation for the spline's functions.
Definition at line 123 of file cubic_spline.hpp.
|
inline |
|
inline |
Blueprint constructor.
Constructor that allows automatic generation from an existing blueprint. This can be used simply in the following manner for any static element belonging to the BluePrintFactory.
Since this is not explicit, it will also allow assignment.
This will emit a compile time failure if the template argument does not conform to the blueprints concept (refer to ecl_concepts' documentation).
blueprint | : the blue print to use to generate this instance. |
Definition at line 161 of file cubic_spline.hpp.
|
inlinevirtual |
Definition at line 164 of file cubic_spline.hpp.
double ecl::CubicSpline::dderivative | ( | double | x | ) | const |
Spline second derivative.
Extract the second derivative of the spline.
x | : the domain value. |
StandardException : throws if input x value is outside the spline range [debug mode only]. |
Definition at line 47 of file cubic_spline.cpp.
double ecl::CubicSpline::derivative | ( | double | x | ) | const |
Spline derivative.
Extract the derivative of the spline at the indicated value.
x | : the domain value. |
StandardException : throws if input x value is outside the spline range [debug mode only]. |
Definition at line 38 of file cubic_spline.cpp.
|
inline |
The discretised domain for this spline.
This returns the array of discretised time values that define the domains of each polynomial within the spline.
Definition at line 206 of file cubic_spline.hpp.
double ecl::CubicSpline::operator() | ( | const double & | x | ) | const |
Spline function.
Extract the spline function's value at the indicated location.
x | : the domain value. |
StandardException : throws if input x value is outside the spline range [debug mode only]. |
Definition at line 29 of file cubic_spline.cpp.
|
inline |
The polynomial sequence.
This returns a handle to the array of cubic polynomials that make up the spline.
Definition at line 215 of file cubic_spline.hpp.
|
friend |
Definition at line 170 of file cubic_spline.hpp.
|
friend |
Definition at line 164 of file cubic_spline.hpp.
|
friend |
Streaming output insertion operator for for cubic splines.
Streaming output insertion operator for cubic splines.
OutputStream | : the type of stream being used. |
ostream | : the output stream being used. |
cubic_spline | : the cubic spline. |
Definition at line 246 of file cubic_spline.hpp.
|
private |
Definition at line 238 of file cubic_spline.hpp.
|
private |
Definition at line 235 of file cubic_spline.hpp.