1 #ifndef INTERPOLATION_IMPL
2 #error Please, include "MathUtils/interpolation/interpolation.h"
11 template <std::
size_t,
typename Seq>
24 template <std::
size_t>
29 template <std::
size_t>
36 : m_interpn(std::tuple<std::vector<typename Doubles<Is>::type>...>{grid[
N - Is - 1]...}, values, extrapolate) {
42 double operator()(
typename Doubles<Is>::type... xn)
const override {
44 return m_interpn(std::get<N - Is - 1>(as_tuple)...);
47 void operator()(
const typename Vectors<Is>::type&...,
std::vector<double>&)
const override {
52 return Euclid::make_unique<InterpNAdapter>(*this);
55 InterpNAdapter(
const InterpNAdapter&) =
default;
61 template <std::
size_t N>
64 return Euclid::make_unique<InterpNAdapter<N, _make_index_sequence<N>>>(grid, values, type, extrapolate);
InterpN< typename Doubles< Is >::type...> m_interpn
std::unique_ptr< NAryFunction< N > > interpn(const Coordinates< N > &grid, const NdArray::NdArray< double > &values, InterpolationType type, bool extrapolate)
InterpNAdapter(const Coordinates< N > &grid, const NdArray::NdArray< double > &values, InterpolationType type, bool extrapolate)
Interface class representing a function with an arbitrary number of parameters.
InterpolationType
Enumeration of the different supported interpolation types.