Trait malachite_base::num::arithmetic::traits::ModPowPrecomputedAssign
source · [−]pub trait ModPowPrecomputedAssign<RHS: Two = Self, M = Self>: ModPowPrecomputed<RHS, M> {
fn mod_pow_precomputed_assign(&mut self, exp: RHS, m: M, data: &Self::Data);
}
Expand description
Raises a number to a power modulo another number $m$, in place. Assumes the input is already reduced modulo $m$.
If multiple modular exponentiations with the same modulus are necessary, it can be quicker to
precompute some piece of data and reuse it in the exponentiation calls. This trait provides a
function for using precomputed data during exponentiation. For precomputing the data, use the
precompute_mod_pow_data
function in
ModPowPrecomputed
.
Required Methods
fn mod_pow_precomputed_assign(&mut self, exp: RHS, m: M, data: &Self::Data)
Implementations on Foreign Types
sourceimpl ModPowPrecomputedAssign<u64, u8> for u8
impl ModPowPrecomputedAssign<u64, u8> for u8
sourcefn mod_pow_precomputed_assign(&mut self, exp: u64, m: u8, data: &Self::Data)
fn mod_pow_precomputed_assign(&mut self, exp: u64, m: u8, data: &Self::Data)
Raises a number to a power modulo another number $m$, in place. Assumes the input is already reduced modulo $m$.
Assumes the input is already reduced modulo m
. Some precomputed data is provided;
this speeds up computations involving several modular exponentiations with the same
modulus. The precomputed data should be obtained using
precompute_mod_pow_data
.
Worst-case complexity
$T(n) = O(n)$
$M(n) = O(1)$
where $T$ is time, $M$ is additional memory, and $n$ is exp.significant_bits()
.
Examples
See here.
sourceimpl ModPowPrecomputedAssign<u64, u16> for u16
impl ModPowPrecomputedAssign<u64, u16> for u16
sourcefn mod_pow_precomputed_assign(&mut self, exp: u64, m: u16, data: &Self::Data)
fn mod_pow_precomputed_assign(&mut self, exp: u64, m: u16, data: &Self::Data)
Raises a number to a power modulo another number $m$, in place. Assumes the input is already reduced modulo $m$.
Assumes the input is already reduced modulo m
. Some precomputed data is provided;
this speeds up computations involving several modular exponentiations with the same
modulus. The precomputed data should be obtained using
precompute_mod_pow_data
.
Worst-case complexity
$T(n) = O(n)$
$M(n) = O(1)$
where $T$ is time, $M$ is additional memory, and $n$ is exp.significant_bits()
.
Examples
See here.
sourceimpl ModPowPrecomputedAssign<u64, u32> for u32
impl ModPowPrecomputedAssign<u64, u32> for u32
sourcefn mod_pow_precomputed_assign(&mut self, exp: u64, m: u32, data: &Self::Data)
fn mod_pow_precomputed_assign(&mut self, exp: u64, m: u32, data: &Self::Data)
Raises a number to a power modulo another number $m$, in place. Assumes the input is already reduced modulo $m$.
Assumes the input is already reduced modulo m
. Some precomputed data is provided;
this speeds up computations involving several modular exponentiations with the same
modulus. The precomputed data should be obtained using
precompute_mod_pow_data
.
Worst-case complexity
$T(n) = O(n)$
$M(n) = O(1)$
where $T$ is time, $M$ is additional memory, and $n$ is exp.significant_bits()
.
Examples
See here.
sourceimpl ModPowPrecomputedAssign<u64, u64> for u64
impl ModPowPrecomputedAssign<u64, u64> for u64
sourcefn mod_pow_precomputed_assign(&mut self, exp: u64, m: u64, data: &Self::Data)
fn mod_pow_precomputed_assign(&mut self, exp: u64, m: u64, data: &Self::Data)
Raises a number to a power modulo another number $m$, in place. Assumes the input is already reduced modulo $m$.
Assumes the input is already reduced modulo m
. Some precomputed data is provided;
this speeds up computations involving several modular exponentiations with the same
modulus. The precomputed data should be obtained using
precompute_mod_pow_data
.
Worst-case complexity
$T(n) = O(n)$
$M(n) = O(1)$
where $T$ is time, $M$ is additional memory, and $n$ is exp.significant_bits()
.
Examples
See here.
sourceimpl ModPowPrecomputedAssign<u64, u128> for u128
impl ModPowPrecomputedAssign<u64, u128> for u128
sourcefn mod_pow_precomputed_assign(&mut self, exp: u64, m: u128, data: &Self::Data)
fn mod_pow_precomputed_assign(&mut self, exp: u64, m: u128, data: &Self::Data)
Raises a number to a power modulo another number $m$, in place. Assumes the input is already reduced modulo $m$.
Assumes the input is already reduced modulo m
. Some precomputed data is provided;
this speeds up computations involving several modular exponentiations with the same
modulus. The precomputed data should be obtained using
precompute_mod_pow_data
.
Worst-case complexity
$T(n) = O(n)$
$M(n) = O(1)$
where $T$ is time, $M$ is additional memory, and $n$ is exp.significant_bits()
.
Examples
See here.
sourceimpl ModPowPrecomputedAssign<u64, usize> for usize
impl ModPowPrecomputedAssign<u64, usize> for usize
sourcefn mod_pow_precomputed_assign(&mut self, exp: u64, m: usize, data: &Self::Data)
fn mod_pow_precomputed_assign(&mut self, exp: u64, m: usize, data: &Self::Data)
Raises a number to a power modulo another number $m$, in place. Assumes the input is already reduced modulo $m$.
Assumes the input is already reduced modulo m
. Some precomputed data is provided;
this speeds up computations involving several modular exponentiations with the same
modulus. The precomputed data should be obtained using
precompute_mod_pow_data
.
Worst-case complexity
$T(n) = O(n)$
$M(n) = O(1)$
where $T$ is time, $M$ is additional memory, and $n$ is exp.significant_bits()
.
Examples
See here.