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
 Spline second derivative. More...
 
double derivative (const double &x) const
 Spline derivative. More...
 
const Array< double > & domain () const
 The discretised domain for this spline. More...
 
double operator() (const double &x) const
 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)
 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 101 of file tension_spline.hpp.

Member Typedef Documentation

◆ Factory

Generates blueprints for this class.

Definition at line 108 of file tension_spline.hpp.

Constructor & Destructor Documentation

◆ TensionSpline() [1/2]

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 119 of file tension_spline.hpp.

◆ ~TensionSpline()

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

Definition at line 120 of file tension_spline.hpp.

◆ TensionSpline() [2/2]

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 148 of file tension_spline.hpp.

Member Function Documentation

◆ dderivative()

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

◆ derivative()

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

◆ domain()

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 195 of file tension_spline.hpp.

◆ operator()()

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

Friends And Related Function Documentation

◆ blueprints::C2TensionSpline

friend class blueprints::C2TensionSpline
friend

Definition at line 155 of file tension_spline.hpp.

◆ operator<<

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 228 of file tension_spline.hpp.

Member Data Documentation

◆ discretised_domain

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

Definition at line 216 of file tension_spline.hpp.

◆ functions

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

Definition at line 217 of file tension_spline.hpp.

◆ tension

double ecl::TensionSpline::tension
private

Definition at line 218 of file tension_spline.hpp.


The documentation for this class was generated from the following files:
ecl::BluePrintFactory< TensionSpline >::Natural
static blueprints::C2TensionSpline Natural(const Array< double > &x_set, const Array< double > &y_set, const double &tau)
Tension spline blueprint satisfying y, y' and y'' continuity with y''_0 = y''_f = 0.
Definition: tension_spline_blueprints.cpp:129
ecl::TensionSpline::tension
double tension
Definition: tension_spline.hpp:218
ecl::TensionSpline::TensionSpline
TensionSpline()
Default constructor.
Definition: tension_spline.hpp:119


ecl_geometry
Author(s): Daniel Stonier
autogenerated on Wed Mar 2 2022 00:16:40