Rythmos - Transient Integration for Differential Equations Version of the Day
Public Member Functions | Related Functions
Rythmos::InterpolatorBase< Scalar > Class Template Reference

Base strategy class for interpolation functionality. More...

#include <Rythmos_InterpolatorBase.hpp>

Inheritance diagram for Rythmos::InterpolatorBase< Scalar >:
Inheritance graph
[legend]

List of all members.

Public Member Functions

virtual bool supportsCloning () const
 Return if this interpolator supports cloning or not.
virtual Teuchos::RCP
< InterpolatorBase< Scalar > > 
cloneInterpolator () const
 Clone the interpolator object if supported.
virtual void setNodes (const RCP< const typename DataStore< Scalar >::DataStoreVector_t > &nodes)=0
 Store pointer to interpolation nodes.
virtual void interpolate (const Array< Scalar > &t_values, typename DataStore< Scalar >::DataStoreVector_t *data_out) const =0
 Perform an interpolation.
virtual int order () const =0
 Return the order of the interpolation.

Related Functions

(Note that these are not member functions.)

template<class Scalar >
void assertBaseInterpolatePreconditions (const typename DataStore< Scalar >::DataStoreVector_t &data_in, const Array< Scalar > &t_values, typename DataStore< Scalar >::DataStoreVector_t *data_out)

Detailed Description

template<class Scalar>
class Rythmos::InterpolatorBase< Scalar >

Base strategy class for interpolation functionality.

ToDo: Finish documentation!

Definition at line 44 of file Rythmos_InterpolatorBase.hpp.


Member Function Documentation

template<class Scalar >
bool Rythmos::InterpolatorBase< Scalar >::supportsCloning ( ) const [virtual]

Return if this interpolator supports cloning or not.

If returnVal==true, then cloneInterpolator() will clone *this object and return an non-null RCP.

The default implementation of this function simply returns false.

Reimplemented in Rythmos::CubicSplineInterpolator< Scalar >, and Rythmos::LinearInterpolator< Scalar >.

Definition at line 137 of file Rythmos_InterpolatorBase.hpp.

template<class Scalar >
Teuchos::RCP< InterpolatorBase< Scalar > > Rythmos::InterpolatorBase< Scalar >::cloneInterpolator ( ) const [virtual]

Clone the interpolator object if supported.

Postconditions:

[supportsCloning()==true] returnVal != Teuchos::null [supportsCloning()==false] returnVal == Teuchos::null

The default implementation returns Teuchos::null which is consistent with the default implementation of supportsCloning(). If this function is overridden in a base class to support cloning, then supportsCloning() must be overridden to return true.

Reimplemented in Rythmos::CubicSplineInterpolator< Scalar >, and Rythmos::LinearInterpolator< Scalar >.

Definition at line 145 of file Rythmos_InterpolatorBase.hpp.

template<class Scalar >
virtual void Rythmos::InterpolatorBase< Scalar >::setNodes ( const RCP< const typename DataStore< Scalar >::DataStoreVector_t > &  nodes) [pure virtual]

Store pointer to interpolation nodes.

This function represent a persisting relationship between the interpolation nodes and the interpolator. For simple interpolators like linear and Hermite, this is not needed, but for interpolators like cubic splines where there is some computational work in assembling the interpolant, this is important.

Preconditions:

  • nodes must have unique time values and be sorted in ascending time order

Postconditions:

  • If this function is called twice and nodes is a different pointer than was previously called, then it is possible that the interpolant will be recomputed when interpolate is next called.

Implemented in Rythmos::CubicSplineInterpolator< Scalar >, Rythmos::HermiteInterpolator< Scalar >, and Rythmos::LinearInterpolator< Scalar >.

template<class Scalar >
virtual void Rythmos::InterpolatorBase< Scalar >::interpolate ( const Array< Scalar > &  t_values,
typename DataStore< Scalar >::DataStoreVector_t *  data_out 
) const [pure virtual]

Perform an interpolation.

This function must support passing node values back out directly, handling when only one node value is passed in, and dealing with xdot==Teuchos::null.

Preconditions:

  • if nodes->size()==1 then t_values[0] == (*nodes)[0].time
  • t_values must have unique and sorted values in ascending order
  • nodes->front().time <= t_values[i] <= nodes->back().time for all t=0..time_values.size()-1
  • (*nodes)[i].x != Teuchos::null for all i=0..nodes->size()-1

Postconditions:

  • data_out will come out sorted in ascending time order
  • if (*nodes)[i].xdot == Teuchos::null then all t_values in the interval (*nodes)[i-1]..(*nodes)[i+1] will have xdot = Tuechos::null.

Implemented in Rythmos::CubicSplineInterpolator< Scalar >, Rythmos::HermiteInterpolator< Scalar >, and Rythmos::LinearInterpolator< Scalar >.

template<class Scalar >
virtual int Rythmos::InterpolatorBase< Scalar >::order ( ) const [pure virtual]

Return the order of the interpolation.

2007/05/18: rabartl: ToDo: Define what "order" means.

Implemented in Rythmos::CubicSplineInterpolator< Scalar >, Rythmos::HermiteInterpolator< Scalar >, and Rythmos::LinearInterpolator< Scalar >.


Friends And Related Function Documentation

template<class Scalar >
void assertBaseInterpolatePreconditions ( const typename DataStore< Scalar >::DataStoreVector_t &  data_in,
const Array< Scalar > &  t_values,
typename DataStore< Scalar >::DataStoreVector_t *  data_out 
) [related]

Definition at line 53 of file Rythmos_InterpolatorBaseHelpers.hpp.


The documentation for this class was generated from the following files:
 All Classes Functions Variables Typedefs Friends