Public Member Functions | Static Public Member Functions | Static Private Member Functions | Static Private Attributes

Polynomials::Legendre Class Reference

Inheritance diagram for Polynomials::Legendre:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 Legendre (const unsigned int p)

Static Public Member Functions

static std::vector< Polynomial
< double > > 
generate_complete_basis (const unsigned int degree)

Static Private Member Functions

static void compute_coefficients (const unsigned int p)
static const std::vector
< double > & 
get_coefficients (const unsigned int k)

Static Private Attributes

static std::vector
< std_cxx1x::shared_ptr< const
std::vector< double > > > 
shifted_coefficients
static std::vector
< std_cxx1x::shared_ptr< const
std::vector< double > > > 
recursive_coefficients

Detailed Description

Legendre polynomials of arbitrary degree. Constructing a Legendre polynomial of degree p, the coefficients will be computed by the three-term recursion formula.

Note:
The polynomials defined by this class differ in two aspects by what is usually referred to as Legendre polynomials: (i) This classes defines them on the reference interval $[0,1]$, rather than the commonly used interval $[-1,1]$. (ii) The polynomials have been scaled in such a way that they are orthonormal, not just orthogonal; consequently, the polynomials do not necessarily have boundary values equal to one.
Author:
Guido Kanschat, 2000

Definition at line 448 of file polynomial.h.


Constructor & Destructor Documentation

Polynomials::Legendre::Legendre ( const unsigned int  p )

Constructor for polynomial of degree p.


Member Function Documentation

static std::vector<Polynomial<double> > Polynomials::Legendre::generate_complete_basis ( const unsigned int  degree ) [static]

Return a vector of Legendre polynomial objects of degrees zero through degree, which then spans the full space of polynomials up to the given degree. This function may be used to initialize the TensorProductPolynomials and PolynomialSpace classes.

static void Polynomials::Legendre::compute_coefficients ( const unsigned int  p ) [static, private]

Compute coefficients recursively. The coefficients are stored in a static data vector to be available when needed next time. Since the recursion is performed for the interval $[-1,1]$, the polynomials are shifted to $[0,1]$ by the scale and shift functions of Polynomial, afterwards.

static const std::vector<double>& Polynomials::Legendre::get_coefficients ( const unsigned int  k ) [static, private]

Get coefficients for constructor. This way, it can use the non-standard constructor of Polynomial.


Member Data Documentation

std::vector<std_cxx1x::shared_ptr<const std::vector<double> > > Polynomials::Legendre::shifted_coefficients [static, private]

Coefficients for the interval $[0,1]$.

Definition at line 477 of file polynomial.h.

std::vector<std_cxx1x::shared_ptr<const std::vector<double> > > Polynomials::Legendre::recursive_coefficients [static, private]

Vector with already computed coefficients. For each degree of the polynomial, we keep one pointer to the list of coefficients; we do so rather than keeping a vector of vectors in order to simplify programming multithread-safe. In order to avoid memory leak, we use a shared_ptr in order to correctly free the memory of the vectors when the global destructor is called.

Definition at line 492 of file polynomial.h.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

deal.II documentation generated on Fri Feb 3 2012 06:04:16 by doxygen 1.7.2