ecl::TensionFunction Class Reference

Representation of a tension function. More...

`#include <tension_function.hpp>`

Inheritance diagram for ecl::TensionFunction:

## Public Member Functions | |

double | dderivative (const double &tau, const double &x) const |

Generates the 2nd derivative for a certain tension at the specified point. | |

double | derivative (const double &tau, const double &x) const |

Generates the derivative for a certain tension at the specified point. | |

double | operator() (const double &tau, const double &x) const |

Calculates the value for a certain tension at the specified point. | |

TensionFunction () | |

Default constructor. | |

template<typename Derived > | |

TensionFunction (const BluePrint< Derived > &blueprint) | |

Blueprint constructor. | |

virtual | ~TensionFunction () |

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

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 110 of file tension_function.hpp.

ecl::TensionFunction::TensionFunction | ( | ) | ` [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 121 of file tension_function.hpp.

virtual ecl::TensionFunction::~TensionFunction | ( | ) | ` [inline, virtual]` |

Definition at line 122 of file tension_function.hpp.

template<typename Derived >

ecl::TensionFunction::TensionFunction | ( | 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.

TensionFunction f = TensionFunction::Interpolation(2.0,0.0,0.0,3.0,1.0,0.0);

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

TensionFunction f; f = TensionFunction::Interpolation(2.0,0.0,0.0,3.0,1.0,0.0);

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

Definition at line 146 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.

**Parameters:**-
tau : the tension parameter. x : the point at which you wish to calculate the value for.

**Returns:**- double : the value of the 2nd derivative at x for tension tau.

Definition at line 37 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.

**Parameters:**-
tau : the tension parameter. x : the point at which you wish to calculate the value for.

**Returns:**- double : the value of the derivative at x for tension tau.

Definition at line 26 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.

**Parameters:**-
tau : the tension parameter. x : the point at which you wish to calculate the value for.

**Returns:**- double : the value of the function at x for tension tau.

Definition at line 45 of file lib/tension_function.cpp.

friend class blueprints::TensionSecondDerivativeInterpolation` [friend]` |

Definition at line 195 of file tension_function.hpp.

template<typename OutputStream >

OutputStream& operator<< | ( | OutputStream & | ostream, |

const TensionFunction & | function |
||

) | ` [friend]` |

Streaming output insertion operator for tension functions.

Streaming output insertion operator for tension functions.

**Template Parameters:**-
OutputStream : the type of stream being used.

**Parameters:**-
ostream : the output stream being used. function : the tension function.

**Returns:**- OutputStream : the output stream.

Definition at line 223 of file tension_function.hpp.

double ecl::TensionFunction::x_0` [private]` |

Definition at line 203 of file tension_function.hpp.

double ecl::TensionFunction::x_f` [private]` |

Definition at line 203 of file tension_function.hpp.

double ecl::TensionFunction::y_0` [private]` |

Definition at line 204 of file tension_function.hpp.

double ecl::TensionFunction::y_f` [private]` |

Definition at line 204 of file tension_function.hpp.

double ecl::TensionFunction::z_0` [private]` |

Definition at line 202 of file tension_function.hpp.

double ecl::TensionFunction::z_f` [private]` |

Definition at line 202 of file tension_function.hpp.

The documentation for this class was generated from the following files: