20 #ifndef PISM_INTERPOLATION_H
21 #define PISM_INTERPOLATION_H
84 const std::vector<double> &output_x);
86 const double *output_x,
unsigned int output_x_size);
88 const std::vector<int>&
left()
const;
89 const std::vector<int>&
right()
const;
90 const std::vector<double>&
alpha()
const;
92 int left(
size_t j)
const;
93 int right(
size_t j)
const;
94 double alpha(
size_t j)
const;
104 std::vector<double>
interpolate(
const std::vector<double> &input_values)
const;
109 void interpolate(
const double *input,
double *output)
const;
117 void init_linear(
const double *input_x,
unsigned int input_x_size,
118 const double *output_x,
unsigned int output_x_size);
119 void init_nearest(
const double *input_x,
unsigned int input_x_size,
120 const double *output_x,
unsigned int output_x_size);
122 const double *output_x,
unsigned int output_x_size);
void init_linear(const double *input_x, unsigned int input_x_size, const double *output_x, unsigned int output_x_size)
std::vector< double > m_alpha
Interpolation weights.
Interpolation(InterpolationType type, const std::vector< double > &input_x, const std::vector< double > &output_x)
void init_piecewise_constant(const double *input_x, unsigned int input_x_size, const double *output_x, unsigned int output_x_size)
std::vector< int > m_left
Interpolation indexes.
void init_nearest(const double *input_x, unsigned int input_x_size, const double *output_x, unsigned int output_x_size)
const std::vector< double > & alpha() const
const std::vector< int > & right() const
const std::vector< int > & left() const
std::vector< double > interpolate(const std::vector< double > &input_values) const
Return interpolated values (on the output grid) given input_values on the input grid.
std::vector< int > m_right
std::map< size_t, double > integration_weights(const double *x, size_t x_size, InterpolationType type, double a, double b)