11 virtual std::optional<float>
getValue(
float x)
const = 0;
14template<
int TLength,
typename TValue,
typename TBin>
17 Map2D(
const char*
const name);
19 void initTable(
const TValue (&values)[TLength],
const TBin (&bins)[TLength]);
21 virtual std::optional<float>
getValue(
const float x)
const;
26 const TBin (*
m_bins)[TLength] =
nullptr;
29template<
int TLength,
typename TValue,
typename TBin>
33template<
int TLength,
typename TValue,
typename TBin>
39template<
int TLength,
typename TValue,
typename TBin>
42 criticalError(
"Access to uninitialized bins: %s", m_name);
44 }
else if (!m_values) {
45 criticalError(
"Access to uninitialized values: %s", m_name);
47 }
else if ((1 < TLength) && ((*m_bins)[0] == 0.0f) && ((*m_bins)[1] == 0.0f)) {
51 return std::make_optional(interpolate2d(x, *m_bins, *m_values));
virtual std::optional< float > getValue(const float x) const
void initTable(const TValue(&values)[TLength], const TBin(&bins)[TLength])
Map2D(const char *const name)
const TValue(* m_values)[TLength]
const TBin(* m_bins)[TLength]
virtual std::optional< float > getValue(float x) const =0