pub struct PreparedDivisor<R>{
pub element: R::Element,
pub data: R::PreparedDivisorData,
}Expand description
Struct for ring elements that are stored with associated data to enable faster divisions.
For details, see DivisibilityRing::prepare_divisor().
Fields§
§element: R::ElementThis PreparedDivisor can perform the division by this element
data: R::PreparedDivisorDataAdditional data used to compute the division by the stored element more efficiently
Implementations§
Source§impl<R> PreparedDivisor<R>
impl<R> PreparedDivisor<R>
Sourcepub fn new(ring: &R, el: R::Element) -> Self
pub fn new(ring: &R, el: R::Element) -> Self
Creates a new PreparedDivisor from the given ring element, obtaining
any additional data by calling DivisibilityRing::prepare_divisor().
Sourcepub fn checked_left_div_by(
&self,
lhs: &R::Element,
ring: &R,
) -> Option<R::Element>
pub fn checked_left_div_by( &self, lhs: &R::Element, ring: &R, ) -> Option<R::Element>
Computes some q such that q * self == lhs, if it exists.
If the underlying ring supports it, this uses precomputed data
and thus can be faster than DivisibilityRing::checked_left_div().
Trait Implementations§
Source§impl<R> Clone for PreparedDivisor<R>
impl<R> Clone for PreparedDivisor<R>
impl<R> Copy for PreparedDivisor<R>
Auto Trait Implementations§
impl<R> Freeze for PreparedDivisor<R>where
<R as RingBase>::Element: Freeze,
<R as DivisibilityRing>::PreparedDivisorData: Freeze,
R: ?Sized,
impl<R> RefUnwindSafe for PreparedDivisor<R>where
<R as RingBase>::Element: RefUnwindSafe,
<R as DivisibilityRing>::PreparedDivisorData: RefUnwindSafe,
R: ?Sized,
impl<R> Send for PreparedDivisor<R>where
<R as RingBase>::Element: Send,
<R as DivisibilityRing>::PreparedDivisorData: Send,
R: ?Sized,
impl<R> Sync for PreparedDivisor<R>where
<R as RingBase>::Element: Sync,
<R as DivisibilityRing>::PreparedDivisorData: Sync,
R: ?Sized,
impl<R> Unpin for PreparedDivisor<R>where
<R as RingBase>::Element: Unpin,
<R as DivisibilityRing>::PreparedDivisorData: Unpin,
R: ?Sized,
impl<R> UnsafeUnpin for PreparedDivisor<R>where
<R as RingBase>::Element: UnsafeUnpin,
<R as DivisibilityRing>::PreparedDivisorData: UnsafeUnpin,
R: ?Sized,
impl<R> UnwindSafe for PreparedDivisor<R>where
<R as RingBase>::Element: UnwindSafe,
<R as DivisibilityRing>::PreparedDivisorData: UnwindSafe,
R: ?Sized,
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<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