#[repr(transparent)]pub struct MaxMul<T>(pub T);Expand description
Max-times tropical scalar: ⊕ = max, ⊗ = ×.
Used for probabilistic models where you want the most likely path (Viterbi algorithm with probabilities in [0, 1]).
§Examples
ⓘ
use tenferro_tropical::MaxMul;
let a = MaxMul(0.3_f64);
let b = MaxMul(0.7_f64);
// Tropical addition = max
let c = a + b; // MaxMul(0.7)
// Tropical multiplication = ordinary multiplication
let d = a * b; // MaxMul(0.21)Tuple Fields§
§0: TTrait Implementations§
Source§impl HasAlgebra for MaxMul<f32>
impl HasAlgebra for MaxMul<f32>
Source§type Algebra = MaxMulAlgebra
type Algebra = MaxMulAlgebra
The algebra associated with this scalar type.
Source§impl HasAlgebra for MaxMul<f64>
impl HasAlgebra for MaxMul<f64>
Source§type Algebra = MaxMulAlgebra
type Algebra = MaxMulAlgebra
The algebra associated with this scalar type.
Source§impl<T: PartialOrd> PartialOrd for MaxMul<T>
impl<T: PartialOrd> PartialOrd for MaxMul<T>
impl<T: Copy> Copy for MaxMul<T>
impl<T> StructuralPartialEq for MaxMul<T>
Auto Trait Implementations§
impl<T> Freeze for MaxMul<T>where
T: Freeze,
impl<T> RefUnwindSafe for MaxMul<T>where
T: RefUnwindSafe,
impl<T> Send for MaxMul<T>where
T: Send,
impl<T> Sync for MaxMul<T>where
T: Sync,
impl<T> Unpin for MaxMul<T>where
T: Unpin,
impl<T> UnwindSafe for MaxMul<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