
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 |
Legendre polynomials of arbitrary degree on [0,1].
Constructing a Legendre polynomial of degree p, the coefficients will be computed by the three-term recursion formula. The coefficients are stored in a static data vector to be available when needed next time. Since the recursion is performed for the interval
, the polynomials are shifted to
by the scale and shift functions of Polynomial, afterwards.
| Polynomials::Legendre::Legendre | ( | const unsigned int | p | ) |
Constructor for polynomial of degree p.
| 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.
| 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.
std::vector<std_cxx1x::shared_ptr<const std::vector<double> > > Polynomials::Legendre::shifted_coefficients [static, private] |
Coefficients for the interval
.
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.
documentation generated on Fri Aug 12 2011 15:01:10 by
doxygen
1.7.4