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

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

#include <tension_spline.hpp>

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

Public Types

typedef BluePrintFactory< TensionSplineFactory
 Generates blueprints for this class. More...
 

Public Member Functions

double dderivative (const double &x) const ecl_assert_throw_decl(StandardException)
 Spline second derivative. More...
 
double derivative (const double &x) const ecl_assert_throw_decl(StandardException)
 Spline derivative. More...
 
const Array< double > & domain () const
 The discretised domain for this spline. More...
 
double operator() (const double &x) const ecl_assert_throw_decl(StandardException)
 Spline function. More...
 
 TensionSpline ()
 Default constructor. More...
 
template<typename Derived >
 TensionSpline (const BluePrint< Derived > &blueprint)
 Blueprint constructor. More...
 
virtual ~TensionSpline ()
 
- Public Member Functions inherited from ecl::BluePrintFactory< TensionSpline >
virtual ~BluePrintFactory ()
 

Private Attributes

Array< double > discretised_domain
 
Array< TensionFunctionfunctions
 
double tension
 

Friends

class blueprints::C2TensionSpline
 
template<typename OutputStream >
OutputStream & operator<< (OutputStream &ostream, const TensionSpline &tension_spline)
 Streaming output insertion operator for for tension splines. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from ecl::BluePrintFactory< TensionSpline >
static blueprints::C2TensionSpline Natural (const Array< double > &x_set, const Array< double > &y_set, const double &tau) ecl_assert_throw_decl(StandardException)
 Tension spline blueprint satisfying y, y' and y'' continuity with y''_0 = y''_f = 0. More...
 

Detailed Description

Storage container for a tension spline interpolation.

These interpolations are very similar to cubic splines, but allow an extra parameter for configuration called the tension of the interpolation. The tension variable effectively tightens the curve among the data points, resulting in a spline interpolation that looks very similar to the linear blended interpolations. When the tension approaches zero, this interpolation defaults to a cubic spline interpolation.

See also
CubicSpline, Math::Splines.

Definition at line 95 of file tension_spline.hpp.

Member Typedef Documentation

Generates blueprints for this class.

Definition at line 100 of file tension_spline.hpp.

Constructor & Destructor Documentation

ecl::TensionSpline::TensionSpline ( )
inline

Default constructor.

Don't really need this, but things like vectors and array containers need it so they can reserve the appropriate storage.

Definition at line 111 of file tension_spline.hpp.

virtual ecl::TensionSpline::~TensionSpline ( )
inlinevirtual

Definition at line 112 of file tension_spline.hpp.

template<typename Derived >
ecl::TensionSpline::TensionSpline ( 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.

double tension = 4.0;
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;
TensionSpline tension_spline = TensionSpline::Natural(x_set,y_set,tension);

Since this is not explicit, it will also allow assignment.

tension_spline = TensionSpline::Natural(x_set,y_set,tension);

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::BluePrintFactory<TensionSpline>.

Definition at line 140 of file tension_spline.hpp.

Member Function Documentation

double ecl::TensionSpline::dderivative ( const 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 x is outside the spline range [debug mode only].

Definition at line 47 of file tension_spline.cpp.

double ecl::TensionSpline::derivative ( const 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 x is outside the spline range [debug mode only].

Definition at line 38 of file tension_spline.cpp.

const Array<double>& ecl::TensionSpline::domain ( ) const
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 187 of file tension_spline.hpp.

double ecl::TensionSpline::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 x is outside the spline range [debug mode only].

Definition at line 29 of file tension_spline.cpp.

Friends And Related Function Documentation

friend class blueprints::C2TensionSpline
friend

Definition at line 147 of file tension_spline.hpp.

template<typename OutputStream >
OutputStream& operator<< ( OutputStream &  ostream,
const TensionSpline tension_spline 
)
friend

Streaming output insertion operator for for tension splines.

Streaming output insertion operator for tension splines. This lists in algebraic form the sequence of tension functions constituting the spline.

Template Parameters
OutputStream: the type of stream being used.
Parameters
ostream: the output stream being used.
tension_spline: the tension spline.
Returns
OutputStream : the output stream.

Definition at line 222 of file tension_spline.hpp.

Member Data Documentation

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

Definition at line 208 of file tension_spline.hpp.

Array<TensionFunction> ecl::TensionSpline::functions
private

Definition at line 209 of file tension_spline.hpp.

double ecl::TensionSpline::tension
private

Definition at line 210 of file tension_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