ReFRACtor
|
This class takes a set of points and values, and linearly interpolates between those values. More...
#include <linear_interpolate.h>
Public Types | |
enum | BehaviorOutOfRange { OUT_OF_RANGE_EXTRAPOLATE = 0, OUT_OF_RANGE_CLIP, OUT_OF_RANGE_ERROR } |
Public Member Functions | |
LinearInterpolate () | |
template<class I1 , class I2 > | |
LinearInterpolate (I1 xstart, I1 xend, I2 ystart, BehaviorOutOfRange Out_of_range=OUT_OF_RANGE_EXTRAPOLATE) | |
Constructor. More... | |
TY | operator() (const TX &x) const |
void | print (std::ostream &Os) const |
std::string | print_to_string () const |
Print to string. More... | |
This class takes a set of points and values, and linearly interpolates between those values.
This works for any type TX of x and TY of y. TX is typically a double or float, but it might also be something like AutoDerivative<double>. TX has the same constraints as a key to std::map, it needs to be ordered by the "<" operator.
If you request a value for X outside of the range originally passed in, then the behavior depends on the value passed in the constructor. We can extrapolate, "clip" (i.e., use the minimum value for x < min, the maximum value for x > max), or trigger an exception.
Definition at line 79 of file linear_interpolate.h.
enum FullPhysics::LinearInterpolate::BehaviorOutOfRange |
Enumerator | |
---|---|
OUT_OF_RANGE_EXTRAPOLATE | |
OUT_OF_RANGE_CLIP | |
OUT_OF_RANGE_ERROR |
Definition at line 99 of file linear_interpolate.h.
|
inline |
Definition at line 101 of file linear_interpolate.h.
|
inline |
Constructor.
This takes iterators to give x and y, along with the behavior when called with out of range data.
Definition at line 108 of file linear_interpolate.h.
|
inline |
Definition at line 140 of file linear_interpolate.h.
|
inline |
Definition at line 190 of file linear_interpolate.h.
|
inlineinherited |
Print to string.
This is primarily useful for SWIG wrappers to this class, e.g. a to_s method in ruby.
Definition at line 31 of file printable.h.