24 template <RealConcept T>
43 if (
iter == _data.begin())
45 return static_cast<T>(
iter->second);
47 if (
iter == _data.end())
50 return static_cast<T>(
prev->second);
54 return static_cast<T>(
iter->second);
66 auto values = _data | std::views::values;
69 std::ranges::max_element(
values, [](
const double a,
const double b) {
return std::abs(
a) < std::abs(
b); });
74 template <RealConcept T>
79 throw std::invalid_argument(
"Division by zero is not allowed.");
82 std::ranges::for_each(_data | std::views::values, [
a](
auto&
value) {
value /=
static_cast<double>(
a); });
double max() const noexcept
Retrieves the maximum absolute value in the interpolation set.
void divide(T a)
Divides all y-values in the dataset by a given number.
std::optional< T > value(T x) const noexcept
Retrieves the interpolated value at a given point.
double RealType
Type for real numbers.
Header file for the interpolation of sets of data.