18 Lagrange(
const std::vector<Real> &xin,
const std::vector<Real> &xev );
22 void interp(
const std::vector<Real> &f, std::vector<Real> &p);
24 void dinterp(
const std::vector<Real> &f, std::vector<Real> &p);
27 void interpolant(
const int k, std::vector<Real> &l);
30 void derivative(
const int k, std::vector<Real> &d);
34 void bi_sum(
const std::vector<Real> &f, std::vector<Real> &y);
39 const std::vector<Real>
xin_;
42 const std::vector<Real>
xev_;
67 xin_(xin), xev_(xev), nin_(xin.size()), nev_(xev.size()), w_(nin_,0), ell_(nev_,0),
D_(nin_*nin_,0) {
77 for(
int j=1;j<
nin_;++j)
89 for(
int j=0;j<
nin_;++j)
94 std::vector<Real> ones(nin_,1.0);
98 for(
int j=0;j<
nev_;++j)
103 for(
int k=0;k<
nin_;++k) {
104 for(
int i=0;i<
nin_;++i) {
111 for(
int k=0;k<
nin_;++k){
112 for(
int i=0;i<
nin_;++i) {
133 for(
int j=0;j<nev_;++j)
136 for(
int k=0;k<nin_;++k)
138 if(xev_[j] == xin_[k])
145 y[j] += w_[k]*f[k]/(xev_[j]-xin_[k]);
159 for(
int j=0;j<nev_;++j)
167 std::vector<Real> fb(nin_,0);
169 std::copy(f.begin(),f.end(),fb.begin()+1);
173 for(
int j=0;j<nev_;++j)
186 std::vector<Real> f(nin_,0);
187 std::fill(l.begin(),l.end(),0);
191 for(
int j=0;j<nev_;++j)
193 l[j] = ell_[j]*w_[k]/(xev_[j]-xin_[k]);
201 std::vector<Real> lp(nin_,0);
202 std::fill(d.begin(),d.end(),0);
203 std::copy(
D_.begin()+k*nin_,
D_.begin()+(k+1)*nin_,lp.begin());
void bi_sum(const std::vector< Real > &f, std::vector< Real > &y)
This routine evaluates sums of the form shown in equation (4.2) in the paper by J-P Berrut and L...
void interpolant(const int k, std::vector< Real > &l)
Evaluate the kth interpolant on the evaluation points.
const std::vector< Real > xin_
void derivative(const int k, std::vector< Real > &d)
Derivative of the th interpolant on the interpolation points.
const std::vector< Real > xev_
void interp(const std::vector< Real > &f, std::vector< Real > &p)
Given the values of a function on the interpolation points xin, stored in f, evaluate the interpolati...
Lagrange(const std::vector< Real > &xin, const std::vector< Real > &xev)
Interpolation object which interpolates from to the grid xin to xev.
void dinterp(const std::vector< Real > &f, std::vector< Real > &p)