Module prims

Module prims 

Source
Expand description

Semiring-family implementations for tropical algebras on tenferro_prims::CpuBackend.

Each tropical algebra gets its own impl TensorSemiringCore<XxxAlgebra> for CpuBackend plus a TensorSemiringFastPath impl that reports no optional fast paths. The orphan rule is satisfied because XxxAlgebra is defined in this crate.

Optional fast paths (Contract, elementwise semiring binary ops) are not supported for tropical algebras.

Because tropical scalar types redefine Add (= max/min) and Mul (= +/×), the standard ScalarBase-based helper functions work correctly: the expression sum = sum + a * b becomes sum = max(sum, a_val + b_val) for MaxPlus, which is exactly tropical GEMM.

Enums§

TropicalPlan
Execution plan for tropical primitive operations on CPU.