pub struct MaxMulAlgebra<T>(/* private fields */);Expand description
Algebra marker for the max-times tropical semiring (⊕ = max, ⊗ = ×).
§Examples
use tenferro_algebra::Semiring;
use tenferro_ext_tropical::{MaxMul, MaxMulAlgebra};
let z = <MaxMulAlgebra<f64> as Semiring>::zero();
assert_eq!(z, MaxMul(0.0f64));Trait Implementations§
Source§impl Algebra for MaxMulAlgebra<f32>
impl Algebra for MaxMulAlgebra<f32>
Source§impl Algebra for MaxMulAlgebra<f64>
impl Algebra for MaxMulAlgebra<f64>
Source§impl<T: Clone> Clone for MaxMulAlgebra<T>
impl<T: Clone> Clone for MaxMulAlgebra<T>
Source§fn clone(&self) -> MaxMulAlgebra<T>
fn clone(&self) -> MaxMulAlgebra<T>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<T: Debug> Debug for MaxMulAlgebra<T>
impl<T: Debug> Debug for MaxMulAlgebra<T>
Source§impl Semiring for MaxMulAlgebra<f32>
impl Semiring for MaxMulAlgebra<f32>
Source§impl Semiring for MaxMulAlgebra<f64>
impl Semiring for MaxMulAlgebra<f64>
Source§impl<S: Scalar + Float> TensorSemiringCore<MaxMulAlgebra<S>> for CpuBackend
impl<S: Scalar + Float> TensorSemiringCore<MaxMulAlgebra<S>> for CpuBackend
Source§type Plan = TropicalPlan<MaxMul<S>>
type Plan = TropicalPlan<MaxMul<S>>
Backend-specific plan type.
Source§type Context = CpuContext
type Context = CpuContext
Backend-specific execution context.
Source§fn plan(
_ctx: &mut CpuContext,
desc: &SemiringCoreDescriptor,
shapes: &[&[usize]],
) -> Result<TropicalPlan<MaxMul<S>>>
fn plan( _ctx: &mut CpuContext, desc: &SemiringCoreDescriptor, shapes: &[&[usize]], ) -> Result<TropicalPlan<MaxMul<S>>>
Plan a semiring-core operation.
Source§impl<S: Scalar + Float> TensorSemiringFastPath<MaxMulAlgebra<S>> for CpuBackend
impl<S: Scalar + Float> TensorSemiringFastPath<MaxMulAlgebra<S>> for CpuBackend
Source§type Plan = TropicalPlan<MaxMul<S>>
type Plan = TropicalPlan<MaxMul<S>>
Backend-specific plan type.
Source§type Context = CpuContext
type Context = CpuContext
Backend-specific execution context.
Source§fn plan(
_ctx: &mut CpuContext,
_desc: &SemiringFastPathDescriptor,
_shapes: &[&[usize]],
) -> Result<TropicalPlan<MaxMul<S>>>
fn plan( _ctx: &mut CpuContext, _desc: &SemiringFastPathDescriptor, _shapes: &[&[usize]], ) -> Result<TropicalPlan<MaxMul<S>>>
Plan an optional semiring fast path.
Source§fn execute(
_ctx: &mut CpuContext,
_plan: &TropicalPlan<MaxMul<S>>,
_alpha: MaxMul<S>,
_inputs: &[&Tensor<MaxMul<S>>],
_beta: MaxMul<S>,
_output: &mut Tensor<MaxMul<S>>,
) -> Result<()>
fn execute( _ctx: &mut CpuContext, _plan: &TropicalPlan<MaxMul<S>>, _alpha: MaxMul<S>, _inputs: &[&Tensor<MaxMul<S>>], _beta: MaxMul<S>, _output: &mut Tensor<MaxMul<S>>, ) -> Result<()>
Execute an optional semiring fast path.
Source§fn has_fast_path(_desc: SemiringFastPathDescriptor) -> bool
fn has_fast_path(_desc: SemiringFastPathDescriptor) -> bool
Query whether the optional path is available.
impl<T: Copy> Copy for MaxMulAlgebra<T>
Auto Trait Implementations§
impl<T> Freeze for MaxMulAlgebra<T>
impl<T> RefUnwindSafe for MaxMulAlgebra<T>where
T: RefUnwindSafe,
impl<T> Send for MaxMulAlgebra<T>where
T: Send,
impl<T> Sync for MaxMulAlgebra<T>where
T: Sync,
impl<T> Unpin for MaxMulAlgebra<T>where
T: Unpin,
impl<T> UnwindSafe for MaxMulAlgebra<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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T> DistributionExt for Twhere
T: ?Sized,
fn rand<T>(&self, rng: &mut (impl Rng + ?Sized)) -> Twhere
Self: Distribution<T>,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more