Data structure to hold a 1D Lookup table. More...
#include <LUT1d.h>
Public Member Functions | |
LUT1d () | |
Default constructor. | |
LUT1d (T refValue) | |
Constructor with a constant reference value. | |
LUT1d (size_t size) | |
Constructor with size. | |
LUT1d (const std::valarray< double > &coords, const std::valarray< T > &values, bool extrapolate=false) | |
Constructor with coordinates and values. More... | |
LUT1d (const LUT1d< T > &lut) | |
Copy constructor. More... | |
LUT1d & | operator= (const LUT1d< T > &lut) |
Assignment operator. More... | |
LUT1d (const LUT2d< T > &lut2d) | |
Constructor from an LUT2d (values averaged in y-direction) More... | |
LUT1d & | operator= (const LUT2d< T > &lut2d) |
Assignment operator from an LUT2d (values averaged in y-direction) More... | |
std::valarray< double > & | coords () |
Get a reference to the coordinates. More... | |
const std::valarray< double > & | coords () const |
Get a read-only reference to the coordinates. More... | |
void | coords (const std::valarray< double > &c) |
Set the coordinates. More... | |
std::valarray< T > & | values () |
Get a reference to the coordinates. More... | |
const std::valarray< T > & | values () const |
Get a read-only reference to the values. More... | |
void | values (const std::valarray< T > &v) |
Set the values. More... | |
bool | extrapolate () const |
Get extrapolate flag. More... | |
void | extrapolate (bool flag) |
Set extrapolate flag. More... | |
bool | haveData () const |
Get flag for having data. | |
T | refValue () const |
Get reference value. | |
size_t | size () const |
Get size of LUT. More... | |
T | eval (double x) const |
Evaluate the LUT. More... | |
Data structure to hold a 1D Lookup table.
Suitable for storing data of the form y = f(x)
|
inline |
Constructor with coordinates and values.
[in] | coords | Valarray for coordinates of LUT |
[in] | values | Valarray for values of LUT |
[in] | extrapolate | Flag for allowing extrapolation beyond bounds |
|
inline |
Copy constructor.
[in] | lut | LUT1d object to copy from |
|
inline |
|
inline |
Get a reference to the coordinates.
[out] | coords | Reference to valarray for coordinates |
|
inline |
Get a read-only reference to the coordinates.
[out] | coords | Copy of valarray for coordinates |
|
inline |
Set the coordinates.
[in] | c | Input valarray for coordinates |
|
inline |
Evaluate the LUT.
[in] | x | Point to evaluate the LUT |
[out] | result | Interpolated value |
|
inline |
Get extrapolate flag.
[out] | flag | Extrapolation flag |
|
inline |
Set extrapolate flag.
[in] | flag | Extrapolation flag |
|
inline |
Assignment operator.
[in] | lut | LUT1d object to assign from |
|
inline |
|
inline |
Get size of LUT.
[out] | size | Size (number of coordinates) of LUT |
|
inline |
Get a reference to the coordinates.
[out] | values | Reference to valarray for values |
|
inline |
Get a read-only reference to the values.
[out] | values | Copy of valarray for values |
|
inline |
Set the values.
[in] | v | Input valarray for values |