PeriodicLookupTable
-
template<fgc4::utils::NumericScalar IndexType, fgc4::utils::NumericScalar StoredType = IndexType>
class PeriodicLookupTable : public vslib::LookupTable<IndexType, IndexType> Public Functions
-
inline PeriodicLookupTable(std::string_view name, Component &parent, std::vector<std::pair<IndexType, StoredType>> &&values, const bool equal_binning = false) noexcept
Constructor for PeriodicLookupTable Component.
- Parameters:
name – Name of the PeriodicLookupTable component object
parent – Pointer to the parent of this table
values – Vector with lookup table index-value pairs
equal_binning – Flag signalling whether the lookup table indexing has equal spaced binning
-
inline StoredType interpolate(IndexType input_x, const bool random_access = false)
Provides an interpolated y-axis value from the stored values closest to the provided x-axis input.
- Parameters:
input_x – X-axis input value
random_access – Switch informing if the input_x is coming linearly or randomly, allows for binary search optimisation in the latter case
- Returns:
Y-axis value result of the interpolation
-
inline PeriodicLookupTable(std::string_view name, Component &parent, std::vector<std::pair<IndexType, StoredType>> &&values, const bool equal_binning = false) noexcept