pub struct Zero;Expand description
§Zero
A ZST who’s value is always zero.
Can be used in specific situations where one knows that, for example, the right-hand side b is
always zero. Operations related to b should then be compiled away because the operations on
its elements are no-ops.
The same applies to a matrix provider whose coefficients are structurally absent: the incidence
matrix of a network is mostly zero, and storing a rational number for each of those entries
wastes both space and time. This type stores the coefficient in no space at all, and
Absorb applies it to a wide accumulator without ever materialising a 0:
adding it is nothing at all, multiplying by it clears the accumulator.
§Absent traits
There is deliberately no NonZero impl: this type is zero, and the whole
point of that trait is to assert the opposite.
Trait Implementations§
Source§impl Absorb<Zero> for Rational8
impl Absorb<Zero> for Rational8
Source§fn from_narrow(_: &Zero) -> Self
fn from_narrow(_: &Zero) -> Self
Source§fn add_narrow(&mut self, _: &Zero)
fn add_narrow(&mut self, _: &Zero)
Source§fn sub_narrow(&mut self, _: &Zero)
fn sub_narrow(&mut self, _: &Zero)
Source§fn mul_narrow(&self, _: &Zero) -> Self
fn mul_narrow(&self, _: &Zero) -> Self
Source§fn add_mul_narrow(&mut self, _: &Zero, _: &Self)
fn add_mul_narrow(&mut self, _: &Zero, _: &Self)
Source§impl Absorb<Zero> for Rational16
impl Absorb<Zero> for Rational16
Source§fn from_narrow(_: &Zero) -> Self
fn from_narrow(_: &Zero) -> Self
Source§fn add_narrow(&mut self, _: &Zero)
fn add_narrow(&mut self, _: &Zero)
Source§fn sub_narrow(&mut self, _: &Zero)
fn sub_narrow(&mut self, _: &Zero)
Source§fn mul_narrow(&self, _: &Zero) -> Self
fn mul_narrow(&self, _: &Zero) -> Self
Source§fn add_mul_narrow(&mut self, _: &Zero, _: &Self)
fn add_mul_narrow(&mut self, _: &Zero, _: &Self)
Source§impl Absorb<Zero> for Rational32
impl Absorb<Zero> for Rational32
Source§fn from_narrow(_: &Zero) -> Self
fn from_narrow(_: &Zero) -> Self
Source§fn add_narrow(&mut self, _: &Zero)
fn add_narrow(&mut self, _: &Zero)
Source§fn sub_narrow(&mut self, _: &Zero)
fn sub_narrow(&mut self, _: &Zero)
Source§fn mul_narrow(&self, _: &Zero) -> Self
fn mul_narrow(&self, _: &Zero) -> Self
Source§fn add_mul_narrow(&mut self, _: &Zero, _: &Self)
fn add_mul_narrow(&mut self, _: &Zero, _: &Self)
Source§impl Absorb<Zero> for Rational64
impl Absorb<Zero> for Rational64
Source§fn from_narrow(_: &Zero) -> Self
fn from_narrow(_: &Zero) -> Self
Source§fn add_narrow(&mut self, _: &Zero)
fn add_narrow(&mut self, _: &Zero)
Source§fn sub_narrow(&mut self, _: &Zero)
fn sub_narrow(&mut self, _: &Zero)
Source§fn mul_narrow(&self, _: &Zero) -> Self
fn mul_narrow(&self, _: &Zero) -> Self
Source§fn add_mul_narrow(&mut self, _: &Zero, _: &Self)
fn add_mul_narrow(&mut self, _: &Zero, _: &Self)
Source§impl Absorb<Zero> for Rational128
impl Absorb<Zero> for Rational128
Source§fn from_narrow(_: &Zero) -> Self
fn from_narrow(_: &Zero) -> Self
Source§fn add_narrow(&mut self, _: &Zero)
fn add_narrow(&mut self, _: &Zero)
Source§fn sub_narrow(&mut self, _: &Zero)
fn sub_narrow(&mut self, _: &Zero)
Source§fn mul_narrow(&self, _: &Zero) -> Self
fn mul_narrow(&self, _: &Zero) -> Self
Source§fn add_mul_narrow(&mut self, _: &Zero, _: &Self)
fn add_mul_narrow(&mut self, _: &Zero, _: &Self)
Source§impl Absorb<Zero> for RationalUsize
impl Absorb<Zero> for RationalUsize
Source§fn from_narrow(_: &Zero) -> Self
fn from_narrow(_: &Zero) -> Self
Source§fn add_narrow(&mut self, _: &Zero)
fn add_narrow(&mut self, _: &Zero)
Source§fn sub_narrow(&mut self, _: &Zero)
fn sub_narrow(&mut self, _: &Zero)
Source§fn mul_narrow(&self, _: &Zero) -> Self
fn mul_narrow(&self, _: &Zero) -> Self
Source§fn add_mul_narrow(&mut self, _: &Zero, _: &Self)
fn add_mul_narrow(&mut self, _: &Zero, _: &Self)
Source§impl<const S: usize> Absorb<Zero> for Big<S>
impl<const S: usize> Absorb<Zero> for Big<S>
Source§fn from_narrow(_: &Zero) -> Self
fn from_narrow(_: &Zero) -> Self
Source§fn add_narrow(&mut self, _: &Zero)
fn add_narrow(&mut self, _: &Zero)
Source§fn sub_narrow(&mut self, _: &Zero)
fn sub_narrow(&mut self, _: &Zero)
Source§fn mul_narrow(&self, _: &Zero) -> Self
fn mul_narrow(&self, _: &Zero) -> Self
Source§fn add_mul_narrow(&mut self, _: &Zero, _: &Self)
fn add_mul_narrow(&mut self, _: &Zero, _: &Self)
Source§impl Add<&Zero> for Rational16
impl Add<&Zero> for Rational16
Source§impl Add<&Zero> for Rational32
impl Add<&Zero> for Rational32
Source§impl Add<&Zero> for Rational64
impl Add<&Zero> for Rational64
Source§impl Add<&Zero> for Rational128
impl Add<&Zero> for Rational128
Source§impl Add<Zero> for Rational16
impl Add<Zero> for Rational16
Source§impl Add<Zero> for Rational32
impl Add<Zero> for Rational32
Source§impl Add<Zero> for Rational64
impl Add<Zero> for Rational64
Source§impl Add<Zero> for Rational128
impl Add<Zero> for Rational128
Source§impl AddAssign<&Zero> for i8
impl AddAssign<&Zero> for i8
Source§fn add_assign(&mut self, _: &Zero)
fn add_assign(&mut self, _: &Zero)
+= operation. Read moreSource§impl AddAssign<&Zero> for i16
impl AddAssign<&Zero> for i16
Source§fn add_assign(&mut self, _: &Zero)
fn add_assign(&mut self, _: &Zero)
+= operation. Read moreSource§impl AddAssign<&Zero> for i32
impl AddAssign<&Zero> for i32
Source§fn add_assign(&mut self, _: &Zero)
fn add_assign(&mut self, _: &Zero)
+= operation. Read moreSource§impl AddAssign<&Zero> for i64
impl AddAssign<&Zero> for i64
Source§fn add_assign(&mut self, _: &Zero)
fn add_assign(&mut self, _: &Zero)
+= operation. Read moreSource§impl AddAssign<&Zero> for i128
impl AddAssign<&Zero> for i128
Source§fn add_assign(&mut self, _: &Zero)
fn add_assign(&mut self, _: &Zero)
+= operation. Read moreSource§impl AddAssign<&Zero> for u8
impl AddAssign<&Zero> for u8
Source§fn add_assign(&mut self, _: &Zero)
fn add_assign(&mut self, _: &Zero)
+= operation. Read moreSource§impl AddAssign<&Zero> for u16
impl AddAssign<&Zero> for u16
Source§fn add_assign(&mut self, _: &Zero)
fn add_assign(&mut self, _: &Zero)
+= operation. Read moreSource§impl AddAssign<&Zero> for u32
impl AddAssign<&Zero> for u32
Source§fn add_assign(&mut self, _: &Zero)
fn add_assign(&mut self, _: &Zero)
+= operation. Read moreSource§impl AddAssign<&Zero> for u64
impl AddAssign<&Zero> for u64
Source§fn add_assign(&mut self, _: &Zero)
fn add_assign(&mut self, _: &Zero)
+= operation. Read moreSource§impl AddAssign<&Zero> for u128
impl AddAssign<&Zero> for u128
Source§fn add_assign(&mut self, _: &Zero)
fn add_assign(&mut self, _: &Zero)
+= operation. Read moreSource§impl AddAssign<&Zero> for Rational8
impl AddAssign<&Zero> for Rational8
Source§fn add_assign(&mut self, _: &Zero)
fn add_assign(&mut self, _: &Zero)
+= operation. Read moreSource§impl AddAssign<&Zero> for Rational16
impl AddAssign<&Zero> for Rational16
Source§fn add_assign(&mut self, _: &Zero)
fn add_assign(&mut self, _: &Zero)
+= operation. Read moreSource§impl AddAssign<&Zero> for Rational32
impl AddAssign<&Zero> for Rational32
Source§fn add_assign(&mut self, _: &Zero)
fn add_assign(&mut self, _: &Zero)
+= operation. Read moreSource§impl AddAssign<&Zero> for Rational64
impl AddAssign<&Zero> for Rational64
Source§fn add_assign(&mut self, _: &Zero)
fn add_assign(&mut self, _: &Zero)
+= operation. Read moreSource§impl AddAssign<&Zero> for Rational128
impl AddAssign<&Zero> for Rational128
Source§fn add_assign(&mut self, _: &Zero)
fn add_assign(&mut self, _: &Zero)
+= operation. Read moreSource§impl<const S: usize> AddAssign<&Zero> for Big<S>
impl<const S: usize> AddAssign<&Zero> for Big<S>
Source§fn add_assign(&mut self, _: &Zero)
fn add_assign(&mut self, _: &Zero)
+= operation. Read moreSource§impl AddAssign<Zero> for Rational8
impl AddAssign<Zero> for Rational8
Source§fn add_assign(&mut self, _: Zero)
fn add_assign(&mut self, _: Zero)
+= operation. Read moreSource§impl AddAssign<Zero> for Rational16
impl AddAssign<Zero> for Rational16
Source§fn add_assign(&mut self, _: Zero)
fn add_assign(&mut self, _: Zero)
+= operation. Read moreSource§impl AddAssign<Zero> for Rational32
impl AddAssign<Zero> for Rational32
Source§fn add_assign(&mut self, _: Zero)
fn add_assign(&mut self, _: Zero)
+= operation. Read moreSource§impl AddAssign<Zero> for Rational64
impl AddAssign<Zero> for Rational64
Source§fn add_assign(&mut self, _: Zero)
fn add_assign(&mut self, _: Zero)
+= operation. Read moreSource§impl AddAssign<Zero> for Rational128
impl AddAssign<Zero> for Rational128
Source§fn add_assign(&mut self, _: Zero)
fn add_assign(&mut self, _: Zero)
+= operation. Read moreSource§impl<const S: usize> AddAssign<Zero> for Big<S>
impl<const S: usize> AddAssign<Zero> for Big<S>
Source§fn add_assign(&mut self, _: Zero)
fn add_assign(&mut self, _: Zero)
+= operation. Read moreimpl Copy for Zero
Source§impl Debug for Zero
Debug forwards to Display, because 0 reads better in test output than Zero.
impl Debug for Zero
Debug forwards to Display, because 0 reads better in test output than Zero.
impl Eq for Zero
Source§impl From<&Zero> for Rational16
impl From<&Zero> for Rational16
Source§impl From<&Zero> for Rational32
impl From<&Zero> for Rational32
Source§impl From<&Zero> for Rational64
impl From<&Zero> for Rational64
Source§impl From<&Zero> for Rational128
impl From<&Zero> for Rational128
Source§impl From<Zero> for Rational16
impl From<Zero> for Rational16
Source§impl From<Zero> for Rational32
impl From<Zero> for Rational32
Source§impl From<Zero> for Rational64
impl From<Zero> for Rational64
Source§impl From<Zero> for Rational128
impl From<Zero> for Rational128
Source§impl Mul<&Zero> for Rational16
impl Mul<&Zero> for Rational16
Source§impl Mul<&Zero> for &Rational16
impl Mul<&Zero> for &Rational16
Source§impl Mul<&Zero> for Rational32
impl Mul<&Zero> for Rational32
Source§impl Mul<&Zero> for &Rational32
impl Mul<&Zero> for &Rational32
Source§impl Mul<&Zero> for Rational64
impl Mul<&Zero> for Rational64
Source§impl Mul<&Zero> for &Rational64
impl Mul<&Zero> for &Rational64
Source§impl Mul<&Zero> for Rational128
impl Mul<&Zero> for Rational128
Source§impl Mul<&Zero> for &Rational128
impl Mul<&Zero> for &Rational128
Source§impl Mul<Zero> for Rational16
impl Mul<Zero> for Rational16
Source§impl Mul<Zero> for &Rational16
impl Mul<Zero> for &Rational16
Source§impl Mul<Zero> for Rational32
impl Mul<Zero> for Rational32
Source§impl Mul<Zero> for &Rational32
impl Mul<Zero> for &Rational32
Source§impl Mul<Zero> for Rational64
impl Mul<Zero> for Rational64
Source§impl Mul<Zero> for &Rational64
impl Mul<Zero> for &Rational64
Source§impl Mul<Zero> for Rational128
impl Mul<Zero> for Rational128
Source§impl Mul<Zero> for &Rational128
impl Mul<Zero> for &Rational128
Source§impl MulAssign<&Zero> for Rational8
impl MulAssign<&Zero> for Rational8
Source§fn mul_assign(&mut self, _: &Zero)
fn mul_assign(&mut self, _: &Zero)
*= operation. Read moreSource§impl MulAssign<&Zero> for Rational16
impl MulAssign<&Zero> for Rational16
Source§fn mul_assign(&mut self, _: &Zero)
fn mul_assign(&mut self, _: &Zero)
*= operation. Read moreSource§impl MulAssign<&Zero> for Rational32
impl MulAssign<&Zero> for Rational32
Source§fn mul_assign(&mut self, _: &Zero)
fn mul_assign(&mut self, _: &Zero)
*= operation. Read moreSource§impl MulAssign<&Zero> for Rational64
impl MulAssign<&Zero> for Rational64
Source§fn mul_assign(&mut self, _: &Zero)
fn mul_assign(&mut self, _: &Zero)
*= operation. Read moreSource§impl MulAssign<&Zero> for Rational128
impl MulAssign<&Zero> for Rational128
Source§fn mul_assign(&mut self, _: &Zero)
fn mul_assign(&mut self, _: &Zero)
*= operation. Read moreSource§impl<const S: usize> MulAssign<&Zero> for Big<S>
impl<const S: usize> MulAssign<&Zero> for Big<S>
Source§fn mul_assign(&mut self, _: &Zero)
fn mul_assign(&mut self, _: &Zero)
*= operation. Read moreSource§impl MulAssign<Zero> for Rational8
impl MulAssign<Zero> for Rational8
Source§fn mul_assign(&mut self, _: Zero)
fn mul_assign(&mut self, _: Zero)
*= operation. Read moreSource§impl MulAssign<Zero> for Rational16
impl MulAssign<Zero> for Rational16
Source§fn mul_assign(&mut self, _: Zero)
fn mul_assign(&mut self, _: Zero)
*= operation. Read moreSource§impl MulAssign<Zero> for Rational32
impl MulAssign<Zero> for Rational32
Source§fn mul_assign(&mut self, _: Zero)
fn mul_assign(&mut self, _: Zero)
*= operation. Read moreSource§impl MulAssign<Zero> for Rational64
impl MulAssign<Zero> for Rational64
Source§fn mul_assign(&mut self, _: Zero)
fn mul_assign(&mut self, _: Zero)
*= operation. Read moreSource§impl MulAssign<Zero> for Rational128
impl MulAssign<Zero> for Rational128
Source§fn mul_assign(&mut self, _: Zero)
fn mul_assign(&mut self, _: Zero)
*= operation. Read moreSource§impl<const S: usize> MulAssign<Zero> for Big<S>
impl<const S: usize> MulAssign<Zero> for Big<S>
Source§fn mul_assign(&mut self, _: Zero)
fn mul_assign(&mut self, _: Zero)
*= operation. Read moreSource§impl Negateable for Zero
Negating zero is a no-op, and the result is representable, so this type is negateable.
impl Negateable for Zero
Negating zero is a no-op, and the result is representable, so this type is negateable.
Source§impl Ord for Zero
impl Ord for Zero
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialOrd for Zero
impl PartialOrd for Zero
Source§impl Signed for Zero
The only value of this type is 0, which is neither positive nor negative.
impl Signed for Zero
The only value of this type is 0, which is neither positive nor negative.
impl StructuralPartialEq for Zero
Source§impl Sub<&Zero> for Rational16
impl Sub<&Zero> for Rational16
Source§impl Sub<&Zero> for Rational32
impl Sub<&Zero> for Rational32
Source§impl Sub<&Zero> for Rational64
impl Sub<&Zero> for Rational64
Source§impl Sub<&Zero> for Rational128
impl Sub<&Zero> for Rational128
Source§impl Sub<Zero> for Rational16
impl Sub<Zero> for Rational16
Source§impl Sub<Zero> for Rational32
impl Sub<Zero> for Rational32
Source§impl Sub<Zero> for Rational64
impl Sub<Zero> for Rational64
Source§impl Sub<Zero> for Rational128
impl Sub<Zero> for Rational128
Source§impl<const S: usize> SubAssign<&Zero> for Big<S>
impl<const S: usize> SubAssign<&Zero> for Big<S>
Source§fn sub_assign(&mut self, _: &Zero)
fn sub_assign(&mut self, _: &Zero)
-= operation. Read moreSource§impl SubAssign<Zero> for Rational8
impl SubAssign<Zero> for Rational8
Source§fn sub_assign(&mut self, _: Zero)
fn sub_assign(&mut self, _: Zero)
-= operation. Read moreSource§impl SubAssign<Zero> for Rational16
impl SubAssign<Zero> for Rational16
Source§fn sub_assign(&mut self, _: Zero)
fn sub_assign(&mut self, _: Zero)
-= operation. Read moreSource§impl SubAssign<Zero> for Rational32
impl SubAssign<Zero> for Rational32
Source§fn sub_assign(&mut self, _: Zero)
fn sub_assign(&mut self, _: Zero)
-= operation. Read moreSource§impl SubAssign<Zero> for Rational64
impl SubAssign<Zero> for Rational64
Source§fn sub_assign(&mut self, _: Zero)
fn sub_assign(&mut self, _: Zero)
-= operation. Read moreSource§impl SubAssign<Zero> for Rational128
impl SubAssign<Zero> for Rational128
Source§fn sub_assign(&mut self, _: Zero)
fn sub_assign(&mut self, _: Zero)
-= operation. Read more