Ortho_poly Class Reference
[Orthogonal polynomials]

Base class for orthogonal polynomials on [-1,1]. More...

#include <ortho_poly.h>

Inheritance diagram for Ortho_poly:

Chebyshev_poly Legendre_poly List of all members.

Public Member Functions

virtual ~Ortho_poly ()
 Destructor.
void operator= (const Ortho_poly &)
 Assignment to another Ortho_poly.
int n () const
 returns N, i.e. the maximum degree of the polynomials
virtual double weight (double x) const =0
 Weight function $w$.
virtual double operator() (int i, double x) const =0
 Value of the polynomial $p_i$.
virtual const Gridgauss_nodes () const =0
 Gauss nodes.
virtual double gauss_weight (int i) const =0
 Gauss weights.
virtual double gauss_gamma (int i) const =0
 Gamma factor $\gamma_i$ (square of the polynomial number i with respect to the discrete scalar product associated with the Gauss nodes).
virtual const Gridgauss_lobatto_nodes () const =0
 Gauss-Lobatto nodes.
virtual double gauss_lobatto_weight (int i) const =0
 Gauss-Lobatto weights.
virtual double gauss_lobatto_gamma (int i) const =0
 Gamma factor $\gamma_i$ (square of the polynomial number i with respect to the discrete scalar product associated with the Gauss-Lobatto nodes).
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.
virtual void coef_projection (double(*f)(double), double *cf) const =0
 Coefficients of the expansion over the basis polynomials of the orthogonal projection on the space of polynomials of maximum degree N.
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 Member Functions

 Ortho_poly (const Ortho_poly &)
 Copy constructor.
 Ortho_poly (int ni)
 Constructor to be used only by derived classes (hence protected).

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

Base class for orthogonal polynomials on [-1,1].

() Storage of polynomials of an orthogonal family $(p_i)$ up to a given degree N. The class Ortho_poly is abstract: it cannot be instanciated.

Definition at line 52 of file ortho_poly.h.


Constructor & Destructor Documentation

Ortho_poly::Ortho_poly const Ortho_poly  )  [protected]
 

Copy constructor.

Definition at line 56 of file ortho_poly.C.

References p_gauss_gamma, p_gauss_lobatto_gamma, p_gauss_lobatto_nodes, p_gauss_lobatto_weights, p_gauss_nodes, and p_gauss_weights.

Ortho_poly::Ortho_poly int  ni  )  [protected]
 

Constructor to be used only by derived classes (hence protected).

Parameters:
ni maximum degree N of the polynomials

Definition at line 72 of file ortho_poly.C.

References p_gauss_gamma, p_gauss_lobatto_gamma, p_gauss_lobatto_nodes, p_gauss_lobatto_weights, p_gauss_nodes, and p_gauss_weights.

Ortho_poly::~Ortho_poly  )  [virtual]
 

Destructor.

Definition at line 91 of file ortho_poly.C.

References p_gauss_gamma, p_gauss_lobatto_gamma, p_gauss_lobatto_nodes, p_gauss_lobatto_weights, p_gauss_nodes, and p_gauss_weights.


Member Function Documentation

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

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 gauss_nodes(), gauss_weight(), and nn.

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

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 gauss_lobatto_nodes(), gauss_lobatto_weight(), and nn.

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

Coefficients of the expansion over the basis 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 basis 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.

Implemented in Chebyshev_poly, and Legendre_poly.

virtual double Ortho_poly::gauss_gamma int  i  )  const [pure virtual]
 

Gamma factor $\gamma_i$ (square of the polynomial number i with respect to the discrete scalar product associated with the Gauss nodes).

Implemented in Chebyshev_poly, and Legendre_poly.

virtual double Ortho_poly::gauss_lobatto_gamma int  i  )  const [pure virtual]
 

Gamma factor $\gamma_i$ (square of the polynomial number i with respect to the discrete scalar product associated with the Gauss-Lobatto nodes).

Implemented in Chebyshev_poly, and Legendre_poly.

virtual const Grid& Ortho_poly::gauss_lobatto_nodes  )  const [pure virtual]
 

Gauss-Lobatto nodes.

Implemented in Chebyshev_poly, and Legendre_poly.

virtual double Ortho_poly::gauss_lobatto_weight int  i  )  const [pure virtual]
 

Gauss-Lobatto weights.

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

Implemented in Chebyshev_poly, and Legendre_poly.

virtual const Grid& Ortho_poly::gauss_nodes  )  const [pure virtual]
 

Gauss nodes.

Implemented in Chebyshev_poly, and Legendre_poly.

virtual double Ortho_poly::gauss_weight int  i  )  const [pure virtual]
 

Gauss weights.

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

Implemented in Chebyshev_poly, and Legendre_poly.

int Ortho_poly::n  )  const
 

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

Definition at line 117 of file ortho_poly.C.

References nn.

virtual double Ortho_poly::operator() int  i,
double  x
const [pure 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)$

Implemented in Chebyshev_poly, and Legendre_poly.

void Ortho_poly::operator= const Ortho_poly  ) 
 

Assignment to another Ortho_poly.

Definition at line 106 of file ortho_poly.C.

double Ortho_poly::series const double *  a,
double  x
const
 

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 nn.

virtual double Ortho_poly::weight double  x  )  const [pure virtual]
 

Weight function $w$.

Parameters:
x point in [-1,1] where the weight function is to be evaluated
Returns:
value of $w(x)$

Implemented in Chebyshev_poly, and Legendre_poly.


Member Data Documentation

const int Ortho_poly::nn [protected]
 

N = maximum degree of the polynomials

Definition at line 57 of file ortho_poly.h.

double* Ortho_poly::p_gauss_gamma [mutable, protected]
 

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]
 

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]
 

Pointer on the Gauss-Lobatto nodes.

Definition at line 75 of file ortho_poly.h.

double* Ortho_poly::p_gauss_lobatto_weights [mutable, protected]
 

Pointer on the Gauss-Lobatto weights.

Definition at line 79 of file ortho_poly.h.

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

Pointer on the Gauss nodes.

Definition at line 61 of file ortho_poly.h.

double* Ortho_poly::p_gauss_weights [mutable, protected]
 

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