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< const std::vector< double > * > | shifted_coefficients |
static std::vector< 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.
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.
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<const std::vector<double> *> Polynomials::Legendre::shifted_coefficients [static, private] |
Coefficients for the interval .
std::vector<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.