O_SESSAME::NaturalCubicSplineInterpolator Class Reference
[Interpolation Library]

#include <NaturalCubicSplineInterpolator.h>

Inheritance diagram for O_SESSAME::NaturalCubicSplineInterpolator:

Inheritance graph
[legend]
List of all members.

Detailed Description

Interpolates between a given set of data points to create a smooth function.

Works for either a single function, or Vector of functions (such as interpolating a state)

Definition at line 24 of file NaturalCubicSplineInterpolator.h.

Public Member Functions

 NaturalCubicSplineInterpolator ()
 Creates an empty natural cubic spline interpolation.

 NaturalCubicSplineInterpolator (const Vector &_inputPoints, const Matrix &_outputPoints)
 Creates a natural cubic spline interpolation.

virtual void Interpolate (const Vector &_timePoints, const Matrix &_dataPoints)
 Creates an interpolation from the vector of time points and matrix of corresponding data points.

virtual Vector Evaluate (const double &_inputPoint)
 Evaluate interpolation curve at a specified time.

virtual int GetNumberDataPoints ()
 Returns the number of data points required for interpolation.

virtual NaturalCubicSplineInterpolator * NewPointer ()
 Return a pointer to a new instance of a natural cubic spline interpolator type.

virtual NaturalCubicSplineInterpolator * Clone ()
 Return a pointer to a copy of the natural cubic spline interpolator instance.

virtual bool GetValid ()
 Returns whether the current interpolation parameters are valid.


Protected Member Functions

void BuildNaturalCubicSplineInterpolation (const double &_x1, const double &_y1, const double &_x2, const double &_y2, double &_Slope, double &_Offset)
 Computes the parameters of the natural cubic spline interpolation given the data points.

virtual void SetNumberDataPoints (const int &_numberDataPoints)
 Doesn't do anything for linear interpolator since there are always only 2 data points.

virtual void SetValid (const bool &_newValidValue)
 Sets the validity value of the interpolation parameters.


Private Attributes

int m_NumDataPoints
 Number of data points used for interpolation, should always be 2 for linear interpolation.

int m_NumElements
 Number of elements in the state vector.

Matrix m_Acoeff
Matrix m_Bcoeff
Matrix m_Ccoeff
Matrix m_Dcoeff
Vector m_tempOutput


Constructor & Destructor Documentation

O_SESSAME::NaturalCubicSplineInterpolator::NaturalCubicSplineInterpolator  ) 
 

Creates an empty natural cubic spline interpolation.

Definition at line 15 of file NaturalCubicSplineInterpolator.cpp.

O_SESSAME::NaturalCubicSplineInterpolator::NaturalCubicSplineInterpolator const Vector _inputPoints,
const Matrix _outputPoints
 

Creates a natural cubic spline interpolation.

Definition at line 20 of file NaturalCubicSplineInterpolator.cpp.


Member Function Documentation

void O_SESSAME::NaturalCubicSplineInterpolator::Interpolate const Vector _timePoints,
const Matrix _dataPoints
[virtual]
 

Creates an interpolation from the vector of time points and matrix of corresponding data points.

Parameters:
_timePoints Vector of time (seconds) points of the data values.
_dataPoints Matrix of data points at each time step in the _timePoints vector. [x1(t1) x2(t1) x3(t1) ... ] [x1(t2) x2(t2) x3(t2) ... ]

Implements O_SESSAME::Interpolator.

Definition at line 29 of file NaturalCubicSplineInterpolator.cpp.

Vector O_SESSAME::NaturalCubicSplineInterpolator::Evaluate const double &  _inputPoint  )  [virtual]
 

Evaluate interpolation curve at a specified time.

Output = m_Slope * _inputPoint + m_Offset

Parameters:
_inputPoint Input point (time) at which to evaluate the vector of interpolations.
Returns:
Vector of output values from the evaluated interpolation.

Implements O_SESSAME::Interpolator.

Definition at line 50 of file NaturalCubicSplineInterpolator.cpp.

virtual int O_SESSAME::NaturalCubicSplineInterpolator::GetNumberDataPoints  )  [virtual]
 

Returns the number of data points required for interpolation.

the number of data points is the number of X-values (time) required to interpolate.

Returns:
the number of data points, centered about the evaluation time, req'd to interpolate.

Implements O_SESSAME::Interpolator.

Definition at line 59 of file NaturalCubicSplineInterpolator.h.

NaturalCubicSplineInterpolator * O_SESSAME::NaturalCubicSplineInterpolator::NewPointer  )  [virtual]
 

Return a pointer to a new instance of a natural cubic spline interpolator type.

This is used to request memory for a new instance of a NaturalCubicSplineInterpolator. It is necessary when attempting to get a pointer from the abstract data type Interpolator and the actual representation type isn't known.

Returns:
a pointer to a new allocation of memory for the NaturalCubicSplineInterpolator object.

Implements O_SESSAME::Interpolator.

Definition at line 67 of file NaturalCubicSplineInterpolator.cpp.

NaturalCubicSplineInterpolator * O_SESSAME::NaturalCubicSplineInterpolator::Clone  )  [virtual]
 

Return a pointer to a copy of the natural cubic spline interpolator instance.

This is used to request memory for a copy of this instance of NaturalCubicSplineInterpolator. It is necessary when attempting to get a pointer from the abstract data type Interpolator and the actual representation type isn't known.

Returns:
a pointer to a copy of the NaturalCubicSplineInterpolator object.

Implements O_SESSAME::Interpolator.

Definition at line 72 of file NaturalCubicSplineInterpolator.cpp.

void O_SESSAME::NaturalCubicSplineInterpolator::BuildNaturalCubicSplineInterpolation const double &  _x1,
const double &  _y1,
const double &  _x2,
const double &  _y2,
double &  _Slope,
double &  _Offset
[protected]
 

Computes the parameters of the natural cubic spline interpolation given the data points.

Definition at line 62 of file NaturalCubicSplineInterpolator.cpp.

virtual void O_SESSAME::NaturalCubicSplineInterpolator::SetNumberDataPoints const int &  _numberDataPoints  )  [protected, virtual]
 

Doesn't do anything for linear interpolator since there are always only 2 data points.

Definition at line 86 of file NaturalCubicSplineInterpolator.h.

virtual bool O_SESSAME::Interpolator::GetValid  )  [virtual, inherited]
 

Returns whether the current interpolation parameters are valid.

Returns:
TRUE if the current interpolation is valid, FALSE if it is not and should not be used to Evaluate without being reinterpolated.

Definition at line 116 of file Interpolator.h.

virtual void O_SESSAME::Interpolator::SetValid const bool &  _newValidValue  )  [protected, virtual, inherited]
 

Sets the validity value of the interpolation parameters.

Definition at line 122 of file Interpolator.h.


Member Data Documentation

int O_SESSAME::NaturalCubicSplineInterpolator::m_NumDataPoints [private]
 

Number of data points used for interpolation, should always be 2 for linear interpolation.

Definition at line 90 of file NaturalCubicSplineInterpolator.h.

int O_SESSAME::NaturalCubicSplineInterpolator::m_NumElements [private]
 

Number of elements in the state vector.

Used to determine how many linear interpolations there are per data set.

Definition at line 92 of file NaturalCubicSplineInterpolator.h.

Matrix O_SESSAME::NaturalCubicSplineInterpolator::m_Acoeff [private]
 

Definition at line 94 of file NaturalCubicSplineInterpolator.h.

Matrix O_SESSAME::NaturalCubicSplineInterpolator::m_Bcoeff [private]
 

Definition at line 95 of file NaturalCubicSplineInterpolator.h.

Matrix O_SESSAME::NaturalCubicSplineInterpolator::m_Ccoeff [private]
 

Definition at line 96 of file NaturalCubicSplineInterpolator.h.

Matrix O_SESSAME::NaturalCubicSplineInterpolator::m_Dcoeff [private]
 

Definition at line 97 of file NaturalCubicSplineInterpolator.h.

Vector O_SESSAME::NaturalCubicSplineInterpolator::m_tempOutput [private]
 

Definition at line 99 of file NaturalCubicSplineInterpolator.h.


Generated on Wed Aug 6 12:59:32 2003 for Open-Sessame Framework by doxygen1.3