Dedekind 0.0.0
A structuralist C++23 Module Library
Loading...
Searching...
No Matches
dedekind::algebra::Tropical< T, Max > Struct Template Referenceexport

Tropical carrier T ∪ {∞}. finite==false is the ⊕-identity sentinel (−∞ for Max, +∞ for Min), absorbing under ⊗. operator+ is ⊗ (honest addition); ⊕ is TropicalPlus. More...

Static Public Member Functions

static constexpr Tropical of (T v)

Public Attributes

bool finite = false
T val = T{}

Static Public Attributes

template<typename Op>
static constexpr bool is_associative_v = true
template<typename Op>
static constexpr bool is_commutative_v = true
template<typename Op>
static constexpr bool is_idempotent_v = std::same_as<Op, TropicalPlus>

Friends

constexpr bool operator== (const Tropical &a, const Tropical &b)
 All ∞ representations are equal: val is dead when !finite, so a non-canonical {false, k} still compares equal to the {false, T{}} sentinel (preserving the additive-identity law).
constexpr Tropical operator+ (const Tropical &a, const Tropical &b)
 ⊗ = + (the naturals' addition), saturating so it stays monotone over ⊕ and hence distributive; ∞ absorbs. For unsigned T the finite sum clamps at max on overflow — the bounded max-plus dioid — which is what makes the IsSemiring distributivity certificate honest rather than false at the wraparound boundary.

Detailed Description

template<typename T, bool Max = true>
struct dedekind::algebra::Tropical< T, Max >

Tropical carrier T ∪ {∞}. finite==false is the ⊕-identity sentinel (−∞ for Max, +∞ for Min), absorbing under ⊗. operator+ is ⊗ (honest addition); ⊕ is TropicalPlus.


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