Reference documentation for deal.II version 8.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Member Functions | Static Public Member Functions | Static Private Member Functions | Static Private Attributes | List of all members
Polynomials::Legendre Class Reference

#include <polynomial.h>

Inheritance diagram for Polynomials::Legendre:
[legend]

Public Member Functions

 Legendre (const unsigned int p)
 
- Public Member Functions inherited from Polynomials::Polynomial< double >
 Polynomial (const std::vector< double > &coefficients)
 
 Polynomial (const unsigned int n)
 
 Polynomial (const std::vector< Point< 1 > > &lagrange_support_points, const unsigned int evaluation_point)
 
 Polynomial ()
 
double value (const doublex) const
 
void value (const doublex, std::vector< double > &values) const
 
unsigned int degree () const
 
void scale (const doublefactor)
 
void shift (const number2 offset)
 
Polynomial< doublederivative () const
 
Polynomial< doubleprimitive () const
 
Polynomial< double > & operator*= (const double s)
 
Polynomial< double > & operator*= (const Polynomial< double > &p)
 
Polynomial< double > & operator+= (const Polynomial< double > &p)
 
Polynomial< double > & operator-= (const Polynomial< double > &p)
 
bool operator== (const Polynomial< double > &p) const
 
void print (std::ostream &out) const
 
void serialize (Archive &ar, const unsigned int version)
 
- Public Member Functions inherited from Subscriptor
 Subscriptor ()
 
 Subscriptor (const Subscriptor &)
 
virtual ~Subscriptor ()
 
Subscriptoroperator= (const Subscriptor &)
 
void subscribe (const char *identifier=0) const
 
void unsubscribe (const char *identifier=0) const
 
unsigned int n_subscriptions () const
 
void list_subscribers () const
 
 DeclException3 (ExcInUse, int, char *, std::string &,<< "Object of class "<< arg2<< " is still used by "<< arg1<< " other objects.\n"<< "(Additional information: "<< arg3<< ")\n"<< "Note the entry in the Frequently Asked Questions of "<< "deal.II (linked to from http://www.dealii.org/) for "<< "more information on what this error means.")
 
 DeclException2 (ExcNoSubscriber, char *, char *,<< "No subscriber with identifier \""<< arg2<< "\" did subscribe to this object of class "<< arg1)
 
template<class Archive >
void serialize (Archive &ar, const unsigned int version)
 

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
 

Additional Inherited Members

- Protected Member Functions inherited from Polynomials::Polynomial< double >
void transform_into_standard_form ()
 
- Static Protected Member Functions inherited from Polynomials::Polynomial< double >
static void scale (std::vector< double > &coefficients, const doublefactor)
 
static void shift (std::vector< double > &coefficients, const number2 shift)
 
static void multiply (std::vector< double > &coefficients, const doublefactor)
 
- Protected Attributes inherited from Polynomials::Polynomial< double >
std::vector< doublecoefficients
 
bool in_lagrange_product_form
 
std::vector< doublelagrange_support_points
 
double lagrange_weight
 

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 372 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)
staticprivate

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)
staticprivate

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
staticprivate

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

Definition at line 401 of file polynomial.h.

std::vector<std_cxx1x::shared_ptr<const std::vector<double> > > Polynomials::Legendre::recursive_coefficients
staticprivate

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 416 of file polynomial.h.


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