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
 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< 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 129 of file cubic_spline.hpp.

Constructor & Destructor Documentation

◆ CubicSpline() [1/2]

ecl::CubicSpline::CubicSpline ( )
inline

Default constructor.

Default constructor.

Definition at line 141 of file cubic_spline.hpp.

◆ CubicSpline() [2/2]

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 169 of file cubic_spline.hpp.

◆ ~CubicSpline()

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

Definition at line 172 of file cubic_spline.hpp.

Member Function Documentation

◆ dderivative()

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 51 of file cubic_spline.cpp.

◆ derivative()

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 42 of file cubic_spline.cpp.

◆ domain()

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 214 of file cubic_spline.hpp.

◆ operator()()

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 33 of file cubic_spline.cpp.

◆ polynomials()

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 223 of file cubic_spline.hpp.

Friends And Related Function Documentation

◆ blueprints::C2CubicSpline

friend class blueprints::C2CubicSpline
friend

Definition at line 178 of file cubic_spline.hpp.

◆ blueprints::DerivativeHeuristicCubicSpline

Definition at line 172 of file cubic_spline.hpp.

◆ operator<<

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 252 of file cubic_spline.hpp.

Member Data Documentation

◆ cubic_polynomials

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

Definition at line 246 of file cubic_spline.hpp.

◆ discretised_domain

Array<double> ecl::CubicSpline::discretised_domain
private

Definition at line 243 of file cubic_spline.hpp.


The documentation for this class was generated from the following files:
ecl::CubicSpline::CubicSpline
CubicSpline()
Default constructor.
Definition: cubic_spline.hpp:141
ecl::BluePrintFactory< CubicSpline >::Natural
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.
Definition: cubic_spline_blueprints.cpp:191


ecl_geometry
Author(s): Daniel Stonier
autogenerated on Sun Aug 2 2020 03:12:16