This class interpolates multi-dimensional data sets. More...
#include <MultiDimensionalInterpolation.h>
Public Member Functions | |
MultiDimensionalInterpolationTempl (const std::vector< std::vector< Real >> &base_points, const MultiIndex< Real > &data) | |
Constructor, Takes a double vector containing the interpolation base points, and a MultiIndex object. More... | |
MultiDimensionalInterpolationTempl () | |
virtual | ~MultiDimensionalInterpolationTempl ()=default |
unsigned int | dim () const |
returns the dimensionality of this interpolation object More... | |
void | setData (const std::vector< std::vector< Real >> &base_points, const MultiIndex< Real > &data) |
sets data but also fixes degenerate dimensions in data More... | |
void | linearSearch (std::vector< T > &values, MultiIndex< Real >::size_type &indices) const |
linearSearch finds the indices i_k of the base point such that base_point[d][i_k] <= values[d] < base_point[d][i_k + 1] Note that argument is non-const to handle smaller/larger than tabulation range For tabulations < 100 entries, linearSearch is expected to be better than bisection search More... | |
T | multiLinearInterpolation (const std::vector< T > &x) const |
This function will take an independent variable input and will return the dependent variable based on multi-linear interpolation. More... | |
Protected Member Functions | |
void | errorCheck () |
checks consistency of the data More... | |
unsigned int | linearSearchHelper (T &x, const std::vector< Real > &vector) const |
linear search helper for a single std::vector; note that argument is non-const to handle smaller/larger than tabulation range More... | |
Protected Attributes | |
unsigned int | _original_dim |
original dimension is to allow checks on user inputs for cases where arrays are sliced More... | |
std::vector< bool > | _degenerate_index |
this variable keeps track on which dimension is degenerate and was removed More... | |
bool | _degenerate_interpolation = false |
if all dimensions have size one then there is only one value to return this corner case should be supported so the calling routine does not need to check for it More... | |
Private Attributes | |
std::vector< std::vector< Real > > | _base_points |
MultiIndex< Real > | _data |
bool | _setup_complete = false |
This class interpolates multi-dimensional data sets.
Definition at line 23 of file MultiDimensionalInterpolation.h.
MultiDimensionalInterpolationTempl< T >::MultiDimensionalInterpolationTempl | ( | const std::vector< std::vector< Real >> & | base_points, |
const MultiIndex< Real > & | data | ||
) |
Constructor, Takes a double vector containing the interpolation base points, and a MultiIndex object.
The double vector base_points and the MultiIndex object data must
Definition at line 17 of file MultiDimensionalInterpolation.C.
MultiDimensionalInterpolationTempl< T >::MultiDimensionalInterpolationTempl | ( | ) |
Definition at line 25 of file MultiDimensionalInterpolation.C.
|
virtualdefault |
|
inline |
returns the dimensionality of this interpolation object
Definition at line 37 of file MultiDimensionalInterpolation.h.
|
protected |
checks consistency of the data
Definition at line 91 of file MultiDimensionalInterpolation.C.
void MultiDimensionalInterpolationTempl< T >::linearSearch | ( | std::vector< T > & | values, |
MultiIndex< Real >::size_type & | indices | ||
) | const |
linearSearch finds the indices i_k of the base point such that base_point[d][i_k] <= values[d] < base_point[d][i_k + 1] Note that argument is non-const to handle smaller/larger than tabulation range For tabulations < 100 entries, linearSearch is expected to be better than bisection search
Definition at line 127 of file MultiDimensionalInterpolation.C.
|
protected |
linear search helper for a single std::vector; note that argument is non-const to handle smaller/larger than tabulation range
Definition at line 139 of file MultiDimensionalInterpolation.C.
T MultiDimensionalInterpolationTempl< T >::multiLinearInterpolation | ( | const std::vector< T > & | x | ) | const |
This function will take an independent variable input and will return the dependent variable based on multi-linear interpolation.
Multi-linear interpolation uses all 2^d values in the base points surrounding x.
Definition at line 182 of file MultiDimensionalInterpolation.C.
void MultiDimensionalInterpolationTempl< T >::setData | ( | const std::vector< std::vector< Real >> & | base_points, |
const MultiIndex< Real > & | data | ||
) |
sets data but also fixes degenerate dimensions in data
Definition at line 32 of file MultiDimensionalInterpolation.C.
|
private |
Definition at line 81 of file MultiDimensionalInterpolation.h.
|
private |
Definition at line 82 of file MultiDimensionalInterpolation.h.
|
protected |
this variable keeps track on which dimension is degenerate and was removed
Definition at line 71 of file MultiDimensionalInterpolation.h.
|
protected |
if all dimensions have size one then there is only one value to return this corner case should be supported so the calling routine does not need to check for it
Definition at line 78 of file MultiDimensionalInterpolation.h.
|
protected |
original dimension is to allow checks on user inputs for cases where arrays are sliced
Definition at line 68 of file MultiDimensionalInterpolation.h.
Referenced by MultiDimensionalInterpolationTempl< T >::dim().
|
private |
Definition at line 83 of file MultiDimensionalInterpolation.h.