Trait malachite_base::num::arithmetic::traits::ModMulPrecomputedAssign
source · [−]pub trait ModMulPrecomputedAssign<RHS = Self, M = Self>: ModMulPrecomputed<RHS, M> {
fn mod_mul_precomputed_assign(
&mut self,
other: RHS,
m: M,
data: &Self::Data
);
}
Expand description
Multiplies two numbers modulo a third number $m$, in place. Assumes the inputs are already reduced modulo $m$.
If multiple modular multiplications with the same modulus are necessary, it can be quicker to
precompute some piece of data and reuse it in the multiplication calls. This trait provides a
function for using precomputed data during multiplication. For precomputing the data, use the
precompute_mod_mul_data
function in
ModMulPrecomputed
.
Required Methods
fn mod_mul_precomputed_assign(&mut self, other: RHS, m: M, data: &Self::Data)
Implementations on Foreign Types
sourceimpl ModMulPrecomputedAssign<u8, u8> for u8
impl ModMulPrecomputedAssign<u8, u8> for u8
sourcefn mod_mul_precomputed_assign(&mut self, other: u8, m: u8, data: &Self::Data)
fn mod_mul_precomputed_assign(&mut self, other: u8, m: u8, data: &Self::Data)
Multiplies two numbers modulo a third number $m$, in place. Assumes the inputs are already reduced modulo $m$.
Some precomputed data is provided; this speeds up computations involving several
modular multiplications with the same modulus. The precomputed data should be
obtained using
precompute_mod_mul_data
.
Worst-case complexity
Constant time and additional memory.
Examples
See here.
This is equivalent to n_mulmod2_preinv
from ulong_extras.h
, FLINT 2.7.1, where
the return value is assigned to a
.
sourceimpl ModMulPrecomputedAssign<u16, u16> for u16
impl ModMulPrecomputedAssign<u16, u16> for u16
sourcefn mod_mul_precomputed_assign(&mut self, other: u16, m: u16, data: &Self::Data)
fn mod_mul_precomputed_assign(&mut self, other: u16, m: u16, data: &Self::Data)
Multiplies two numbers modulo a third number $m$, in place. Assumes the inputs are already reduced modulo $m$.
Some precomputed data is provided; this speeds up computations involving several
modular multiplications with the same modulus. The precomputed data should be
obtained using
precompute_mod_mul_data
.
Worst-case complexity
Constant time and additional memory.
Examples
See here.
This is equivalent to n_mulmod2_preinv
from ulong_extras.h
, FLINT 2.7.1, where
the return value is assigned to a
.
sourceimpl ModMulPrecomputedAssign<u32, u32> for u32
impl ModMulPrecomputedAssign<u32, u32> for u32
sourcefn mod_mul_precomputed_assign(&mut self, other: u32, m: u32, data: &Self::Data)
fn mod_mul_precomputed_assign(&mut self, other: u32, m: u32, data: &Self::Data)
Multiplies two numbers modulo a third number $m$, in place. Assumes the inputs are already reduced modulo $m$.
Some precomputed data is provided; this speeds up computations involving several
modular multiplications with the same modulus. The precomputed data should be
obtained using
precompute_mod_mul_data
.
Worst-case complexity
Constant time and additional memory.
Examples
See here.
This is equivalent to n_mulmod2_preinv
from ulong_extras.h
, FLINT 2.7.1, where
the return value is assigned to a
.
sourceimpl ModMulPrecomputedAssign<u64, u64> for u64
impl ModMulPrecomputedAssign<u64, u64> for u64
sourcefn mod_mul_precomputed_assign(&mut self, other: u64, m: u64, data: &Self::Data)
fn mod_mul_precomputed_assign(&mut self, other: u64, m: u64, data: &Self::Data)
Multiplies two numbers modulo a third number $m$, in place. Assumes the inputs are already reduced modulo $m$.
Some precomputed data is provided; this speeds up computations involving several
modular multiplications with the same modulus. The precomputed data should be
obtained using
precompute_mod_mul_data
.
Worst-case complexity
Constant time and additional memory.
Examples
See here.
This is equivalent to n_mulmod2_preinv
from ulong_extras.h
, FLINT 2.7.1, where
the return value is assigned to a
.
sourceimpl ModMulPrecomputedAssign<u128, u128> for u128
impl ModMulPrecomputedAssign<u128, u128> for u128
sourcefn mod_mul_precomputed_assign(
&mut self,
other: u128,
m: u128,
data: &Self::Data
)
fn mod_mul_precomputed_assign(
&mut self,
other: u128,
m: u128,
data: &Self::Data
)
Multiplies two numbers modulo a third number $m$, in place. Assumes the inputs are already reduced modulo $m$.
Some precomputed data is provided; this speeds up computations involving several
modular multiplications with the same modulus. The precomputed data should be
obtained using
precompute_mod_mul_data
.
Worst-case complexity
Constant time and additional memory.
Examples
See here.
This is equivalent to n_mulmod2_preinv
from ulong_extras.h
, FLINT 2.7.1, where
the return value is assigned to a
.
sourceimpl ModMulPrecomputedAssign<usize, usize> for usize
impl ModMulPrecomputedAssign<usize, usize> for usize
sourcefn mod_mul_precomputed_assign(
&mut self,
other: usize,
m: usize,
data: &Self::Data
)
fn mod_mul_precomputed_assign(
&mut self,
other: usize,
m: usize,
data: &Self::Data
)
Multiplies two numbers modulo a third number $m$, in place. Assumes the inputs are already reduced modulo $m$.
Some precomputed data is provided; this speeds up computations involving several
modular multiplications with the same modulus. The precomputed data should be
obtained using
precompute_mod_mul_data
.
Worst-case complexity
Constant time and additional memory.
Examples
See here.
This is equivalent to n_mulmod2_preinv
from ulong_extras.h
, FLINT 2.7.1, where
the return value is assigned to a
.