Public Member Functions | Static Public Member Functions | Private Attributes | Friends
ecl::SmoothLinearSpline Class Reference

Storage container for a smoothed linear spline interpolation. More...

#include <smooth_linear_spline.hpp>

List of all members.

Public Member Functions

double dderivative (const double &x) const ecl_assert_throw_decl(StandardException)
 Spline second derivative.
double derivative (const double &x) const ecl_assert_throw_decl(StandardException)
 Spline derivative.
const Array< double > & domain () const
 The discretised domain for this spline.
double operator() (const double &x) const ecl_assert_throw_decl(StandardException)
 Spline function.
 SmoothLinearSpline ()
 Default constructor.
 SmoothLinearSpline (const Array< double > &x_data, const Array< double > &y_data, double a_max) throw (DataException<int>)
 Constructor that properly configures the ramped spline.
virtual ~SmoothLinearSpline ()

Static Public Member Functions

static SmoothLinearSpline Interpolation (const Array< double > &x_data, const Array< double > &y_data, double a_max) throw (DataException<int>)
 Static construction that interpolates on a set of waypoints.

Private Attributes

Array< QuinticPolynomialcorners
Array< double > discretised_domain
Array< LinearFunctionsegments

Friends

template<typename OutputStream >
OutputStream & operator<< (OutputStream &ostream, const SmoothLinearSpline &smooth_linear_spline)
 Streaming output insertion operator for smoothed linear splines.

Detailed Description

Storage container for a smoothed linear spline interpolation.

These interpolations connect waypoints linearly and add a smoothed corner (using a quintic polynomial) to connect each linear segment. The shape of the corners is parameterised with a maximum curvature parameter (acceleration).

Math::Splines.

Definition at line 45 of file smooth_linear_spline.hpp.


Constructor & Destructor Documentation

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 53 of file smooth_linear_spline.hpp.

ecl::SmoothLinearSpline::SmoothLinearSpline ( const Array< double > &  x_data,
const Array< double > &  y_data,
double  a_max 
) throw (DataException<int>)

Constructor that properly configures the ramped spline.

The constructor uses the input data sets to initialise the segmentation. Corners are constrained by the maximum curvature (acceleration) - if construction should fail (not enough space between the waypoints) then this method will throw an exception indicating failure. It is accompanied with an int type data element that indicates the number of the segment that failed to construct. Failure typically occurs because the maximum curvature constraint at the corner was broken. Try increasing the maximum curvature constraint or increasing the time duration of the specified segment to ensure success a second time around.

Parameters:
a_max: the maximum bound (absolute) on the acceleration.
x_data: set of data on the domain axis.
y_data: set of values on the range axis.
Exceptions:
:DataException : throws if the spline could not be constructed because of broken a_max constraint.

The int data for the exception represents the element in the set which could not make a corner without breaking the acceleration constraint. Note that if you have a data set of size 5 (i.e. elements 0-4), then it will only throw between 1 and 3, as this is where smoothed corners are built.

Definition at line 30 of file smooth_linear_spline.cpp.

virtual ecl::SmoothLinearSpline::~SmoothLinearSpline ( ) [inline, virtual]

Definition at line 79 of file smooth_linear_spline.hpp.


Member Function Documentation

double ecl::SmoothLinearSpline::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 138 of file smooth_linear_spline.cpp.

double ecl::SmoothLinearSpline::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 125 of file smooth_linear_spline.cpp.

const Array<double>& ecl::SmoothLinearSpline::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 120 of file smooth_linear_spline.hpp.

static SmoothLinearSpline ecl::SmoothLinearSpline::Interpolation ( const Array< double > &  x_data,
const Array< double > &  y_data,
double  a_max 
) throw (DataException<int>) [inline, static]

Static construction that interpolates on a set of waypoints.

Static construction that interpolates on a set of waypoints.

Parameters:
x_data: set of data on the domain axis.
y_data: set of values on the range axis.
a_max: the maximum bound (absolute) on the acceleration.
Exceptions:
:DataException : throws if the spline could not be constructed, data is the segment # that failed.

Definition at line 136 of file smooth_linear_spline.hpp.

double ecl::SmoothLinearSpline::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 112 of file smooth_linear_spline.cpp.


Friends And Related Function Documentation

template<typename OutputStream >
OutputStream& operator<< ( OutputStream &  ostream,
const SmoothLinearSpline smooth_linear_spline 
) [friend]

Streaming output insertion operator for smoothed linear splines.

Streaming output insertion operator for smoothed linear splines. This simply lists the spline segments and corners (linear functions and quintic polynomials) in algebraic form.

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

Definition at line 176 of file smooth_linear_spline.hpp.


Member Data Documentation

Definition at line 168 of file smooth_linear_spline.hpp.

Definition at line 166 of file smooth_linear_spline.hpp.

Definition at line 167 of file smooth_linear_spline.hpp.


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


ecl_geometry
Author(s): Daniel Stonier
autogenerated on Mon Jul 3 2017 02:21:52