Template Class poly

Inheritance Relationships

Derived Types

Class Documentation

template<typename INT, typename REAL>
class opoly::poly

Base class defining an orthogonal polynomial

  • INT is a integer type, can be also unsigned

  • REAL is a floating point type, can be float or a high precision number class

Subclassed by opoly::Chebyshev< INT, REAL >, opoly::Hermite< INT, REAL >, opoly::Jacobi< INT, REAL >, opoly::Laguerre< INT, REAL >, opoly::Legendre< INT, REAL >

Public Types

typedef INT int_type
typedef int_type *int_pointer
typedef int_type const *int_const_pointer
typedef int_type int_reference
typedef int_type const &int_const_reference
typedef REAL real_type
typedef real_type *pointer
typedef real_type const *const_pointer
typedef real_type &reference
typedef real_type const &const_reference

Public Functions

inline poly()
inline virtual ~poly()
virtual real_type operator()(int_type n, const_reference x) const = 0

Evaluate the polynomial

Parameters
  • n[in] the degree op the polynomial

  • x[in] the value at which the polynomial is evaluated

Returns

the value \( p(x) \)

virtual int_type svar(int_type n, const_reference x) const = 0

Evaluate the sign variation of the corresponding sturm sequence.

Parameters
  • n[in] the degree op the polynomial

  • x[in] the value at which the polynomial is evaluated

Returns

the number of sign variations

virtual int_type eval(int_type n, const_reference x, reference p) const = 0

Evaluate the polynomial and the sign variation of the corresponding sturm sequence.

Parameters
  • n[in] the degree op the polynomial

  • x[in] the value at which the polynomial is evaluated

  • p[out] the value \( p(x) \)

Returns

the number of sign variations

virtual int_type eval(int_type n, const_reference x, reference p, reference dp) const = 0

Evaluate the polynomial and its derivative. Moreover return the sign variation of the corresponding sturm sequence.

Parameters
  • n[in] the degree op the polynomial

  • x[in] the value at which the polynomial is evaluated

  • p[out] the value \( p(x) \)

  • dp[out] the value \( p'(x) \)

Returns

the number of sign variations

virtual int_type sequence(int_type n, const_reference x, pointer pvec) const = 0

Evaluate the Sturm sequence

Parameters
  • n[in] the degree of the polynomial

  • x[in] the value at which the polynomial is evaluated

  • pvec[out] the sequence \( p_0(x) \), \( p_1(x) \), …, \( p_n(x) \) of the 3 term recurrence

Returns

the number of sign variations

virtual real_type weight(const_reference x) const = 0

Weight function of the orthogonal polynomial

Parameters

x[in] the value at which the weight is evaluated