9 Lagrange(
const std::vector<Real> &xin,
const std::vector<Real> &xev );
13 void interp(
const std::vector<Real> &f, std::vector<Real> &p);
15 void dinterp(
const std::vector<Real> &f, std::vector<Real> &p);
18 void interpolant(
const int k, std::vector<Real> &l);
21 void derivative(
const int k, std::vector<Real> &d);
25 void bi_sum(
const std::vector<Real> &f, std::vector<Real> &y);
30 const std::vector<Real>
xin_;
33 const std::vector<Real>
xev_;
58 xin_(xin), xev_(xev), nin_(xin.size()), nev_(xev.size()), w_(nin_,0), ell_(nev_,0),
D_(nin_*nin_,0) {
68 for(
int j=1;j<
nin_;++j)
80 for(
int j=0;j<
nin_;++j)
85 std::vector<Real> ones(nin_,1.0);
89 for(
int j=0;j<
nev_;++j)
94 for(
int k=0;k<
nin_;++k) {
95 for(
int i=0;i<
nin_;++i) {
102 for(
int k=0;k<
nin_;++k){
103 for(
int i=0;i<
nin_;++i) {
124 for(
int j=0;j<nev_;++j)
127 for(
int k=0;k<nin_;++k)
129 if(xev_[j] == xin_[k])
136 y[j] += w_[k]*f[k]/(xev_[j]-xin_[k]);
150 for(
int j=0;j<nev_;++j)
158 std::vector<Real> fb(nin_,0);
160 std::copy(f.begin(),f.end(),fb.begin()+1);
164 for(
int j=0;j<nev_;++j)
177 std::vector<Real> f(nin_,0);
178 std::fill(l.begin(),l.end(),0);
182 for(
int j=0;j<nev_;++j)
184 l[j] = ell_[j]*w_[k]/(xev_[j]-xin_[k]);
192 std::vector<Real> lp(nin_,0);
193 std::fill(d.begin(),d.end(),0);
194 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)