Public Member Functions | Private Attributes | Friends | List of all members
ecl::CubicSpline Class Reference

Storage container for a cubic spline interpolation. More...

#include <cubic_spline.hpp>

Inheritance diagram for ecl::CubicSpline:
Inheritance graph
[legend]

Public Member Functions

 CubicSpline ()
 Default constructor. More...
 
template<typename Derived >
 CubicSpline (const BluePrint< Derived > &blueprint)
 Blueprint constructor. More...
 
double dderivative (double x) const ecl_assert_throw_decl(StandardException)
 Spline second derivative. More...
 
double derivative (double x) const ecl_assert_throw_decl(StandardException)
 Spline derivative. More...
 
const Array< double > & domain ()
 The discretised domain for this spline. More...
 
double operator() (const double &x) const ecl_assert_throw_decl(StandardException)
 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< CubicPolynomialcubic_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...
 

Detailed Description

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.

See also
Polynomial, Math::Splines.

Definition at line 123 of file cubic_spline.hpp.

Constructor & Destructor Documentation

ecl::CubicSpline::CubicSpline ( )
inline

Default constructor.

Default constructor.

Definition at line 133 of file cubic_spline.hpp.

template<typename Derived >
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).

Parameters
blueprint: the blue print to use to generate this instance.
See also
ecl::utilities::BluePrintFactory<CubicSpline>.

Definition at line 161 of file cubic_spline.hpp.

virtual ecl::CubicSpline::~CubicSpline ( )
inlinevirtual

Definition at line 164 of file cubic_spline.hpp.

Member Function Documentation

double ecl::CubicSpline::dderivative ( double  x) const

Spline second derivative.

Extract the second derivative of the spline.

Parameters
x: the domain value.
Returns
double : the second derivative of the spline.
Exceptions
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.

Parameters
x: the domain value.
Returns
double : the derivative of the spline.
Exceptions
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.

Returns
const Array<double>& : the discretised domain.

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.

Parameters
x: the domain value.
Returns
double : the spline function's value.
Exceptions
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.

Returns
const Array<CubicPolynomial>& : the polynomial sequence.

Definition at line 215 of file cubic_spline.hpp.

Friends And Related Function Documentation

friend class blueprints::C2CubicSpline
friend

Definition at line 170 of file cubic_spline.hpp.

Definition at line 164 of file cubic_spline.hpp.

template<typename OutputStream >
OutputStream& operator<< ( OutputStream &  ostream,
const CubicSpline cubic_spline 
)
friend

Streaming output insertion operator for for cubic splines.

Streaming output insertion operator for cubic splines.

Template Parameters
OutputStream: the type of stream being used.
Parameters
ostream: the output stream being used.
cubic_spline: the cubic spline.
Returns
OutputStream : the output stream.

Definition at line 246 of file cubic_spline.hpp.

Member Data Documentation

Array<CubicPolynomial> ecl::CubicSpline::cubic_polynomials
private

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.


The documentation for this class was generated from the following files:


ecl_geometry
Author(s): Daniel Stonier
autogenerated on Mon Jun 10 2019 13:08:38