Mantid
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
Mantid::Kernel::ChebyshevSeries Class Reference

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
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ ChebyshevSeries()

Mantid::Kernel::ChebyshevSeries::ChebyshevSeries ( const size_t  degree)

Constructor for an n-th order polynomial.

Parameters
degreeDegree of polynomial required. It will require degree+1 coefficients to evaluate.

Definition at line 28 of file ChebyshevSeries.cpp.

Member Function Documentation

◆ operator()()

double Mantid::Kernel::ChebyshevSeries::operator() ( const std::vector< double > &  c,
const double  x 
)
Parameters
xX value to evaluate the polynomial in the range [-1,1]. No checking is performed.
cVector of (n+1) coefficients for the polynomial. They should be ordered from 0->n. Providing more coefficients that required is not considered an error.
Returns
Value of the polynomial. The value is undefined if x or n are out of range

Definition at line 42 of file ChebyshevSeries.cpp.

References m_bk, and Mantid::Geometry::x.

Member Data Documentation

◆ m_bk

std::vector<double> Mantid::Kernel::ChebyshevSeries::m_bk
private

Definition at line 32 of file ChebyshevSeries.h.

Referenced by operator()().


The documentation for this class was generated from the following files: