pub enum SignedOne {
PlusOne = 1,
MinusOne = -1,
}Expand description
§SignedOne
A number that is either 1 or -1, stored in a single byte.
Can be used when a type from the MatrixProvider can only have the value 1 or -1, such as
with some network problems, where an arc is either incoming or outgoing. The incidence matrix of
a network holds nothing but these two values, and storing a rational number for each of them
wastes both space and time. This type stores the coefficient in a byte and lets
Absorb apply it to a wide accumulator directly: multiplying by PlusOne is a
clone, multiplying by MinusOne is a clone and a sign flip, never a multiplication.
The variants are not declared in increasing numeric order, so the derived Ord would be
wrong; the impl below compares the discriminants instead, like Sign does.
Variants§
Trait Implementations§
Source§impl Absorb<SignedOne> for Rational8
impl Absorb<SignedOne> for Rational8
Source§fn from_narrow(narrow: &SignedOne) -> Self
fn from_narrow(narrow: &SignedOne) -> Self
Source§fn add_narrow(&mut self, narrow: &SignedOne)
fn add_narrow(&mut self, narrow: &SignedOne)
Source§fn sub_narrow(&mut self, narrow: &SignedOne)
fn sub_narrow(&mut self, narrow: &SignedOne)
Source§fn mul_narrow(&self, narrow: &SignedOne) -> Self
fn mul_narrow(&self, narrow: &SignedOne) -> Self
Source§fn add_mul_narrow(&mut self, narrow: &SignedOne, other: &Self)
fn add_mul_narrow(&mut self, narrow: &SignedOne, other: &Self)
Source§impl Absorb<SignedOne> for Rational16
impl Absorb<SignedOne> for Rational16
Source§fn from_narrow(narrow: &SignedOne) -> Self
fn from_narrow(narrow: &SignedOne) -> Self
Source§fn add_narrow(&mut self, narrow: &SignedOne)
fn add_narrow(&mut self, narrow: &SignedOne)
Source§fn sub_narrow(&mut self, narrow: &SignedOne)
fn sub_narrow(&mut self, narrow: &SignedOne)
Source§fn mul_narrow(&self, narrow: &SignedOne) -> Self
fn mul_narrow(&self, narrow: &SignedOne) -> Self
Source§fn add_mul_narrow(&mut self, narrow: &SignedOne, other: &Self)
fn add_mul_narrow(&mut self, narrow: &SignedOne, other: &Self)
Source§impl Absorb<SignedOne> for Rational32
impl Absorb<SignedOne> for Rational32
Source§fn from_narrow(narrow: &SignedOne) -> Self
fn from_narrow(narrow: &SignedOne) -> Self
Source§fn add_narrow(&mut self, narrow: &SignedOne)
fn add_narrow(&mut self, narrow: &SignedOne)
Source§fn sub_narrow(&mut self, narrow: &SignedOne)
fn sub_narrow(&mut self, narrow: &SignedOne)
Source§fn mul_narrow(&self, narrow: &SignedOne) -> Self
fn mul_narrow(&self, narrow: &SignedOne) -> Self
Source§fn add_mul_narrow(&mut self, narrow: &SignedOne, other: &Self)
fn add_mul_narrow(&mut self, narrow: &SignedOne, other: &Self)
Source§impl Absorb<SignedOne> for Rational64
impl Absorb<SignedOne> for Rational64
Source§fn from_narrow(narrow: &SignedOne) -> Self
fn from_narrow(narrow: &SignedOne) -> Self
Source§fn add_narrow(&mut self, narrow: &SignedOne)
fn add_narrow(&mut self, narrow: &SignedOne)
Source§fn sub_narrow(&mut self, narrow: &SignedOne)
fn sub_narrow(&mut self, narrow: &SignedOne)
Source§fn mul_narrow(&self, narrow: &SignedOne) -> Self
fn mul_narrow(&self, narrow: &SignedOne) -> Self
Source§fn add_mul_narrow(&mut self, narrow: &SignedOne, other: &Self)
fn add_mul_narrow(&mut self, narrow: &SignedOne, other: &Self)
Source§impl Absorb<SignedOne> for Rational128
impl Absorb<SignedOne> for Rational128
Source§fn from_narrow(narrow: &SignedOne) -> Self
fn from_narrow(narrow: &SignedOne) -> Self
Source§fn add_narrow(&mut self, narrow: &SignedOne)
fn add_narrow(&mut self, narrow: &SignedOne)
Source§fn sub_narrow(&mut self, narrow: &SignedOne)
fn sub_narrow(&mut self, narrow: &SignedOne)
Source§fn mul_narrow(&self, narrow: &SignedOne) -> Self
fn mul_narrow(&self, narrow: &SignedOne) -> Self
Source§fn add_mul_narrow(&mut self, narrow: &SignedOne, other: &Self)
fn add_mul_narrow(&mut self, narrow: &SignedOne, other: &Self)
Source§impl<const S: usize> Absorb<SignedOne> for Big<S>
impl<const S: usize> Absorb<SignedOne> for Big<S>
Source§fn from_narrow(narrow: &SignedOne) -> Self
fn from_narrow(narrow: &SignedOne) -> Self
Source§fn add_narrow(&mut self, narrow: &SignedOne)
fn add_narrow(&mut self, narrow: &SignedOne)
Source§fn sub_narrow(&mut self, narrow: &SignedOne)
fn sub_narrow(&mut self, narrow: &SignedOne)
Source§fn mul_narrow(&self, narrow: &SignedOne) -> Self
fn mul_narrow(&self, narrow: &SignedOne) -> Self
Source§fn add_mul_narrow(&mut self, narrow: &SignedOne, other: &Self)
fn add_mul_narrow(&mut self, narrow: &SignedOne, other: &Self)
Source§impl AddAssign<&SignedOne> for i8
impl AddAssign<&SignedOne> for i8
Source§fn add_assign(&mut self, rhs: &SignedOne)
fn add_assign(&mut self, rhs: &SignedOne)
+= operation. Read moreSource§impl AddAssign<&SignedOne> for i16
impl AddAssign<&SignedOne> for i16
Source§fn add_assign(&mut self, rhs: &SignedOne)
fn add_assign(&mut self, rhs: &SignedOne)
+= operation. Read moreSource§impl AddAssign<&SignedOne> for i32
impl AddAssign<&SignedOne> for i32
Source§fn add_assign(&mut self, rhs: &SignedOne)
fn add_assign(&mut self, rhs: &SignedOne)
+= operation. Read moreSource§impl AddAssign<&SignedOne> for i64
impl AddAssign<&SignedOne> for i64
Source§fn add_assign(&mut self, rhs: &SignedOne)
fn add_assign(&mut self, rhs: &SignedOne)
+= operation. Read moreSource§impl AddAssign<&SignedOne> for i128
impl AddAssign<&SignedOne> for i128
Source§fn add_assign(&mut self, rhs: &SignedOne)
fn add_assign(&mut self, rhs: &SignedOne)
+= operation. Read moreSource§impl AddAssign<&SignedOne> for u8
impl AddAssign<&SignedOne> for u8
Source§fn add_assign(&mut self, rhs: &SignedOne)
fn add_assign(&mut self, rhs: &SignedOne)
+= operation. Read moreSource§impl AddAssign<&SignedOne> for u16
impl AddAssign<&SignedOne> for u16
Source§fn add_assign(&mut self, rhs: &SignedOne)
fn add_assign(&mut self, rhs: &SignedOne)
+= operation. Read moreSource§impl AddAssign<&SignedOne> for u32
impl AddAssign<&SignedOne> for u32
Source§fn add_assign(&mut self, rhs: &SignedOne)
fn add_assign(&mut self, rhs: &SignedOne)
+= operation. Read moreSource§impl AddAssign<&SignedOne> for u64
impl AddAssign<&SignedOne> for u64
Source§fn add_assign(&mut self, rhs: &SignedOne)
fn add_assign(&mut self, rhs: &SignedOne)
+= operation. Read moreSource§impl AddAssign<&SignedOne> for u128
impl AddAssign<&SignedOne> for u128
Source§fn add_assign(&mut self, rhs: &SignedOne)
fn add_assign(&mut self, rhs: &SignedOne)
+= operation. Read moreSource§impl AddAssign<SignedOne> for i8
impl AddAssign<SignedOne> for i8
Source§fn add_assign(&mut self, rhs: SignedOne)
fn add_assign(&mut self, rhs: SignedOne)
+= operation. Read moreSource§impl AddAssign<SignedOne> for i16
impl AddAssign<SignedOne> for i16
Source§fn add_assign(&mut self, rhs: SignedOne)
fn add_assign(&mut self, rhs: SignedOne)
+= operation. Read moreSource§impl AddAssign<SignedOne> for i32
impl AddAssign<SignedOne> for i32
Source§fn add_assign(&mut self, rhs: SignedOne)
fn add_assign(&mut self, rhs: SignedOne)
+= operation. Read moreSource§impl AddAssign<SignedOne> for i64
impl AddAssign<SignedOne> for i64
Source§fn add_assign(&mut self, rhs: SignedOne)
fn add_assign(&mut self, rhs: SignedOne)
+= operation. Read moreSource§impl AddAssign<SignedOne> for i128
impl AddAssign<SignedOne> for i128
Source§fn add_assign(&mut self, rhs: SignedOne)
fn add_assign(&mut self, rhs: SignedOne)
+= operation. Read moreSource§impl AddAssign<SignedOne> for u8
impl AddAssign<SignedOne> for u8
Source§fn add_assign(&mut self, rhs: SignedOne)
fn add_assign(&mut self, rhs: SignedOne)
+= operation. Read moreSource§impl AddAssign<SignedOne> for u16
impl AddAssign<SignedOne> for u16
Source§fn add_assign(&mut self, rhs: SignedOne)
fn add_assign(&mut self, rhs: SignedOne)
+= operation. Read moreSource§impl AddAssign<SignedOne> for u32
impl AddAssign<SignedOne> for u32
Source§fn add_assign(&mut self, rhs: SignedOne)
fn add_assign(&mut self, rhs: SignedOne)
+= operation. Read moreSource§impl AddAssign<SignedOne> for u64
impl AddAssign<SignedOne> for u64
Source§fn add_assign(&mut self, rhs: SignedOne)
fn add_assign(&mut self, rhs: SignedOne)
+= operation. Read moreSource§impl AddAssign<SignedOne> for u128
impl AddAssign<SignedOne> for u128
Source§fn add_assign(&mut self, rhs: SignedOne)
fn add_assign(&mut self, rhs: SignedOne)
+= operation. Read moreimpl Copy for SignedOne
Source§impl Debug for SignedOne
Debug forwards to Display, because 1 and -1 read better in test output than the variant
names.
impl Debug for SignedOne
Debug forwards to Display, because 1 and -1 read better in test output than the variant
names.
Source§impl DivAssign<&SignedOne> for i8
impl DivAssign<&SignedOne> for i8
Source§fn div_assign(&mut self, rhs: &SignedOne)
fn div_assign(&mut self, rhs: &SignedOne)
/= operation. Read moreSource§impl DivAssign<&SignedOne> for i16
impl DivAssign<&SignedOne> for i16
Source§fn div_assign(&mut self, rhs: &SignedOne)
fn div_assign(&mut self, rhs: &SignedOne)
/= operation. Read moreSource§impl DivAssign<&SignedOne> for i32
impl DivAssign<&SignedOne> for i32
Source§fn div_assign(&mut self, rhs: &SignedOne)
fn div_assign(&mut self, rhs: &SignedOne)
/= operation. Read moreSource§impl DivAssign<&SignedOne> for i64
impl DivAssign<&SignedOne> for i64
Source§fn div_assign(&mut self, rhs: &SignedOne)
fn div_assign(&mut self, rhs: &SignedOne)
/= operation. Read moreSource§impl DivAssign<&SignedOne> for i128
impl DivAssign<&SignedOne> for i128
Source§fn div_assign(&mut self, rhs: &SignedOne)
fn div_assign(&mut self, rhs: &SignedOne)
/= operation. Read moreSource§impl DivAssign<SignedOne> for i8
impl DivAssign<SignedOne> for i8
Source§fn div_assign(&mut self, rhs: SignedOne)
fn div_assign(&mut self, rhs: SignedOne)
/= operation. Read moreSource§impl DivAssign<SignedOne> for i16
impl DivAssign<SignedOne> for i16
Source§fn div_assign(&mut self, rhs: SignedOne)
fn div_assign(&mut self, rhs: SignedOne)
/= operation. Read moreSource§impl DivAssign<SignedOne> for i32
impl DivAssign<SignedOne> for i32
Source§fn div_assign(&mut self, rhs: SignedOne)
fn div_assign(&mut self, rhs: SignedOne)
/= operation. Read moreSource§impl DivAssign<SignedOne> for i64
impl DivAssign<SignedOne> for i64
Source§fn div_assign(&mut self, rhs: SignedOne)
fn div_assign(&mut self, rhs: SignedOne)
/= operation. Read moreSource§impl DivAssign<SignedOne> for i128
impl DivAssign<SignedOne> for i128
Source§fn div_assign(&mut self, rhs: SignedOne)
fn div_assign(&mut self, rhs: SignedOne)
/= operation. Read moreimpl Eq for SignedOne
Source§impl MulAssign<&SignedOne> for i8
impl MulAssign<&SignedOne> for i8
Source§fn mul_assign(&mut self, rhs: &SignedOne)
fn mul_assign(&mut self, rhs: &SignedOne)
*= operation. Read moreSource§impl MulAssign<&SignedOne> for i16
impl MulAssign<&SignedOne> for i16
Source§fn mul_assign(&mut self, rhs: &SignedOne)
fn mul_assign(&mut self, rhs: &SignedOne)
*= operation. Read moreSource§impl MulAssign<&SignedOne> for i32
impl MulAssign<&SignedOne> for i32
Source§fn mul_assign(&mut self, rhs: &SignedOne)
fn mul_assign(&mut self, rhs: &SignedOne)
*= operation. Read moreSource§impl MulAssign<&SignedOne> for i64
impl MulAssign<&SignedOne> for i64
Source§fn mul_assign(&mut self, rhs: &SignedOne)
fn mul_assign(&mut self, rhs: &SignedOne)
*= operation. Read moreSource§impl MulAssign<&SignedOne> for i128
impl MulAssign<&SignedOne> for i128
Source§fn mul_assign(&mut self, rhs: &SignedOne)
fn mul_assign(&mut self, rhs: &SignedOne)
*= operation. Read moreSource§impl MulAssign<SignedOne> for i8
impl MulAssign<SignedOne> for i8
Source§fn mul_assign(&mut self, rhs: SignedOne)
fn mul_assign(&mut self, rhs: SignedOne)
*= operation. Read moreSource§impl MulAssign<SignedOne> for i16
impl MulAssign<SignedOne> for i16
Source§fn mul_assign(&mut self, rhs: SignedOne)
fn mul_assign(&mut self, rhs: SignedOne)
*= operation. Read moreSource§impl MulAssign<SignedOne> for i32
impl MulAssign<SignedOne> for i32
Source§fn mul_assign(&mut self, rhs: SignedOne)
fn mul_assign(&mut self, rhs: SignedOne)
*= operation. Read moreSource§impl MulAssign<SignedOne> for i64
impl MulAssign<SignedOne> for i64
Source§fn mul_assign(&mut self, rhs: SignedOne)
fn mul_assign(&mut self, rhs: SignedOne)
*= operation. Read moreSource§impl MulAssign<SignedOne> for i128
impl MulAssign<SignedOne> for i128
Source§fn mul_assign(&mut self, rhs: SignedOne)
fn mul_assign(&mut self, rhs: SignedOne)
*= operation. Read moreSource§impl Negateable for SignedOne
Both negations are representable: PlusOne and MinusOne are each other’s additive inverse.
impl Negateable for SignedOne
Both negations are representable: PlusOne and MinusOne are each other’s additive inverse.
Source§impl NonZero for SignedOne
impl NonZero for SignedOne
Source§fn is_not_zero(&self) -> bool
fn is_not_zero(&self) -> bool
Source§impl NonZeroSigned for SignedOne
The type cannot represent zero, so there is no failure case.
impl NonZeroSigned for SignedOne
The type cannot represent zero, so there is no failure case.
Source§fn non_zero_signum(&self) -> NonZeroSign
fn non_zero_signum(&self) -> NonZeroSign
Source§fn non_zero_is_positive(&self) -> bool
fn non_zero_is_positive(&self) -> bool
x > 0.Source§fn non_zero_is_negative(&self) -> bool
fn non_zero_is_negative(&self) -> bool
x < 0.Source§impl Ord for SignedOne
The variants are declared with PlusOne first, so a derived Ord would order PlusOne before
MinusOne. Compare the discriminants instead, which gives MinusOne < PlusOne.
impl Ord for SignedOne
The variants are declared with PlusOne first, so a derived Ord would order PlusOne before
MinusOne. Compare the discriminants instead, which gives MinusOne < PlusOne.
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 SignedOne
impl PartialOrd for SignedOne
impl StructuralPartialEq for SignedOne
Source§impl SubAssign<&SignedOne> for i8
impl SubAssign<&SignedOne> for i8
Source§fn sub_assign(&mut self, rhs: &SignedOne)
fn sub_assign(&mut self, rhs: &SignedOne)
-= operation. Read moreSource§impl SubAssign<&SignedOne> for i16
impl SubAssign<&SignedOne> for i16
Source§fn sub_assign(&mut self, rhs: &SignedOne)
fn sub_assign(&mut self, rhs: &SignedOne)
-= operation. Read moreSource§impl SubAssign<&SignedOne> for i32
impl SubAssign<&SignedOne> for i32
Source§fn sub_assign(&mut self, rhs: &SignedOne)
fn sub_assign(&mut self, rhs: &SignedOne)
-= operation. Read moreSource§impl SubAssign<&SignedOne> for i64
impl SubAssign<&SignedOne> for i64
Source§fn sub_assign(&mut self, rhs: &SignedOne)
fn sub_assign(&mut self, rhs: &SignedOne)
-= operation. Read moreSource§impl SubAssign<&SignedOne> for i128
impl SubAssign<&SignedOne> for i128
Source§fn sub_assign(&mut self, rhs: &SignedOne)
fn sub_assign(&mut self, rhs: &SignedOne)
-= operation. Read moreSource§impl SubAssign<&SignedOne> for u8
impl SubAssign<&SignedOne> for u8
Source§fn sub_assign(&mut self, rhs: &SignedOne)
fn sub_assign(&mut self, rhs: &SignedOne)
-= operation. Read moreSource§impl SubAssign<&SignedOne> for u16
impl SubAssign<&SignedOne> for u16
Source§fn sub_assign(&mut self, rhs: &SignedOne)
fn sub_assign(&mut self, rhs: &SignedOne)
-= operation. Read moreSource§impl SubAssign<&SignedOne> for u32
impl SubAssign<&SignedOne> for u32
Source§fn sub_assign(&mut self, rhs: &SignedOne)
fn sub_assign(&mut self, rhs: &SignedOne)
-= operation. Read moreSource§impl SubAssign<&SignedOne> for u64
impl SubAssign<&SignedOne> for u64
Source§fn sub_assign(&mut self, rhs: &SignedOne)
fn sub_assign(&mut self, rhs: &SignedOne)
-= operation. Read moreSource§impl SubAssign<&SignedOne> for u128
impl SubAssign<&SignedOne> for u128
Source§fn sub_assign(&mut self, rhs: &SignedOne)
fn sub_assign(&mut self, rhs: &SignedOne)
-= operation. Read moreSource§impl SubAssign<SignedOne> for i8
impl SubAssign<SignedOne> for i8
Source§fn sub_assign(&mut self, rhs: SignedOne)
fn sub_assign(&mut self, rhs: SignedOne)
-= operation. Read moreSource§impl SubAssign<SignedOne> for i16
impl SubAssign<SignedOne> for i16
Source§fn sub_assign(&mut self, rhs: SignedOne)
fn sub_assign(&mut self, rhs: SignedOne)
-= operation. Read moreSource§impl SubAssign<SignedOne> for i32
impl SubAssign<SignedOne> for i32
Source§fn sub_assign(&mut self, rhs: SignedOne)
fn sub_assign(&mut self, rhs: SignedOne)
-= operation. Read moreSource§impl SubAssign<SignedOne> for i64
impl SubAssign<SignedOne> for i64
Source§fn sub_assign(&mut self, rhs: SignedOne)
fn sub_assign(&mut self, rhs: SignedOne)
-= operation. Read moreSource§impl SubAssign<SignedOne> for i128
impl SubAssign<SignedOne> for i128
Source§fn sub_assign(&mut self, rhs: SignedOne)
fn sub_assign(&mut self, rhs: SignedOne)
-= operation. Read moreSource§impl SubAssign<SignedOne> for u8
impl SubAssign<SignedOne> for u8
Source§fn sub_assign(&mut self, rhs: SignedOne)
fn sub_assign(&mut self, rhs: SignedOne)
-= operation. Read moreSource§impl SubAssign<SignedOne> for u16
impl SubAssign<SignedOne> for u16
Source§fn sub_assign(&mut self, rhs: SignedOne)
fn sub_assign(&mut self, rhs: SignedOne)
-= operation. Read moreSource§impl SubAssign<SignedOne> for u32
impl SubAssign<SignedOne> for u32
Source§fn sub_assign(&mut self, rhs: SignedOne)
fn sub_assign(&mut self, rhs: SignedOne)
-= operation. Read more