4#include <isce3/core/EMatrix.h>
5#include <isce3/except/Error.h>
10namespace isce3::core {
18 using ArrayXt = Eigen::Array<T, Eigen::Dynamic, 1>;
20 inline LUT1d() : _haveData(false), _refValue(0.0), _extrapolate{true} {
21 std::valarray<double> x{0.0, 1.0};
22 std::valarray<double> y{0.0, 0.0};
31 inline LUT1d(
size_t size) : _haveData(false), _refValue(0.0), _extrapolate{true} {
70 inline std::valarray<double> &
coords() {
return _coords; }
74 inline const std::valarray<double> &
coords()
const {
return _coords; }
78 inline void coords(
const std::valarray<double> & c) { _coords = c; }
82 inline std::valarray<T> &
values() {
return _values; }
86 inline const std::valarray<T> &
values()
const {
return _values; }
90 inline void values(
const std::valarray<T> & v) { _values = v; }
108 inline size_t size()
const {
return _coords.size(); }
111 inline T
eval(
double x)
const;
112 inline ArrayXt
eval(
const Eigen::Ref<const Eigen::ArrayXd>& x)
const;
117 std::valarray<double> _coords;
118 std::valarray<T> _values;
127LUT1d<T> avgLUT2dToLUT1d(
const LUT2d<T> & lut2d,
const int axis = 0);
132#define ISCE_CORE_LUT1D_ICC
134#undef ISCE_CORE_LUT1D_ICC
Data structure to hold a 1D Lookup table.
Definition LUT1d.h:15
void values(const std::valarray< T > &v)
Set the values.
Definition LUT1d.h:90
bool haveData() const
Get flag for having data.
Definition LUT1d.h:101
std::valarray< T > & values()
Get a reference to the coordinates.
Definition LUT1d.h:82
bool extrapolate() const
Get extrapolate flag.
Definition LUT1d.h:94
LUT1d(const LUT1d< T > &lut)
Copy constructor.
Definition LUT1d.h:50
T refValue() const
Get reference value.
Definition LUT1d.h:104
LUT1d(size_t size)
Constructor with size.
Definition LUT1d.h:31
LUT1d()
Default constructor.
Definition LUT1d.h:20
LUT1d(T refValue)
Constructor with a constant reference value.
Definition LUT1d.h:28
const std::valarray< double > & coords() const
Get a read-only reference to the coordinates.
Definition LUT1d.h:74
void extrapolate(bool flag)
Set extrapolate flag.
Definition LUT1d.h:98
LUT1d(const std::valarray< double > &coords, const std::valarray< T > &values, bool extrapolate=false)
Constructor with coordinates and values.
Definition LUT1d.h:40
void coords(const std::valarray< double > &c)
Set the coordinates.
Definition LUT1d.h:78
const std::valarray< T > & values() const
Get a read-only reference to the values.
Definition LUT1d.h:86
size_t size() const
Get size of LUT.
Definition LUT1d.h:108
std::valarray< double > & coords()
Get a reference to the coordinates.
Definition LUT1d.h:70
LUT1d & operator=(const LUT1d< T > &lut)
Assignment operator.
Definition LUT1d.h:59
T eval(double x) const
Evaluate the LUT.
Definition LUT1d.icc:11