Public Member Functions | Private Attributes | Friends
ecl::CubicSpline Class Reference

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

#include <cubic_spline.hpp>

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

List of all members.

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< 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.

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

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 ( ) [inline, virtual]

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.

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

Definition at line 238 of file cubic_spline.hpp.

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 Thu Jun 6 2019 21:17:52