The monoid algebra R[M]: a finitely supported function from the monomials to the coefficients, stored as its support sorted along the monomials' chain, no coefficient zero. A net (Domain the monomials, Codomain the coefficients, p(m) the coefficient of m), a commutative rig over a commutative rig, a ring over a ring (- where R has additive inverses).
More...
|
|
using | coefficient_type = R |
|
using | monomial_type = M |
|
using | Domain = M |
|
using | Codomain = R |
|
using | term_type = std::pair<M, R> |
|
|
constexpr | Polynomial ()=default |
| | The zero polynomial.
|
|
constexpr | Polynomial (R scalar) |
| | A constant.
|
| constexpr | Polynomial (std::vector< term_type > terms) |
| | The sum of the given terms, in any order: combined, sorted, zero coefficients dropped.
|
|
constexpr R | operator() (const M &m) const |
| | The net: the coefficient of m, zero off the support.
|
|
constexpr const std::vector< term_type > & | support () const noexcept |
| | The support with its coefficients: the finite function this polynomial is, sorted along the monomials' chain.
|
|
constexpr bool | is_zero () const |
|
constexpr auto | degree () const |
| | The total degree of the leading monomial; 0 for the zero polynomial.
|
| constexpr const R & | leading_coefficient () const |
|
constexpr Polynomial | derive (std::size_t slot=0) const |
| | The formal partial derivative by the variable of slot: ∂(c·m) = e·c·m/π, the factor e by repeated doubling, so no more than R's addition is asked (a rig suffices).
|
|
|
static constexpr Polynomial | zero () |
|
static constexpr Polynomial | one () |
|
static constexpr Polynomial | variable (std::size_t slot) |
| | The variable of slot, as a polynomial.
|
The monoid algebra R[M]: a finitely supported function from the monomials to the coefficients, stored as its support sorted along the monomials' chain, no coefficient zero. A net (Domain the monomials, Codomain the coefficients, p(m) the coefficient of m), a commutative rig over a commutative rig, a ring over a ring (- where R has additive inverses).
- Template Parameters
-
| R | the coefficients. |
| M | the monomials: a commutative monoid that is a chain. |
◆ Polynomial()
template<typename R, typename M = Monomial<1>>
The sum of the given terms, in any order: combined, sorted, zero coefficients dropped.
- Parameters
-
| terms | monomial and coefficient pairs. |
◆ leading_coefficient()
template<typename R, typename M = Monomial<1>>
- Exceptions
-
| std::domain_error | on the zero polynomial. |
The documentation for this class was generated from the following file: