FiberVISH 0.2
Fish - The Fiber Bundle API for the Vish Visualization Shell
Public Types | Public Member Functions | Public Attributes | List of all members
Fiber::Interpolate< N, Type, Interpol, CoordinateType, Delimiter, DerivativeDimension > Struct Template Reference

The interpolator template. More...

#include <Interpolate.hpp>

Public Types

enum  { Dims = N }
 
typedef Type value_type
 
typedef MultiArray< N, Type > MultiArray_t
 
typedef MultiArray_t::Hyperslab_t SliceStorage_t
 
typedef FixedArray< CoordinateType, N > Point_t
 
typedef FixedArray< CoordinateType, N-1 > SubPoint_t
 

Public Member Functions

const MultiArray< N, Type > & MArray ()
 
 Interpolate (const MultiArray_t &m, const Point_t &point)
 Basic constructor.
 
 Interpolate (const MultiArray_t &m, const Eagle::VVector< N, CoordinateType > &point)
 Convenience constructor which takes a vvectorized coordinate point.
 
 Interpolate (const MultiArray_t &m, const FixedArray< CoordinateType, N > &point, const Delimiter &myDeli)
 
 Interpolate (const MultiArray_t &m, const Eagle::VVector< N, CoordinateType > &point, const Delimiter &myDeli)
 
Type operator[] (index_t i) const
 Perform an interpolation along the ${i-1}^th$ dimension, i.e.
 
index_t size () const
 
Type eval () const
 
Type operator() () const
 

Public Attributes

Delimiter myDelimiter
 

Detailed Description

template<int N, class Type, class Interpol, class CoordinateType, class Delimiter, int DerivativeDimension>
struct Fiber::Interpolate< N, Type, Interpol, CoordinateType, Delimiter, DerivativeDimension >

The interpolator template.

Recursive multidimensional interpolator of arbitrary degree.

The purpose of this class is to push the definition of a one-dimensional interpolator, defined in the ‘Interpol’ argument, to a n-dimensional regular grid in a recursive manner.

The interpolator is initialized with a reference to a interpolation point and a multidimensional array. The interpolated value is retrieved through the eval() function. For subsequent interpolation requests, the references interpolation point may be modified and the eval() function called again:

point = 5.5, 6.7, 8.8;
double value = DataField.eval();
point = 2.3, 4.5, 9.2;
value = DataField.eval();
An iterator with an optional DataCreator, which is just a class to intercept creation of data along a...
Definition CreativeIterator.hpp:34

At the same time, an Interpolator<> class instance looks like a one-dimensional vector<>, i.e. it provides the [] operator and a size() member function. Calling these functions allows to traverse an interpolated one-dimensional line which has its coordinates fixed to those of the current interpolation point.

Parameters
DerivativeDimensionThe interpolator may also compute the derivative by the nth coordinate during interpolation. This parameter specifies the coordinate for which the derivation should be performed. It is straightforward to compute the derivative during interpolation since then derivative of the interpolation formulas can be employed. The derivative dimension is a compile-time parameter because the resulting Interpolate object is intended to conform to the concept of an array, i.e. it shall provide an [] operator which is indiced with a single index only. There is no way to specify another parameter through this interface. As this parameter is required only locally within operator[], technically it were also possible to provide the derivative dimension as a runtime parameter (e.g. as a member variable or a different interface), if the actual reason indeed arises somewhen. For usual interpolation with no derivative, set this parameter to a negative value.
DelimiterAn object that is forwarded to the one-dimensional interpolator from the uppermost level. Its layout is not used by the Interpolate class, but the one-dimensional interpolators may use it to e.g. perform local alignment of eigenvector fields on all interpolation vertices. With no special needs, class NoDelimiter<Type> may be used here.
InterpolA one-dimensional interpolator type. Currently implemented one-dimensional interpolators are
  1. NearestNeighborIpol (fastest, but nothing really precise)
  2. LinearIpol (speedy, providing fair results)
  3. FastCubicIpol (nearly same speed as LinearIpol, but with smooth derivatives)
  4. CubicIpol (slower than linear, but very accurate)
  5. CatMullRomSpline (advanced, but apparently same as cubic, little slower)
CoordinateTypeExplicit specification on which coordinates are to be used for interpolation. This type is used for storing the local point of interest, which is actually a reference to an external variable. There is not much need to specify something else than float or double here. In conjunction with the dimensionality parameter N it defines the coordinates on the underlying manifold. The actual interpolation type is then of type FixedArray<N,CoordinateType>.
NThe dimensionality of the underlying manifold. This interpolator is good for MultiArrays of same dimension.
TypeThe type of the field defined on each element of a MultiArray to be interpolated. The result of the interpolation will be of same type. Note that this type does not need to be the same as the value type of the Storage: It may be double, whereas the Storage contains unsigned char's, thereby yielding interpolated doubles from unsigned char values (which is of course more precise).

Constructor & Destructor Documentation

◆ Interpolate() [1/2]

template<int N, class Type , class Interpol , class CoordinateType , class Delimiter , int DerivativeDimension>
Fiber::Interpolate< N, Type, Interpol, CoordinateType, Delimiter, DerivativeDimension >::Interpolate ( const MultiArray_t m,
const Point_t point 
)
inline

Basic constructor.

Parameters
mThe multidimensional array which provides the data for a multidimensional index.
pointThe fractional index location where the data value is to be computed.

◆ Interpolate() [2/2]

template<int N, class Type , class Interpol , class CoordinateType , class Delimiter , int DerivativeDimension>
Fiber::Interpolate< N, Type, Interpol, CoordinateType, Delimiter, DerivativeDimension >::Interpolate ( const MultiArray_t m,
const Eagle::VVector< N, CoordinateType > &  point 
)
inline

Convenience constructor which takes a vvectorized coordinate point.

Parameters
mThe multidimensional array which provides the data for a multidimensional index.
pointThe fractional index location where the data value is to be computed.

Member Function Documentation

◆ operator[]()

template<int N, class Type , class Interpol , class CoordinateType , class Delimiter , int DerivativeDimension>
Type Fiber::Interpolate< N, Type, Interpol, CoordinateType, Delimiter, DerivativeDimension >::operator[] ( index_t  i) const
inline

Perform an interpolation along the ${i-1}^th$ dimension, i.e.

the highest dimension of the interpolation point is ignored.