Storage container for a cubic spline interpolation. More...
#include <cubic_spline.hpp>
Public Member Functions | |
CubicSpline () | |
template<typename Derived > | |
CubicSpline (const BluePrint< Derived > &blueprint) | |
Blueprint constructor. | |
double | dderivative (double x) const ecl_assert_throw_decl(StandardException) |
Spline second derivative. | |
double | derivative (double x) const ecl_assert_throw_decl(StandardException) |
Spline derivative. | |
const Array< double > & | domain () |
The discretised domain for this spline. | |
double | operator() (const double &x) const ecl_assert_throw_decl(StandardException) |
Spline function. | |
const Array< CubicPolynomial > & | polynomials () |
The polynomial sequence. | |
virtual | ~CubicSpline () |
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. |
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.
ecl::CubicSpline::CubicSpline | ( | ) | [inline] |
Default constructor.
Definition at line 133 of file cubic_spline.hpp.
ecl::CubicSpline::CubicSpline | ( | const BluePrint< Derived > & | blueprint | ) | [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.
Array<double> x_set(5); Array<double> y_set(5); x_set = 0.0, 1.0, 2.0, 3.0, 4.0; y_set = 1.0, 2.0, 1.0, 3.0, 4.0; CubicSpline cubic_spline = CubicSpline::Natural(x_set,y_set);
Since this is not explicit, it will also allow assignment.
CubicSpline cubic_spline; cubic_spline = CubicSpline::Natural(x_set,y_set);
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.
virtual ecl::CubicSpline::~CubicSpline | ( | ) | [inline, virtual] |
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.
const Array<double>& ecl::CubicSpline::domain | ( | ) | [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.
const Array<CubicPolynomial>& ecl::CubicSpline::polynomials | ( | ) | [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 class blueprints::C2CubicSpline [friend] |
Definition at line 170 of file cubic_spline.hpp.
friend class blueprints::DerivativeHeuristicCubicSpline [friend] |
Definition at line 164 of file cubic_spline.hpp.
OutputStream& operator<< | ( | OutputStream & | ostream, |
const CubicSpline & | cubic_spline | ||
) | [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.
Definition at line 238 of file cubic_spline.hpp.
Array<double> ecl::CubicSpline::discretised_domain [private] |
Definition at line 235 of file cubic_spline.hpp.