pub struct Vanilla<T>(/* private fields */);
Expand description
A plain reducer that just use normal Rem operators. It will keep the integer in range [0, modulus) after each operation.
Trait Implementations§
Source§impl Reducer<u128> for Vanilla<u128>
impl Reducer<u128> for Vanilla<u128>
Source§impl Reducer<u16> for Vanilla<u16>
impl Reducer<u16> for Vanilla<u16>
Source§impl Reducer<u32> for Vanilla<u32>
impl Reducer<u32> for Vanilla<u32>
Source§impl Reducer<u64> for Vanilla<u64>
impl Reducer<u64> for Vanilla<u64>
Source§impl Reducer<u8> for Vanilla<u8>
impl Reducer<u8> for Vanilla<u8>
Source§impl Reducer<usize> for Vanilla<usize>
impl Reducer<usize> for Vanilla<usize>
Source§fn inv(&self, target: usize) -> Option<usize>
fn inv(&self, target: usize) -> Option<usize>
Calculate target^-1 mod m in reduced form,
it may return None when there is no modular inverse.
fn add_in_place(&self, lhs: &mut T, rhs: &T)
fn sub_in_place(&self, lhs: &mut T, rhs: &T)
fn mul_in_place(&self, lhs: &mut T, rhs: &T)
impl<T: Copy> Copy for Vanilla<T>
Auto Trait Implementations§
impl<T> Freeze for Vanilla<T>where
T: Freeze,
impl<T> RefUnwindSafe for Vanilla<T>where
T: RefUnwindSafe,
impl<T> Send for Vanilla<T>where
T: Send,
impl<T> Sync for Vanilla<T>where
T: Sync,
impl<T> Unpin for Vanilla<T>where
T: Unpin,
impl<T> UnwindSafe for Vanilla<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