Chebyshev_poly Class Reference
[Orthogonal polynomials]

Chebyshev polynomials. More...

#include <ortho_poly.h>

Inheritance diagram for Chebyshev_poly:

Ortho_poly List of all members.

Public Member Functions

 Chebyshev_poly (int ni)
 Standard constructor.
 Chebyshev_poly (const Chebyshev_poly &)
 Copy constructor.
virtual ~Chebyshev_poly ()
 Destructor.
void operator= (const Chebyshev_poly &)
 Assignment to another Chebyshev_poly.
virtual double weight (double x) const
 Weight function $w$.
virtual double operator() (int i, double x) const
 Value of the polynomial $p_i$.
virtual const Gridgauss_nodes () const
 Gauss nodes.
virtual double gauss_weight (int i) const
 Gauss weights.
virtual double gauss_gamma (int i) const
 Gamma factor $\gamma_i$ (square of the polynomial no.
virtual const Gridgauss_lobatto_nodes () const
 Gauss-Lobatto nodes.
virtual double gauss_lobatto_weight (int i) const
 Gauss-Lobatto weights.
virtual double gauss_lobatto_gamma (int i) const
 Gamma factor $\gamma_i$ (square of the polynomial no.
void coef_interpolant_GL_FFT (double(*f)(double), double *cf) const
 Coefficients of the interpolant polynomial through the Gauss-Lobatto nodes via a FFT.
virtual void coef_projection (double(*f)(double), double *cf) const
 Coefficients of the expansion over the Chebyshev polynomials of the orthogonal projection on the space of polynomials of maximum degree N.
int n () const
 returns N, i.e. the maximum degree of the polynomials
void coef_interpolant_Gauss (double(*f)(double), double *cf) const
 Coefficients of the interpolant polynomial through the Gauss nodes.
void coef_interpolant_GL (double(*f)(double), double *cf) const
 Coefficients of the interpolant polynomial through the Gauss-Lobatto nodes.
double series (const double *a, double x) const
 Value of some expansion over the polynomials: $\sum_{i=0}^N a_i\, p_i(x)$.

Protected Attributes

const int nn
 N = maximum degree of the polynomials
const Gridp_gauss_nodes
 Pointer on the Gauss nodes.
double * p_gauss_weights
 Pointer on the Gauss weights.
double * p_gauss_gamma
 Pointer on the gamma factors (squares of the polynomials with respect to the discrete scalar product associated with the Gauss nodes).
const Gridp_gauss_lobatto_nodes
 Pointer on the Gauss-Lobatto nodes.
double * p_gauss_lobatto_weights
 Pointer on the Gauss-Lobatto weights.
double * p_gauss_lobatto_gamma
 Pointer on the gamma factors (square of the polynomials with respect to the discrete scalar product associated with the Gauss-Lobatto nodes).

Detailed Description

Chebyshev polynomials.

() Each instance of this class represents a family of Chebyshev polynomials $(T_i)$ up to a given degree N.

Definition at line 227 of file ortho_poly.h.


Constructor & Destructor Documentation

Chebyshev_poly::Chebyshev_poly int  ni  ) 
 

Standard constructor.

Parameters:
ni maximum degree of the polynomials

Definition at line 58 of file chebyshev_poly.C.

Chebyshev_poly::Chebyshev_poly const Chebyshev_poly  ) 
 

Copy constructor.

Definition at line 64 of file chebyshev_poly.C.

Chebyshev_poly::~Chebyshev_poly  )  [virtual]
 

Destructor.

Definition at line 71 of file chebyshev_poly.C.


Member Function Documentation

void Ortho_poly::coef_interpolant_Gauss double(*)(double)  f,
double *  cf
const [inherited]
 

Coefficients of the interpolant polynomial through the Gauss nodes.

Parameters:
(*f)(double) function to be interpolated
cf [output] array containing the N+1 coefficients of the expansion of the interpolant on the basis polynomials. This array must be of size at least N+1 and must have been allocated by the user prior to the call of this method.

Definition at line 128 of file ortho_poly.C.

References Ortho_poly::gauss_nodes(), Ortho_poly::gauss_weight(), and Ortho_poly::nn.

void Ortho_poly::coef_interpolant_GL double(*)(double)  f,
double *  cf
const [inherited]
 

Coefficients of the interpolant polynomial through the Gauss-Lobatto nodes.

Parameters:
(*f)(double) function to be interpolated
cf [output] array containing the N+1 coefficients of the expansion of the interpolant on the basis polynomials. This array must be of size at least N+1 and must have been allocated by the user prior to the call of this method.

Definition at line 156 of file ortho_poly.C.

References Ortho_poly::gauss_lobatto_nodes(), Ortho_poly::gauss_lobatto_weight(), and Ortho_poly::nn.

void Chebyshev_poly::coef_interpolant_GL_FFT double(*)(double)  f,
double *  cf
const
 

Coefficients of the interpolant polynomial through the Gauss-Lobatto nodes via a FFT.

Parameters:
(*f)(double) function to be interpolated
cf [output] array of size containing the N+1 coefficients of the expansion of the interpolant on the Chebyshev polynomials. This array must be of size at least N+1 and must have allocated by the user prior to the call of this method.

Definition at line 232 of file chebyshev_poly.C.

References gauss_lobatto_nodes(), and Ortho_poly::nn.

void Chebyshev_poly::coef_projection double(*)(double)  f,
double *  cf
const [virtual]
 

Coefficients of the expansion over the Chebyshev polynomials of the orthogonal projection on the space of polynomials of maximum degree N.

Parameters:
(*f)(double) function to be projected
cf [output] array containing the N+1 coefficients of the expansion over the Chebyshev polynomials of the orthogonal projection on the space of polynomials of maximum degree N. This array must be of size at least N+1 and must have been allocated by the user prior to the call of this method.

Implements Ortho_poly.

Definition at line 254 of file chebyshev_poly.C.

References Ortho_poly::coef_interpolant_GL(), and Ortho_poly::nn.

double Chebyshev_poly::gauss_gamma int  i  )  const [virtual]
 

Gamma factor $\gamma_i$ (square of the polynomial no.

i with respect to the discrete scalar product associated with the Gauss nodes)

Implements Ortho_poly.

Definition at line 163 of file chebyshev_poly.C.

References Ortho_poly::nn, and Ortho_poly::p_gauss_gamma.

double Chebyshev_poly::gauss_lobatto_gamma int  i  )  const [virtual]
 

Gamma factor $\gamma_i$ (square of the polynomial no.

i with respect to the discrete scalar product associated with the Gauss-Lobatto nodes)

Implements Ortho_poly.

Definition at line 209 of file chebyshev_poly.C.

References Ortho_poly::nn, and Ortho_poly::p_gauss_lobatto_gamma.

const Grid & Chebyshev_poly::gauss_lobatto_nodes  )  const [virtual]
 

Gauss-Lobatto nodes.

Implements Ortho_poly.

Definition at line 179 of file chebyshev_poly.C.

References Ortho_poly::nn, and Ortho_poly::p_gauss_lobatto_nodes.

double Chebyshev_poly::gauss_lobatto_weight int  i  )  const [virtual]
 

Gauss-Lobatto weights.

Parameters:
i index of the weight
Returns:
weight $w_i$

Implements Ortho_poly.

Definition at line 190 of file chebyshev_poly.C.

References Ortho_poly::nn, and Ortho_poly::p_gauss_lobatto_weights.

const Grid & Chebyshev_poly::gauss_nodes  )  const [virtual]
 

Gauss nodes.

Implements Ortho_poly.

Definition at line 138 of file chebyshev_poly.C.

References Ortho_poly::nn, and Ortho_poly::p_gauss_nodes.

double Chebyshev_poly::gauss_weight int  i  )  const [virtual]
 

Gauss weights.

Parameters:
i index of the weight
Returns:
weight $w_i$

Implements Ortho_poly.

Definition at line 149 of file chebyshev_poly.C.

References Ortho_poly::nn, and Ortho_poly::p_gauss_weights.

int Ortho_poly::n  )  const [inherited]
 

returns N, i.e. the maximum degree of the polynomials

Definition at line 117 of file ortho_poly.C.

References Ortho_poly::nn.

double Chebyshev_poly::operator() int  i,
double  x
const [virtual]
 

Value of the polynomial $p_i$.

Parameters:
i no. of the polynomial
x point in [-1,1] where the polynomial is to be evaluated
Returns:
value of $p_i(x)$

Implements Ortho_poly.

Definition at line 111 of file chebyshev_poly.C.

References Ortho_poly::nn.

void Chebyshev_poly::operator= const Chebyshev_poly  ) 
 

Assignment to another Chebyshev_poly.

Definition at line 78 of file chebyshev_poly.C.

double Ortho_poly::series const double *  a,
double  x
const [inherited]
 

Value of some expansion over the polynomials: $\sum_{i=0}^N a_i\, p_i(x)$.

Parameters:
a array of size at least N+1 and storing the N+1 coefficients $a_i$ of the expansion on the basis polynomials $p_i(x)$. For an interpolant polynomial, a is the array cf computed by the method coef_interpolant_Gauss (Gauss nodes) or coef_interpolant_GL (Gauss-Lobatto nodes)
x point in [-1,1] where the series is to be evaluated
Returns:
value of $\sum_{i=0}^N a_i\, p_i(x)$

Definition at line 184 of file ortho_poly.C.

References Ortho_poly::nn.

double Chebyshev_poly::weight double  x  )  const [virtual]
 

Weight function $w$.

Parameters:
x point in [-1,1] where the weight function is to be evaluated
Returns:
$w(x)=1/\sqrt{1-x^2}$

Implements Ortho_poly.

Definition at line 100 of file chebyshev_poly.C.


Member Data Documentation

const int Ortho_poly::nn [protected, inherited]
 

N = maximum degree of the polynomials

Definition at line 57 of file ortho_poly.h.

double* Ortho_poly::p_gauss_gamma [mutable, protected, inherited]
 

Pointer on the gamma factors (squares of the polynomials with respect to the discrete scalar product associated with the Gauss nodes).

Definition at line 71 of file ortho_poly.h.

double* Ortho_poly::p_gauss_lobatto_gamma [mutable, protected, inherited]
 

Pointer on the gamma factors (square of the polynomials with respect to the discrete scalar product associated with the Gauss-Lobatto nodes).

Definition at line 85 of file ortho_poly.h.

const Grid* Ortho_poly::p_gauss_lobatto_nodes [mutable, protected, inherited]
 

Pointer on the Gauss-Lobatto nodes.

Definition at line 75 of file ortho_poly.h.

double* Ortho_poly::p_gauss_lobatto_weights [mutable, protected, inherited]
 

Pointer on the Gauss-Lobatto weights.

Definition at line 79 of file ortho_poly.h.

const Grid* Ortho_poly::p_gauss_nodes [mutable, protected, inherited]
 

Pointer on the Gauss nodes.

Definition at line 61 of file ortho_poly.h.

double* Ortho_poly::p_gauss_weights [mutable, protected, inherited]
 

Pointer on the Gauss weights.

Definition at line 65 of file ortho_poly.h.


The documentation for this class was generated from the following files:
Generated on Tue Dec 6 14:48:44 2011 for POLYNOM by  doxygen 1.4.6