IFEM  90A354
LagrangeInterpolator.h
Go to the documentation of this file.
1 // $Id$
2 //==============================================================================
12 //==============================================================================
13 
14 #ifndef LAGRANGE_INTERPOLATOR_H_
15 #define LAGRANGE_INTERPOLATOR_H_
16 
17 #include "matrix.h"
18 
19 
25 {
26 public:
28  explicit LagrangeInterpolator(const std::vector<Real>& g) : grid(g) {}
29 
31  Real evaluate(Real x, size_t nr) const;
33  Real interpolate(Real x, const std::vector<Real>& data) const;
35  utl::matrix<Real> get(const std::vector<Real>& xg) const;
36 
37 private:
38  std::vector<Real> grid;
39 };
40 
41 #endif
#define Real
The floating point type to use.
Definition: ImmersedBoundaries.h:18
Lagrange interpolation in one dimension.
Definition: LagrangeInterpolator.h:25
utl::matrix< Real > get(const std::vector< Real > &xg) const
Returns an interpolation matrix for a grid of data points.
Definition: LagrangeInterpolator.C:39
Real interpolate(Real x, const std::vector< Real > &data) const
Interpolates the given data at the specified point.
Definition: LagrangeInterpolator.C:28
Real evaluate(Real x, size_t nr) const
Evaluate the interpolator at the specified point.
Definition: LagrangeInterpolator.C:17
std::vector< Real > grid
Grid points.
Definition: LagrangeInterpolator.h:38
LagrangeInterpolator(const std::vector< Real > &g)
The constructor initializes the grid point array.
Definition: LagrangeInterpolator.h:28
Simple template classes for dense rectangular matrices and vectors.