Representation of a tension function. More...
#include <tension_function.hpp>
Public Member Functions | |
double | dderivative (const double &tau, const double &x) const |
Generates the 2nd derivative for a certain tension at the specified point. More... | |
double | derivative (const double &tau, const double &x) const |
Generates the derivative for a certain tension at the specified point. More... | |
double | operator() (const double &tau, const double &x) const |
Calculates the value for a certain tension at the specified point. More... | |
TensionFunction () | |
Default constructor. More... | |
template<typename Derived > | |
TensionFunction (const BluePrint< Derived > &blueprint) | |
Blueprint constructor. More... | |
virtual | ~TensionFunction () |
Public Member Functions inherited from ecl::BluePrintFactory< TensionFunction > | |
virtual | ~BluePrintFactory () |
Private Attributes | |
double | x_0 |
double | x_f |
double | y_0 |
double | y_f |
double | z_0 |
double | z_f |
Friends | |
class | blueprints::TensionSecondDerivativeInterpolation |
template<typename OutputStream > | |
OutputStream & | operator<< (OutputStream &ostream, const TensionFunction &function) |
Streaming output insertion operator for tension functions. More... | |
Additional Inherited Members | |
Static Public Member Functions inherited from ecl::BluePrintFactory< TensionFunction > | |
static blueprints::TensionSecondDerivativeInterpolation | Interpolation (const double x_i, const double y_i, const double yddot_i, const double x_f, const double y_f, const double yddot_f) |
Blueprint for interpolating a tension function between two end points using second derivatives. More... | |
Representation of a tension function.
This is a hyperbolic function often used in spline interpolations that parameterises the 'tension' of a curve interpolation between points. At low tension it behaves like a cubic polynomial, while at high tension, it tends towards a piecewise smooth series of linear functions.
Theoretical Notes:
Tension functions are derived from the following constraints on an interval [x_i, x_i+1]:
f'''' - tau^2 f'' = 0 f(x_i) = y_i f(x_i+1) = y_i+1 f''(x_i) = z_i f''(x_i+1) = z_i+1
This yields a C2 continuous function with hyperbolic terms (not a polynomial) that ranges from looking like a cubic interpolation at low tensions (tau -> 0) and a linearly blended interpolation at high tensions.
Definition at line 116 of file tension_function.hpp.
|
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 129 of file tension_function.hpp.
|
inlinevirtual |
Definition at line 130 of file tension_function.hpp.
|
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.
Since this is not explicit, it will also allow assignment.
This will emit a compile time failure if the template argument does not conform to the blueprints concept (refer to ecl_concepts' documentation).
blueprint | : the blue print to use to generate this instance. |
Definition at line 154 of file tension_function.hpp.
double ecl::TensionFunction::dderivative | ( | const double & | tau, |
const double & | x | ||
) | const |
Generates the 2nd derivative for a certain tension at the specified point.
Calculates the value of the 2nd derivative for a certain tension at the specified point.
tau | : the tension parameter. |
x | : the point at which you wish to calculate the value for. |
Definition at line 41 of file lib/tension_function.cpp.
double ecl::TensionFunction::derivative | ( | const double & | tau, |
const double & | x | ||
) | const |
Generates the derivative for a certain tension at the specified point.
Calculates the value of the derivative for a certain tension at the specified point.
tau | : the tension parameter. |
x | : the point at which you wish to calculate the value for. |
Definition at line 30 of file lib/tension_function.cpp.
double ecl::TensionFunction::operator() | ( | const double & | tau, |
const double & | x | ||
) | const |
Calculates the value for a certain tension at the specified point.
Calculates the value for a certain tension at the specified point.
tau | : the tension parameter. |
x | : the point at which you wish to calculate the value for. |
Definition at line 49 of file lib/tension_function.cpp.
|
friend |
Definition at line 203 of file tension_function.hpp.
|
friend |
Streaming output insertion operator for tension functions.
Streaming output insertion operator for tension functions.
OutputStream | : the type of stream being used. |
ostream | : the output stream being used. |
function | : the tension function. |
Definition at line 229 of file tension_function.hpp.
|
private |
Definition at line 211 of file tension_function.hpp.
|
private |
Definition at line 211 of file tension_function.hpp.
|
private |
Definition at line 212 of file tension_function.hpp.
|
private |
Definition at line 212 of file tension_function.hpp.
|
private |
Definition at line 210 of file tension_function.hpp.
|
private |
Definition at line 210 of file tension_function.hpp.