SpECTRE  v2024.04.12
intrp::MultiLinearSpanInterpolation< Dimension, NumberOfVariables, UniformSpacing > Class Template Reference

Performs linear interpolation in arbitrary dimensions. The class is non-owning and expects a C-ordered array, (n, x, y, z). The variable index, n, varies fastest in memory. Note that this class is intentionally non-pupable. More...

#include <MultiLinearSpanInterpolation.hpp>

Classes

struct  Weight
 

Public Member Functions

size_t extents (const size_t which_dimension) const
 
void extrapolate_above_data (const size_t which_dimension, const bool value)
 
void extrapolate_below_data (const size_t which_dimension, const bool value)
 
Weight< 1 > get_weights (const double x1) const
 Compute interpolation weights for 1D tables.
 
Weight< 2 > get_weights (const double x1, const double x2) const
 Compute interpolation weights for 2D tables.
 
Weight< 3 > get_weights (const double x1, const double x2, const double x3) const
 Compute interpolation weights for 3D tables.
 
double interpolate (const Weight< Dimension > &weights, const size_t which_variable=0) const
 
template<size_t... variables_to_interpolate>
std::array< double, sizeof...(variables_to_interpolate)> interpolate (const Weight< Dimension > &weights) const
 
template<size_t NumberOfVariablesToInterpolate, typename... T, Requires<(std::is_floating_point_v< typename std::remove_cv_t< T > > and ...)> = nullptr>
std::array< double, NumberOfVariablesToInterpolate > interpolate (std::array< size_t, NumberOfVariablesToInterpolate > &variables_to_interpolate, const T &... target_points) const
 
template<size_t NumberOfVariablesToInterpolate, size_t... I>
std::array< double, NumberOfVariablesToInterpolate > interpolate (std::array< size_t, NumberOfVariablesToInterpolate > &variables_to_interpolate, std::array< double, Dimension > &target_points, std::index_sequence< I... >) const
 
template<size_t NumberOfVariablesToInterpolate>
std::array< double, NumberOfVariablesToInterpolate > interpolate (std::array< size_t, NumberOfVariablesToInterpolate > &variables_to_interpolate, std::array< double, Dimension > &target_points) const
 
 MultiLinearSpanInterpolation (std::array< gsl::span< const double >, Dimension > x_, gsl::span< const double > y_, Index< Dimension > number_of_points__)
 
double lower_bound (const size_t which_dimension) const
 
double upper_bound (const size_t which_dimension) const
 

Detailed Description

template<size_t Dimension, size_t NumberOfVariables, bool UniformSpacing>
class intrp::MultiLinearSpanInterpolation< Dimension, NumberOfVariables, UniformSpacing >

Performs linear interpolation in arbitrary dimensions. The class is non-owning and expects a C-ordered array, (n, x, y, z). The variable index, n, varies fastest in memory. Note that this class is intentionally non-pupable.

Template Parameters
Dimensiondimensionality of the table
NumberOfVariablesnumber of variables stored in the table
UniformSpacingindicated whether the table has uniform _spacing or not. This is useful for performance reasons in finding the appropriate table index.

The documentation for this class was generated from the following file: