#[repr(transparent)]pub struct MaxPlus<T>(pub T);Expand description
Max-plus tropical scalar: ⊕ = max, ⊗ = +.
The most common tropical semiring, used for shortest-path and
optimal-alignment problems. Wraps any ordered numeric type T.
§Examples
ⓘ
use tenferro_tropical::MaxPlus;
let a = MaxPlus(3.0_f64);
let b = MaxPlus(5.0_f64);
// Tropical addition = max
let c = a + b; // MaxPlus(5.0)
// Tropical multiplication = ordinary addition
let d = a * b; // MaxPlus(8.0)Tuple Fields§
§0: TTrait Implementations§
Source§impl HasAlgebra for MaxPlus<f32>
impl HasAlgebra for MaxPlus<f32>
Source§type Algebra = MaxPlusAlgebra
type Algebra = MaxPlusAlgebra
The algebra associated with this scalar type.
Source§impl HasAlgebra for MaxPlus<f64>
impl HasAlgebra for MaxPlus<f64>
Source§type Algebra = MaxPlusAlgebra
type Algebra = MaxPlusAlgebra
The algebra associated with this scalar type.
Source§impl<T: PartialOrd> PartialOrd for MaxPlus<T>
impl<T: PartialOrd> PartialOrd for MaxPlus<T>
impl<T: Copy> Copy for MaxPlus<T>
impl<T> StructuralPartialEq for MaxPlus<T>
Auto Trait Implementations§
impl<T> Freeze for MaxPlus<T>where
T: Freeze,
impl<T> RefUnwindSafe for MaxPlus<T>where
T: RefUnwindSafe,
impl<T> Send for MaxPlus<T>where
T: Send,
impl<T> Sync for MaxPlus<T>where
T: Sync,
impl<T> Unpin for MaxPlus<T>where
T: Unpin,
impl<T> UnwindSafe for MaxPlus<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more