|
#include <LinInterpolatedTableND.hh>
|
typedef Numeric | value_type |
|
typedef Axis | axis_type |
|
|
| LinInterpolatedTableND (const std::vector< Axis > &axes, const std::vector< std::pair< bool, bool > > &extrapolationType, const char *functionLabel=0) |
|
| LinInterpolatedTableND (const Axis &xAxis, bool leftX, bool rightX, const char *functionLabel=0) |
|
| LinInterpolatedTableND (const Axis &xAxis, bool leftX, bool rightX, const Axis &yAxis, bool leftY, bool rightY, const char *functionLabel=0) |
|
| LinInterpolatedTableND (const Axis &xAxis, bool leftX, bool rightX, const Axis &yAxis, bool leftY, bool rightY, const Axis &zAxis, bool leftZ, bool rightZ, const char *functionLabel=0) |
|
| LinInterpolatedTableND (const Axis &xAxis, bool leftX, bool rightX, const Axis &yAxis, bool leftY, bool rightY, const Axis &zAxis, bool leftZ, bool rightZ, const Axis &tAxis, bool leftT, bool rightT, const char *functionLabel=0) |
|
| LinInterpolatedTableND (const Axis &xAxis, bool leftX, bool rightX, const Axis &yAxis, bool leftY, bool rightY, const Axis &zAxis, bool leftZ, bool rightZ, const Axis &tAxis, bool leftT, bool rightT, const Axis &vAxis, bool leftV, bool rightV, const char *functionLabel=0) |
|
template<class Num2 > |
| LinInterpolatedTableND (const LinInterpolatedTableND< Num2, Axis > &) |
|
Numeric | operator() (const double *point, unsigned dim) const |
|
Numeric | operator() (const double &x0) const |
|
Numeric | operator() (const double &x0, const double &x1) const |
|
Numeric | operator() (const double &x0, const double &x1, const double &x2) const |
|
Numeric | operator() (const double &x0, const double &x1, const double &x2, const double &x3) const |
|
Numeric | operator() (const double &x0, const double &x1, const double &x2, const double &x3, const double &x4) const |
|
unsigned | dim () const |
|
const std::vector< Axis > & | axes () const |
|
const Axis & | axis (const unsigned i) const |
|
unsigned long | length () const |
|
bool | leftInterpolationLinear (unsigned i) const |
|
bool | rightInterpolationLinear (unsigned i) const |
|
std::vector< std::pair< bool, bool > > | interpolationType () const |
|
const std::string & | functionLabel () const |
|
const ArrayND< Numeric > & | table () const |
|
ArrayND< Numeric > & | table () |
|
void | getCoords (unsigned long linearIndex, double *coords, unsigned coordsBufferSize) const |
|
bool | isUniformlyBinned () const |
|
bool | isWithinLimits (const double *point, unsigned dim) const |
|
void | setFunctionLabel (const char *newlabel) |
|
template<typename ConvertibleToUnsigned > |
CPP11_auto_ptr< LinInterpolatedTableND > | invertWRTAxis (ConvertibleToUnsigned axisNumber, const Axis &replacementAxis, bool newAxisLeftLinear, bool newAxisRightLinear, const char *functionLabel=0) const |
|
template<class Functor1 , class Functor2 > |
CPP11_auto_ptr< LinInterpolatedTableND > | invertRatioResponse (unsigned axisNumber, const Axis &replacementAxis, bool newAxisLeftLinear, bool newAxisRightLinear, Functor1 invg, Functor2 invh, const char *functionLabel=0) const |
|
bool | operator== (const LinInterpolatedTableND &) const |
|
bool | operator!= (const LinInterpolatedTableND &r) const |
|
gs::ClassId | classId () const |
|
bool | write (std::ostream &of) const |
|
|
static const char * | classname () |
|
static unsigned | version () |
|
static LinInterpolatedTableND * | read (const gs::ClassId &id, std::istream &in) |
|
template<class Numeric, class Axis = UniformAxis>
class npstat::LinInterpolatedTableND< Numeric, Axis >
Template for multilinear interpolation/extrapolation of values provided on a rectangular coordinate grid. "Numeric" is the type stored in the table. "Axis" should be one of GridAxis, UniformAxis, or DualAxis classes or a user-provided class with a similar set of methods.
◆ LinInterpolatedTableND() [1/7]
template<class Numeric , class Axis = UniformAxis>
Main constructor for arbitrary-dimensional interpolators.
"axes" are the axes of the rectangular coordinate grid.
In each pair provided by the "extrapolationType" argument, the first element of the pair specifies whether the extrapolation to negative infinity should be linear (if "true") or constant (if "false"). The second element of the pair specifies whether to extrapolate linearly to positive infinity.
"functionLabel" is an arbitrary string which can potentially be used by plotting programs and such.
◆ LinInterpolatedTableND() [2/7]
template<class Numeric , class Axis = UniformAxis>
Convenience constructor for 1-d interpolators
◆ LinInterpolatedTableND() [3/7]
template<class Numeric , class Axis = UniformAxis>
Convenience constructor for 2-d interpolators
◆ LinInterpolatedTableND() [4/7]
template<class Numeric , class Axis = UniformAxis>
npstat::LinInterpolatedTableND< Numeric, Axis >::LinInterpolatedTableND |
( |
const Axis & |
xAxis, |
|
|
bool |
leftX, |
|
|
bool |
rightX, |
|
|
const Axis & |
yAxis, |
|
|
bool |
leftY, |
|
|
bool |
rightY, |
|
|
const Axis & |
zAxis, |
|
|
bool |
leftZ, |
|
|
bool |
rightZ, |
|
|
const char * |
functionLabel = 0 |
|
) |
| |
Convenience constructor for 3-d interpolators
◆ LinInterpolatedTableND() [5/7]
template<class Numeric , class Axis = UniformAxis>
npstat::LinInterpolatedTableND< Numeric, Axis >::LinInterpolatedTableND |
( |
const Axis & |
xAxis, |
|
|
bool |
leftX, |
|
|
bool |
rightX, |
|
|
const Axis & |
yAxis, |
|
|
bool |
leftY, |
|
|
bool |
rightY, |
|
|
const Axis & |
zAxis, |
|
|
bool |
leftZ, |
|
|
bool |
rightZ, |
|
|
const Axis & |
tAxis, |
|
|
bool |
leftT, |
|
|
bool |
rightT, |
|
|
const char * |
functionLabel = 0 |
|
) |
| |
Convenience constructor for 4-d interpolators
◆ LinInterpolatedTableND() [6/7]
template<class Numeric , class Axis = UniformAxis>
npstat::LinInterpolatedTableND< Numeric, Axis >::LinInterpolatedTableND |
( |
const Axis & |
xAxis, |
|
|
bool |
leftX, |
|
|
bool |
rightX, |
|
|
const Axis & |
yAxis, |
|
|
bool |
leftY, |
|
|
bool |
rightY, |
|
|
const Axis & |
zAxis, |
|
|
bool |
leftZ, |
|
|
bool |
rightZ, |
|
|
const Axis & |
tAxis, |
|
|
bool |
leftT, |
|
|
bool |
rightT, |
|
|
const Axis & |
vAxis, |
|
|
bool |
leftV, |
|
|
bool |
rightV, |
|
|
const char * |
functionLabel = 0 |
|
) |
| |
Convenience constructor for 5-d interpolators
◆ LinInterpolatedTableND() [7/7]
template<class Numeric , class Axis = UniformAxis>
template<class Num2 >
Converting copy constructor from interpolator with another storage type
◆ dim()
template<class Numeric , class Axis = UniformAxis>
Examine interpolator contents
◆ getCoords()
template<class Numeric , class Axis = UniformAxis>
Convenience function for getting coordinates of the grid points
◆ invertRatioResponse()
template<class Numeric , class Axis = UniformAxis>
template<class Functor1 , class Functor2 >
This method inverts the ratio response. That is, we assume that the table encodes r(x) for some function f(x) = x*r(x). We also assume that the original axis does not represent x directly – instead, axis coordinates are given by g(x) (in practice, g is often the natural log). We will also assume that the new axis is not going to represent f(x) directly – it will be h(f(x)) instead. The functors "invg" and "invh" below must do the inverse: taking the axes coordinates to the actual values of x and f(x). Both "invg" and "invh" must be monotonously increasing functions. The code assumes that x*r(x) -> 0 when x->0 (that is, r(x) is bounded at 0) and it also assumes (but does not check explicitly) that x*r(x) is monotonously increasing with x.
The returned interpolation table encodes the values of x/f(x). Of course, they are just 1/r(x), but the trick is to be able to look them up quickly as a function of h(f(x)). Naturally, this whole operation is meaningful only in case "Numeric" type is either float or double.
◆ invertWRTAxis()
template<class Numeric , class Axis = UniformAxis>
template<typename ConvertibleToUnsigned >
Invert the function w.r.t. the variable represented by one of the axes. The function values must change monotonously along the chosen axis. Note that this operation is meaningful only in case "Numeric" type is either float or double.
◆ isUniformlyBinned()
template<class Numeric , class Axis = UniformAxis>
This method returns "true" if the method isUniform() of each interpolator axis returns "true"
◆ isWithinLimits()
template<class Numeric , class Axis = UniformAxis>
This method will return "true" if the point is inside the grid limits or on the boundary
◆ operator!=()
template<class Numeric , class Axis = UniformAxis>
Logical negation of operator==
◆ operator()() [1/2]
template<class Numeric , class Axis = UniformAxis>
Convenience function for low-dimensional interpolators
◆ operator()() [2/2]
template<class Numeric , class Axis = UniformAxis>
Basic interpolation result. Argument point dimensionality must be compatible with the interpolator dimensionality.
◆ operator==()
template<class Numeric , class Axis = UniformAxis>
◆ setFunctionLabel()
template<class Numeric , class Axis = UniformAxis>
Modifier for the function label
◆ table()
template<class Numeric , class Axis = UniformAxis>
Access the interpolator table data
The documentation for this class was generated from the following file:
|