37 #ifndef AIMS_MATH_LAGRANGE_H
38 #define AIMS_MATH_LAGRANGE_H
57 const std::vector<REAL> &ya,
62 int i,m,ns=0,n=std::min( xa.size(), ya.size() );
63 REAL den,dif,dift,ho,hp,w;
71 if ((dift = fabs(x-xa[i])) < dif)
86 ASSERT( (den = ho - hp) != 0.0 );
91 y += (*dy=(2*ns+2 < (n-m) ? c[ns+1] : d[ns--]));
The class for EcatSino data write operation.
AIMSDATA_API REAL AimsLagrangeInterpolation(const std::vector< REAL > &xa, const std::vector< REAL > &ya, REAL x, REAL *dy)
Returns the interpolation of a function defined at (xa,ya) points at x (dy is the error)