// ---
// tags: trop, source
// crystal-type: source
// crystal-domain: comp
// ---
//! Max-plus (dual tropical) semiring.
//!
//! The max-plus semiring (max, +):
//! - Addition: a + b = max(a, b)
//! - Multiplication: a * b = a + b (ordinary)
//! - Additive identity (ZERO): 0 representing -inf
//! - Multiplicative identity (ONE): 1 representing 0
//!
//! Encoding: `MaxPlus(0)` = -inf (identity for max). Values 1..u64::MAX
//! represent the integers 0..(u64::MAX - 2) via a +1 offset.
/// A max-plus semiring element.
///
/// `MaxPlus(0)` is -inf (additive identity).
/// `MaxPlus(v)` for v >= 1 represents the value (v - 1).
;
trop/rs/src/dual.rs
ฯ 0.0%