25 #ifndef UQ_LINEAR_LAGRANGE_INTERPOLATION_SURROGATE_H
26 #define UQ_LINEAR_LAGRANGE_INTERPOLATION_SURROGATE_H
29 #include <queso/InterpolationSurrogateBase.h>
43 template<
class V = GslVector,
class M = GslMatrix>
57 virtual double evaluate(
const V & domainVector)
const;
61 {
return std::pow( 2, this->
m_data.dim() ); };
70 std::vector<unsigned int>& indices)
const;
76 std::vector<double>& x_min,
77 std::vector<double>& x_max,
78 std::vector<double>& values )
const;
83 const std::vector<double>& x_max,
84 const std::vector<double>& values,
85 const V & domainVector )
const;
94 unsigned int coordsToSingle(
const std::vector<unsigned int>& indices )
const;
97 void singleToCoords(
unsigned int global, std::vector<unsigned int>& indices )
const;
103 const std::vector<double>& x_max,
104 const std::vector<unsigned int>& indices,
105 const V & domainVector )
const;
110 double lagrange_poly(
double x0,
double x1,
double x,
unsigned int index )
const;
120 #endif // UQ_LINEAR_LAGRANGE_INTERPOLATION_SURROGATE_H
virtual double evaluate(const V &domainVector) const
Evaluates value of the interpolant for the given domainVector.
void compute_interval_values(const std::vector< unsigned int > &indices, std::vector< double > &x_min, std::vector< double > &x_max, std::vector< double > &values) const
Helper function to populate bounding values for the intervals in each dimension.
virtual ~LinearLagrangeInterpolationSurrogate()
Base class for interpolation-based surrogates.
double lagrange_poly(double x0, double x1, double x, unsigned int index) const
Evaluate a 1-D Lagrange polynomial at point x.
Linear Lagrange interpolation surrogate.
double eval_interpolant(const std::vector< double > &x_min, const std::vector< double > &x_max, const std::vector< double > &values, const V &domainVector) const
Evaluate multidimensional linear Lagrange interpolant.
const InterpolationSurrogateData< V, M > & m_data
void singleToCoords(unsigned int global, std::vector< unsigned int > &indices) const
Inverse of map computed in coordsToSingle.
unsigned int n_coeffs() const
The number of coeffs for interpolating.
LinearLagrangeInterpolationSurrogate()
double tensor_product_lagrange(const std::vector< double > &x_min, const std::vector< double > &x_max, const std::vector< unsigned int > &indices, const V &domainVector) const
Compute multidimensional Lagrange polynomial as tensor product of 1D polynomials. ...
void compute_interval_indices(const V &domainVector, std::vector< unsigned int > &indices) const
Helper function to get lower bound indices for each dimension.
unsigned int coordsToSingle(const std::vector< unsigned int > &indices) const
Convert local indices to single "global" index.