Main Page | Alphabetical List | Class List | File List | Class Members | File Members

Chebyshev Class Reference

Chebyshev expansion of arbitrary continuous functions. More...

#include <Chebyshev.h>

Collaboration diagram for Chebyshev:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 Chebyshev ()
 Default constructor.

 Chebyshev (const int order)
 Constructor for declaring and sizing an expansion for an, as yet, unspecified function.

 Chebyshev (const string &filename)
 Constructor for recovering a previously saved expansion.

template<class UserFcnT>  Chebyshev (UserFcnT f, const double a, const double b, const int order)
 Constructor to initiate a new expansion.

template<class UserFcnT>  Chebyshev (UserFcnT f, Dvector pars, const double a, const double b, const int order)
 Constructor to initiate a new expansion for a function with additional parameters.

 Chebyshev (const Chebyshev &F)
 copy constructor

Chebyshevoperator= (const Chebyshev &F)
 assignment operator

 ~Chebyshev ()
 destructor

template<class UserFcnT> void Expand (UserFcnT f, const double a, const double b, const int order)
 Compute expansion coefficients for the given function.

template<class UserFcnT> void Expand (UserFcnT f, Dvector pars, const double a, const double b, const int order)
 Compute expansion coefficients for the a function that takes parameters.

double EvaluateF (const double x)
 Evaluate the Chebyshev expansion at x.

double operator() (const double x)
 Evaluate the Chebyshev expansion at x.

Dpair EvaluateFErr (const double x)
 Evaluate the Chebyshev expansion at x and estimate the associated error.

double EvaluateFSingle (const double x)
 Evaluate the Chebyshev expansion at x in single precision.

double EvaluateFN (const int order, const double x)
 Evaluate, to at most the given order, the Chebyshev expansion at x.

Dpair EvaluateFNErr (const int order, const double x)
 Evaluate, to the given order, the expansion at x and estimate the error.

Chebyshev Differentiate ()
 Construct a Chebyshev expansion for the derivative of the input object.

Chebyshev Integrate ()
 Construct a Chebyshev expansion for the integral of the input object.

int GetOrder ()
 Return the order of the Chebyshev expansion.

Dpair GetInterval ()
 Return the interval over which the Chebyshev expansion is valid.

Dvector GetExpansion ()
 Return the coefficients of the Chebyshev expansion.

void SaveExpansion (const string &filename)
 Write the expansion coefficients to a file for later recovery and use.


Static Private Member Functions

double fdummy (double x)

Private Attributes

gsl_cheb_series_series

Detailed Description

Chebyshev expansion of arbitrary continuous functions.

Definition at line 60 of file Chebyshev.h.


Constructor & Destructor Documentation

Chebyshev::Chebyshev  ) 
 

Default constructor.

Chebyshev::Chebyshev const int  order  ) 
 

Constructor for declaring and sizing an expansion for an, as yet, unspecified function.

Chebyshev::Chebyshev const string &  filename  ) 
 

Constructor for recovering a previously saved expansion.

template<class UserFcnT>
Chebyshev::Chebyshev UserFcnT  f,
const double  a,
const double  b,
const int  order
[inline]
 

Constructor to initiate a new expansion.

Note that this constructor is for a user function f(x) that takes a single double as its sole argument and returns a double.

Definition at line 79 of file Chebyshev.h.

References _series, checkStatus(), gsl_cheb_alloc(), and gsl_cheb_init().

template<class UserFcnT>
Chebyshev::Chebyshev UserFcnT  f,
Dvector  pars,
const double  a,
const double  b,
const int  order
[inline]
 

Constructor to initiate a new expansion for a function with additional parameters.

This constructor is for a user function f(x;par1,par2,...) that takes a single double and a set of parameters in a std::vector<double> container and returns a double.

Definition at line 95 of file Chebyshev.h.

References _series, checkStatus(), gsl_cheb_alloc(), and gsl_cheb_init().

Chebyshev::Chebyshev const Chebyshev F  ) 
 

copy constructor

Chebyshev::~Chebyshev  ) 
 

destructor


Member Function Documentation

Chebyshev Chebyshev::Differentiate  ) 
 

Construct a Chebyshev expansion for the derivative of the input object.

Compute the Chebyshev expansion for the derivative of an existing Chebyshev expansion, this. Note that the error estimate produced for the derivative series is underestimated due to the contribution of higher order terms being neglected.

double Chebyshev::EvaluateF const double  x  ) 
 

Evaluate the Chebyshev expansion at x.

Dpair Chebyshev::EvaluateFErr const double  x  ) 
 

Evaluate the Chebyshev expansion at x and estimate the associated error.

double Chebyshev::EvaluateFN const int  order,
const double  x
 

Evaluate, to at most the given order, the Chebyshev expansion at x.

Dpair Chebyshev::EvaluateFNErr const int  order,
const double  x
 

Evaluate, to the given order, the expansion at x and estimate the error.

Evaluate, to at most the given order, the Chebyshev expansion at x and estimate the associated error

double Chebyshev::EvaluateFSingle const double  x  ) 
 

Evaluate the Chebyshev expansion at x in single precision.

template<class UserFcnT>
void Chebyshev::Expand UserFcnT  f,
Dvector  pars,
const double  a,
const double  b,
const int  order
[inline]
 

Compute expansion coefficients for the a function that takes parameters.

Compute the expansion coefficients for the current instance using the specified function, over the interval [a,b] and to order order.

Definition at line 136 of file Chebyshev.h.

References _series, checkStatus(), gsl_cheb_alloc(), gsl_cheb_free(), and gsl_cheb_init().

template<class UserFcnT>
void Chebyshev::Expand UserFcnT  f,
const double  a,
const double  b,
const int  order
[inline]
 

Compute expansion coefficients for the given function.

Compute the expansion coefficients for the current instance using the specified function, over the interval [a,b] and to order order.

Definition at line 120 of file Chebyshev.h.

References _series, checkStatus(), gsl_cheb_alloc(), gsl_cheb_free(), and gsl_cheb_init().

double Chebyshev::fdummy double  x  )  [inline, static, private]
 

Definition at line 206 of file Chebyshev.h.

Dvector Chebyshev::GetExpansion  ) 
 

Return the coefficients of the Chebyshev expansion.

Return the coefficients of the Chebyshev expansion. Set the vector size() = 0 if the expansion coefficients don't exist yet.

Dpair Chebyshev::GetInterval  ) 
 

Return the interval over which the Chebyshev expansion is valid.

int Chebyshev::GetOrder  ) 
 

Return the order of the Chebyshev expansion.

Chebyshev Chebyshev::Integrate  ) 
 

Construct a Chebyshev expansion for the integral of the input object.

Compute the Chebyshev expansion for the integral of an existing Chebyshev expansion, this. Note that the lower limit of integration is taken to be the left end of the interval over which the original expansion was performed. The integral is forced to be zero there and that fixes the integration constant.

double Chebyshev::operator() const double  x  ) 
 

Evaluate the Chebyshev expansion at x.

Chebyshev& Chebyshev::operator= const Chebyshev F  ) 
 

assignment operator

void Chebyshev::SaveExpansion const string &  filename  ) 
 

Write the expansion coefficients to a file for later recovery and use.


Member Data Documentation

gsl_cheb_series* Chebyshev::_series [private]
 

Definition at line 208 of file Chebyshev.h.

Referenced by Chebyshev(), and Expand().


The documentation for this class was generated from the following file:
Generated on Wed Feb 25 15:03:18 2004 for SpecialFunctions by doxygen 1.3.4