21 inline LUT1d() : _haveData(false), _refValue(0.0), _extrapolate{
true} {
22 std::valarray<double> x{0.0, 1.0};
23 std::valarray<double> y{0.0, 0.0};
29 inline LUT1d(T
refValue) : _haveData(false), _refValue(refValue), _extrapolate{
true} {}
32 inline LUT1d(
size_t size) : _haveData(false), _refValue(0.0), _extrapolate{
true} {
77 inline std::valarray<double> &
coords() {
return _coords; }
81 inline const std::valarray<double> &
coords()
const {
return _coords; }
85 inline void coords(
const std::valarray<double> & c) { _coords = c; }
89 inline std::valarray<T> &
values() {
return _values; }
93 inline const std::valarray<T> &
values()
const {
return _values; }
97 inline void values(
const std::valarray<T> & v) { _values = v; }
115 inline size_t size()
const {
return _coords.size(); }
118 inline T
eval(
double x)
const;
124 std::valarray<double> _coords;
125 std::valarray<T> _values;
130 #define ISCE_CORE_LUT1D_ICC
132 #undef ISCE_CORE_LUT1D_ICC
LUT1d(size_t size)
Constructor with size.
Definition: LUT1d.h:32
std::valarray< T > & values()
Get a reference to the coordinates.
Definition: LUT1d.h:89
bool extrapolate() const
Get extrapolate flag.
Definition: LUT1d.h:101
T refValue() const
Get reference value.
Definition: LUT1d.h:111
const std::valarray< T > & values() const
Get a read-only reference to the values.
Definition: LUT1d.h:93
T eval(double x) const
Evaluate the LUT.
Definition: LUT1d.icc:106
size_t size() const
Get size of LUT.
Definition: LUT1d.h:115
Data structure to hold a 1D Lookup table.
Definition: forward.h:29
const std::valarray< double > & coords() const
Get a read-only reference to the coordinates.
Definition: LUT1d.h:81
Data structure to store 2D Lookup table.
Definition: forward.h:30
LUT1d(T refValue)
Constructor with a constant reference value.
Definition: LUT1d.h:29
bool haveData() const
Get flag for having data.
Definition: LUT1d.h:108
void values(const std::valarray< T > &v)
Set the values.
Definition: LUT1d.h:97
LUT1d()
Default constructor.
Definition: LUT1d.h:21
LUT1d & operator=(const LUT1d< T > &lut)
Assignment operator.
Definition: LUT1d.h:60
LUT1d(const std::valarray< double > &coords, const std::valarray< T > &values, bool extrapolate=false)
Constructor with coordinates and values.
Definition: LUT1d.h:41
LUT1d(const LUT1d< T > &lut)
Copy constructor.
Definition: LUT1d.h:51
std::valarray< double > & coords()
Get a reference to the coordinates.
Definition: LUT1d.h:77
void extrapolate(bool flag)
Set extrapolate flag.
Definition: LUT1d.h:105
void coords(const std::valarray< double > &c)
Set the coordinates.
Definition: LUT1d.h:85