pub struct Ratio<T> { /* private fields */ }Expand description
A fraction numer / denom over a EucRing T, kept in reduced form.
Implementations§
Trait Implementations§
Source§impl<T> AddAssign for Ratio<T>
impl<T> AddAssign for Ratio<T>
Source§fn add_assign(&mut self, rhs: Ratio<T>)
fn add_assign(&mut self, rhs: Ratio<T>)
Performs the
+= operation. Read moreSource§impl<T> AddAssign<&Ratio<T>> for Ratio<T>
impl<T> AddAssign<&Ratio<T>> for Ratio<T>
Source§fn add_assign(&mut self, rhs: &Ratio<T>)
fn add_assign(&mut self, rhs: &Ratio<T>)
Performs the
+= operation. Read moreimpl<T> AddGrp for Ratio<T>
impl<T> AddGrpOps for Ratio<T>
impl<T> AddGrpOps<Ratio<T>> for &Ratio<T>
impl<T> AddMonOps for Ratio<T>
impl<T> AddMonOps<Ratio<T>> for &Ratio<T>
impl<T: Copy> Copy for Ratio<T>
Source§impl<T> DivAssign for Ratio<T>
impl<T> DivAssign for Ratio<T>
Source§fn div_assign(&mut self, rhs: Ratio<T>)
fn div_assign(&mut self, rhs: Ratio<T>)
Performs the
/= operation. Read moreSource§impl<T> DivAssign<&Ratio<T>> for Ratio<T>
impl<T> DivAssign<&Ratio<T>> for Ratio<T>
Source§fn div_assign(&mut self, rhs: &Ratio<T>)
fn div_assign(&mut self, rhs: &Ratio<T>)
Performs the
/= operation. Read moreimpl<T: Eq> Eq for Ratio<T>
Source§impl<T> EucRing for Ratio<T>
impl<T> EucRing for Ratio<T>
impl<T> EucRingOps for Ratio<T>
impl<T> EucRingOps<Ratio<T>> for &Ratio<T>
impl<T> Field for Ratio<T>
impl<T> FieldOps for Ratio<T>
impl<T> FieldOps<Ratio<T>> for &Ratio<T>
impl<T> MonOps for Ratio<T>
impl<T> MonOps<Ratio<T>> for &Ratio<T>
Source§impl<T> MulAssign for Ratio<T>
impl<T> MulAssign for Ratio<T>
Source§fn mul_assign(&mut self, rhs: Ratio<T>)
fn mul_assign(&mut self, rhs: Ratio<T>)
Performs the
*= operation. Read moreSource§impl<T> MulAssign<&Ratio<T>> for Ratio<T>
impl<T> MulAssign<&Ratio<T>> for Ratio<T>
Source§fn mul_assign(&mut self, rhs: &Ratio<T>)
fn mul_assign(&mut self, rhs: &Ratio<T>)
Performs the
*= operation. Read moreSource§impl<T> Ord for Ratio<T>
impl<T> Ord for Ratio<T>
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl<T> PartialOrd for Ratio<T>
impl<T> PartialOrd for Ratio<T>
Source§impl<T> RemAssign for Ratio<T>
impl<T> RemAssign for Ratio<T>
Source§fn rem_assign(&mut self, rhs: Ratio<T>)
fn rem_assign(&mut self, rhs: Ratio<T>)
Performs the
%= operation. Read moreSource§impl<T> RemAssign<&Ratio<T>> for Ratio<T>
impl<T> RemAssign<&Ratio<T>> for Ratio<T>
Source§fn rem_assign(&mut self, rhs: &Ratio<T>)
fn rem_assign(&mut self, rhs: &Ratio<T>)
Performs the
%= operation. Read moreSource§impl<T> Ring for Ratio<T>
impl<T> Ring for Ratio<T>
Source§fn inv(&self) -> Option<Self>
fn inv(&self) -> Option<Self>
Multiplicative inverse, if this element is a unit; otherwise
None.Source§fn is_unit(&self) -> bool
fn is_unit(&self) -> bool
true iff this element is a unit (has a multiplicative inverse). Read moreSource§fn normalizing_unit(&self) -> Self
fn normalizing_unit(&self) -> Self
Source§fn c_weight(&self) -> f64
fn c_weight(&self) -> f64
Heuristic cost of working with this element, used by chain-reduction
pivot selection. Default:
0.0 for zero, 1.0 otherwise.Source§fn normalized(&self) -> Self
fn normalized(&self) -> Self
The canonical associate of
self (i.e. self * self.normalizing_unit()).Source§fn into_normalized(self) -> Self
fn into_normalized(self) -> Self
Like
normalized, but consuming.impl<T> RingOps for Ratio<T>
impl<T> RingOps<Ratio<T>> for &Ratio<T>
impl<T: PartialEq> StructuralPartialEq for Ratio<T>
Source§impl<T> SubAssign for Ratio<T>
impl<T> SubAssign for Ratio<T>
Source§fn sub_assign(&mut self, rhs: Ratio<T>)
fn sub_assign(&mut self, rhs: Ratio<T>)
Performs the
-= operation. Read moreSource§impl<T> SubAssign<&Ratio<T>> for Ratio<T>
impl<T> SubAssign<&Ratio<T>> for Ratio<T>
Source§fn sub_assign(&mut self, rhs: &Ratio<T>)
fn sub_assign(&mut self, rhs: &Ratio<T>)
Performs the
-= operation. Read moreSource§impl<T> TeX for Ratio<T>
impl<T> TeX for Ratio<T>
fn tex_math_symbol() -> String
fn tex_string(&self) -> String
Auto Trait Implementations§
impl<T> Freeze for Ratio<T>where
T: Freeze,
impl<T> RefUnwindSafe for Ratio<T>where
T: RefUnwindSafe,
impl<T> Send for Ratio<T>where
T: Send,
impl<T> Sync for Ratio<T>where
T: Sync,
impl<T> Unpin for Ratio<T>where
T: Unpin,
impl<T> UnsafeUnpin for Ratio<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for Ratio<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,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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