Logo ROOT   6.08/07
Reference Guide
List of all members | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
ROOT::Math::ChebyshevApprox Class Reference

Class describing a Chebyshev series which can be used to approximate a function in a defined range [a,b] using Chebyshev polynomials.

It uses the algorithm from GSL

This class does not support copying

Definition at line 75 of file ChebyshevApprox.h.

Public Member Functions

 ChebyshevApprox (const ROOT::Math::IGenFunction &f, double a, double b, size_t n)
 Construct a Chebyshev series approximation to a Function f in range [a,b]; constructor based on functions of type IGenFunction. More...
 
 ChebyshevApprox (GSLFuncPointer f, void *p, double a, double b, size_t n)
 Construct a Chebyshev series approximation to a Function f in range [a,b]; constructor based on free functions with gsl_function type signature. More...
 
virtual ~ChebyshevApprox ()
 
ChebyshevApproxDeriv ()
 Compute the derivative of the series and return a pointer to a new Chebyshev series with the derivatives coefficients. More...
 
std::pair< double, double > EvalErr (double x) const
 Evaluate the series at a given point x estimating both the series result and its absolute error. More...
 
std::pair< double, double > EvalErr (double x, size_t n) const
 evaluate the series at a given point x to the given order n, estimating both the series result and its absolute error. More...
 
ChebyshevApproxIntegral ()
 Compute the integral of the series and return a pointer to a new Chebyshev series with the integral coefficients. More...
 
double operator() (double x) const
 Evaluate the series at a given point x. More...
 
double operator() (double x, size_t n) const
 Evaluate the series at a given point, to (at most) the given order n. More...
 

Protected Member Functions

void Initialize (GSLFuncPointer f, void *params, double a, double b)
 Initialize series passing function and range. More...
 

Private Member Functions

 ChebyshevApprox (size_t n)
 construct a Chebyshev series or order n The series must be initialized from a function More...
 
 ChebyshevApprox (const ChebyshevApprox &)
 
ChebyshevApproxoperator= (const ChebyshevApprox &)
 

Private Attributes

GSLFunctionWrapperfFunction
 
size_t fOrder
 
GSLChebSeriesfSeries
 

#include <Math/ChebyshevApprox.h>

Constructor & Destructor Documentation

◆ ChebyshevApprox() [1/4]

ROOT::Math::ChebyshevApprox::ChebyshevApprox ( const ROOT::Math::IGenFunction f,
double  a,
double  b,
size_t  n 
)

Construct a Chebyshev series approximation to a Function f in range [a,b]; constructor based on functions of type IGenFunction.

Definition at line 49 of file ChebyshevApprox.cxx.

◆ ChebyshevApprox() [2/4]

ROOT::Math::ChebyshevApprox::ChebyshevApprox ( GSLFuncPointer  f,
void p,
double  a,
double  b,
size_t  n 
)

Construct a Chebyshev series approximation to a Function f in range [a,b]; constructor based on free functions with gsl_function type signature.

Definition at line 60 of file ChebyshevApprox.cxx.

◆ ~ChebyshevApprox()

ROOT::Math::ChebyshevApprox::~ChebyshevApprox ( )
virtual

Definition at line 68 of file ChebyshevApprox.cxx.

◆ ChebyshevApprox() [3/4]

ROOT::Math::ChebyshevApprox::ChebyshevApprox ( size_t  n)
private

construct a Chebyshev series or order n The series must be initialized from a function

Definition at line 75 of file ChebyshevApprox.cxx.

◆ ChebyshevApprox() [4/4]

ROOT::Math::ChebyshevApprox::ChebyshevApprox ( const ChebyshevApprox )
private

Definition at line 82 of file ChebyshevApprox.cxx.

Member Function Documentation

◆ Deriv()

ChebyshevApprox * ROOT::Math::ChebyshevApprox::Deriv ( )

Compute the derivative of the series and return a pointer to a new Chebyshev series with the derivatives coefficients.

The returned pointer must be managed by the user.

Definition at line 135 of file ChebyshevApprox.cxx.

◆ EvalErr() [1/2]

std::pair< double, double > ROOT::Math::ChebyshevApprox::EvalErr ( double  x) const

Evaluate the series at a given point x estimating both the series result and its absolute error.

The error estimate is made from the first neglected term in the series. A pair containing result and error is returned

Definition at line 114 of file ChebyshevApprox.cxx.

◆ EvalErr() [2/2]

std::pair< double, double > ROOT::Math::ChebyshevApprox::EvalErr ( double  x,
size_t  n 
) const

evaluate the series at a given point x to the given order n, estimating both the series result and its absolute error.

The error estimate is made from the first neglected term in the series. A pair containing result and error is returned

Definition at line 126 of file ChebyshevApprox.cxx.

◆ Initialize()

void ROOT::Math::ChebyshevApprox::Initialize ( GSLFuncPointer  f,
void params,
double  a,
double  b 
)
protected

Initialize series passing function and range.

Definition at line 95 of file ChebyshevApprox.cxx.

◆ Integral()

ChebyshevApprox * ROOT::Math::ChebyshevApprox::Integral ( )

Compute the integral of the series and return a pointer to a new Chebyshev series with the integral coefficients.

The lower limit of the integration is the left range value a. The returned pointer must be managed by the user

Definition at line 148 of file ChebyshevApprox.cxx.

◆ operator()() [1/2]

double ROOT::Math::ChebyshevApprox::operator() ( double  x) const

Evaluate the series at a given point x.

Definition at line 109 of file ChebyshevApprox.cxx.

◆ operator()() [2/2]

double ROOT::Math::ChebyshevApprox::operator() ( double  x,
size_t  n 
) const

Evaluate the series at a given point, to (at most) the given order n.

Definition at line 121 of file ChebyshevApprox.cxx.

◆ operator=()

ChebyshevApprox & ROOT::Math::ChebyshevApprox::operator= ( const ChebyshevApprox rhs)
private

Definition at line 87 of file ChebyshevApprox.cxx.

Member Data Documentation

◆ fFunction

GSLFunctionWrapper* ROOT::Math::ChebyshevApprox::fFunction
private

Definition at line 163 of file ChebyshevApprox.h.

◆ fOrder

size_t ROOT::Math::ChebyshevApprox::fOrder
private

Definition at line 160 of file ChebyshevApprox.h.

◆ fSeries

GSLChebSeries* ROOT::Math::ChebyshevApprox::fSeries
private

Definition at line 162 of file ChebyshevApprox.h.


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