Mantid
|
Evaluate an approximation to a nth order polynomial using a Chebyshev series through Crenshaw's algorithm to evaluate \(p_n(x) = \Sigma_{i=1}^{n}c_iT_i\) The evaluation is implemented using the reccurrence relations http://mathworld.wolfram.com/ClenshawRecurrenceFormula.html. More...
#include <ChebyshevSeries.h>
Public Member Functions | |
ChebyshevSeries (const size_t degree) | |
Constructor for an n-th order polynomial. More... | |
double | operator() (const std::vector< double > &c, const double x) |
Private Attributes | |
std::vector< double > | m_bk |
Evaluate an approximation to a nth order polynomial using a Chebyshev series through Crenshaw's algorithm to evaluate \(p_n(x) = \Sigma_{i=1}^{n}c_iT_i\) The evaluation is implemented using the reccurrence relations http://mathworld.wolfram.com/ClenshawRecurrenceFormula.html.
Definition at line 25 of file ChebyshevSeries.h.
Mantid::Kernel::ChebyshevSeries::ChebyshevSeries | ( | const size_t | degree | ) |
Constructor for an n-th order polynomial.
degree | Degree of polynomial required. It will require degree+1 coefficients to evaluate. |
Definition at line 28 of file ChebyshevSeries.cpp.
double Mantid::Kernel::ChebyshevSeries::operator() | ( | const std::vector< double > & | c, |
const double | x | ||
) |
x | X value to evaluate the polynomial in the range [-1,1]. No checking is performed. |
c | Vector of (n+1) coefficients for the polynomial. They should be ordered from 0->n. Providing more coefficients that required is not considered an error. |
Definition at line 42 of file ChebyshevSeries.cpp.
References m_bk, and Mantid::Geometry::x.
|
private |
Definition at line 32 of file ChebyshevSeries.h.
Referenced by operator()().