TropicalScalar

Trait TropicalScalar 

Source
pub trait TropicalScalar:
    Copy
    + Clone
    + Send
    + Sync
    + Debug
    + Display
    + PartialOrd
    + 'static
    + Sized {
    // Required methods
    fn scalar_zero() -> Self;
    fn scalar_one() -> Self;
    fn scalar_add(self, rhs: Self) -> Self;
    fn scalar_mul(self, rhs: Self) -> Self;
    fn pos_infinity() -> Self;
    fn neg_infinity() -> Self;
    fn scalar_max(self, rhs: Self) -> Self;
    fn scalar_min(self, rhs: Self) -> Self;
}
Expand description

Trait for scalar types that can be used as underlying values in tropical numbers.

Required Methods§

Source

fn scalar_zero() -> Self

The additive identity (standard arithmetic).

Source

fn scalar_one() -> Self

The multiplicative identity (standard arithmetic).

Source

fn scalar_add(self, rhs: Self) -> Self

Standard arithmetic addition.

Source

fn scalar_mul(self, rhs: Self) -> Self

Standard arithmetic multiplication.

Source

fn pos_infinity() -> Self

Positive infinity (for MinPlus zero).

Source

fn neg_infinity() -> Self

Negative infinity (for MaxPlus zero).

Source

fn scalar_max(self, rhs: Self) -> Self

Maximum of two values.

Source

fn scalar_min(self, rhs: Self) -> Self

Minimum of two values.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl TropicalScalar for bool

Source§

fn scalar_zero() -> Self

Source§

fn scalar_one() -> Self

Source§

fn scalar_add(self, rhs: Self) -> Self

Source§

fn scalar_mul(self, rhs: Self) -> Self

Source§

fn pos_infinity() -> Self

Source§

fn neg_infinity() -> Self

Source§

fn scalar_max(self, rhs: Self) -> Self

Source§

fn scalar_min(self, rhs: Self) -> Self

Source§

impl TropicalScalar for f32

Source§

fn scalar_zero() -> Self

Source§

fn scalar_one() -> Self

Source§

fn scalar_add(self, rhs: Self) -> Self

Source§

fn scalar_mul(self, rhs: Self) -> Self

Source§

fn pos_infinity() -> Self

Source§

fn neg_infinity() -> Self

Source§

fn scalar_max(self, rhs: Self) -> Self

Source§

fn scalar_min(self, rhs: Self) -> Self

Source§

impl TropicalScalar for f64

Source§

fn scalar_zero() -> Self

Source§

fn scalar_one() -> Self

Source§

fn scalar_add(self, rhs: Self) -> Self

Source§

fn scalar_mul(self, rhs: Self) -> Self

Source§

fn pos_infinity() -> Self

Source§

fn neg_infinity() -> Self

Source§

fn scalar_max(self, rhs: Self) -> Self

Source§

fn scalar_min(self, rhs: Self) -> Self

Source§

impl TropicalScalar for i8

Source§

fn scalar_zero() -> Self

Source§

fn scalar_one() -> Self

Source§

fn scalar_add(self, rhs: Self) -> Self

Source§

fn scalar_mul(self, rhs: Self) -> Self

Source§

fn pos_infinity() -> Self

Source§

fn neg_infinity() -> Self

Source§

fn scalar_max(self, rhs: Self) -> Self

Source§

fn scalar_min(self, rhs: Self) -> Self

Source§

impl TropicalScalar for i16

Source§

fn scalar_zero() -> Self

Source§

fn scalar_one() -> Self

Source§

fn scalar_add(self, rhs: Self) -> Self

Source§

fn scalar_mul(self, rhs: Self) -> Self

Source§

fn pos_infinity() -> Self

Source§

fn neg_infinity() -> Self

Source§

fn scalar_max(self, rhs: Self) -> Self

Source§

fn scalar_min(self, rhs: Self) -> Self

Source§

impl TropicalScalar for i32

Source§

fn scalar_zero() -> Self

Source§

fn scalar_one() -> Self

Source§

fn scalar_add(self, rhs: Self) -> Self

Source§

fn scalar_mul(self, rhs: Self) -> Self

Source§

fn pos_infinity() -> Self

Source§

fn neg_infinity() -> Self

Source§

fn scalar_max(self, rhs: Self) -> Self

Source§

fn scalar_min(self, rhs: Self) -> Self

Source§

impl TropicalScalar for i64

Source§

fn scalar_zero() -> Self

Source§

fn scalar_one() -> Self

Source§

fn scalar_add(self, rhs: Self) -> Self

Source§

fn scalar_mul(self, rhs: Self) -> Self

Source§

fn pos_infinity() -> Self

Source§

fn neg_infinity() -> Self

Source§

fn scalar_max(self, rhs: Self) -> Self

Source§

fn scalar_min(self, rhs: Self) -> Self

Source§

impl TropicalScalar for u8

Source§

fn scalar_zero() -> Self

Source§

fn scalar_one() -> Self

Source§

fn scalar_add(self, rhs: Self) -> Self

Source§

fn scalar_mul(self, rhs: Self) -> Self

Source§

fn pos_infinity() -> Self

Source§

fn neg_infinity() -> Self

Source§

fn scalar_max(self, rhs: Self) -> Self

Source§

fn scalar_min(self, rhs: Self) -> Self

Source§

impl TropicalScalar for u16

Source§

fn scalar_zero() -> Self

Source§

fn scalar_one() -> Self

Source§

fn scalar_add(self, rhs: Self) -> Self

Source§

fn scalar_mul(self, rhs: Self) -> Self

Source§

fn pos_infinity() -> Self

Source§

fn neg_infinity() -> Self

Source§

fn scalar_max(self, rhs: Self) -> Self

Source§

fn scalar_min(self, rhs: Self) -> Self

Source§

impl TropicalScalar for u32

Source§

fn scalar_zero() -> Self

Source§

fn scalar_one() -> Self

Source§

fn scalar_add(self, rhs: Self) -> Self

Source§

fn scalar_mul(self, rhs: Self) -> Self

Source§

fn pos_infinity() -> Self

Source§

fn neg_infinity() -> Self

Source§

fn scalar_max(self, rhs: Self) -> Self

Source§

fn scalar_min(self, rhs: Self) -> Self

Source§

impl TropicalScalar for u64

Source§

fn scalar_zero() -> Self

Source§

fn scalar_one() -> Self

Source§

fn scalar_add(self, rhs: Self) -> Self

Source§

fn scalar_mul(self, rhs: Self) -> Self

Source§

fn pos_infinity() -> Self

Source§

fn neg_infinity() -> Self

Source§

fn scalar_max(self, rhs: Self) -> Self

Source§

fn scalar_min(self, rhs: Self) -> Self

Implementors§