Dedekind 0.0.0
A structuralist C++23 Module Library
Loading...
Searching...
No Matches
dedekind::algebra::Monomial< N > Struct Template Referenceexport

A monomial in N variables: its exponents, one per slot (π is the slot 0; π_1, π_2, π_3 the slots 1, 2, 3). The free commutative monoid on N generators, written multiplicatively (the exponents add, as natural numbers: leaving the word raises), and a chain under the graded lexicographic order: by total degree, then by exponents. More...

Collaboration diagram for dedekind::algebra::Monomial< N >:

Public Member Functions

constexpr unsigned long long degree () const
 The total degree, in a wider word than the exponents.
constexpr unsigned exponent (std::size_t slot) const
 The exponent of slot.
constexpr Monomial without (std::size_t slot) const
 This monomial with one factor of slot removed; defined where exponent(slot) is positive (the derivative's use).

Static Public Member Functions

static constexpr Monomial one ()
 The empty product, the monoid's unit.
static constexpr Monomial variable (std::size_t slot)
 The variable of slot.

Public Attributes

std::array< unsigned, N > e {}

Friends

constexpr Monomial operator* (const Monomial &a, const Monomial &b)
 The product: exponents add.
constexpr bool operator== (const Monomial &, const Monomial &)=default
constexpr std::strong_ordering operator<=> (const Monomial &a, const Monomial &b)
 The graded lexicographic order.

Detailed Description

template<std::size_t N>
struct dedekind::algebra::Monomial< N >

A monomial in N variables: its exponents, one per slot (π is the slot 0; π_1, π_2, π_3 the slots 1, 2, 3). The free commutative monoid on N generators, written multiplicatively (the exponents add, as natural numbers: leaving the word raises), and a chain under the graded lexicographic order: by total degree, then by exponents.

Template Parameters
Nthe number of variables.

Member Function Documentation

◆ exponent()

template<std::size_t N>
unsigned dedekind::algebra::Monomial< N >::exponent ( std::size_t slot) const
inlineconstexpr

The exponent of slot.

Exceptions
std::out_of_rangebeyond N.

◆ variable()

template<std::size_t N>
constexpr Monomial dedekind::algebra::Monomial< N >::variable ( std::size_t slot)
inlinestaticconstexpr

The variable of slot.

Exceptions
std::out_of_rangebeyond N.

◆ operator*

template<std::size_t N>
Monomial operator* ( const Monomial< N > & a,
const Monomial< N > & b )
friend

The product: exponents add.

Exceptions
std::overflow_errorwhere an exponent would leave the word.

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