[−][src]Struct classygroup::gmp::mpz::Mpz
Methods
impl Mpz
[src]
pub unsafe fn inner(&self) -> mpz_srcptr
[src]
pub unsafe fn inner_mut(&mut self) -> mpz_ptr
[src]
pub fn new() -> Mpz
[src]
pub fn new_reserve(n: usize) -> Mpz
[src]
pub fn reserve(&mut self, n: usize)
[src]
pub fn size_in_base(&self, base: u8) -> usize
[src]
pub fn to_str_radix(&self, base: u8) -> String
[src]
pub fn from_str_radix(s: &str, base: u8) -> Result<Mpz, ParseMpzError>
[src]
pub fn set(&mut self, other: &Mpz)
[src]
pub fn set_from_str_radix(&mut self, s: &str, base: u8) -> bool
[src]
pub fn bit_length(&self) -> usize
[src]
pub fn compl(&self) -> Mpz
[src]
pub fn abs(&self) -> Mpz
[src]
pub fn div_floor(&self, other: &Mpz) -> Mpz
[src]
pub fn mod_floor(&self, other: &Mpz) -> Mpz
[src]
pub fn probab_prime(&self, reps: i32) -> ProbabPrimeResult
[src]
Determine whether n is prime.
This function performs some trial divisions, then reps Miller-Rabin probabilistic primality tests. A higher reps value will reduce the chances of a non-prime being identified as “probably prime”. A composite number will be identified as a prime with a probability of less than 4^(-reps). Reasonable values of reps are between 15 and 50.
pub fn nextprime(&self) -> Mpz
[src]
pub fn gcd(&self, other: &Mpz) -> Mpz
[src]
pub fn gcdext(&self, other: &Mpz) -> (Mpz, Mpz, Mpz)
[src]
Given (a, b), return (g, s, t) such that g = gcd(a, b) = sa + tb.
pub fn lcm(&self, other: &Mpz) -> Mpz
[src]
pub fn is_multiple_of(&self, other: &Mpz) -> bool
[src]
pub fn divides(&self, other: &Mpz) -> bool
[src]
pub fn modulus(&self, modulo: &Mpz) -> Mpz
[src]
pub fn invert(&self, modulo: &Mpz) -> Option<Mpz>
[src]
pub fn popcount(&self) -> usize
[src]
pub fn pow(&self, exp: u32) -> Mpz
[src]
pub fn powm(&self, exp: &Mpz, modulus: &Mpz) -> Mpz
[src]
pub fn powm_sec(&self, exp: &Mpz, modulus: &Mpz) -> Mpz
[src]
pub fn ui_pow_ui(x: u32, y: u32) -> Mpz
[src]
pub fn hamdist(&self, other: &Mpz) -> usize
[src]
pub fn setbit(&mut self, bit_index: usize)
[src]
pub fn clrbit(&mut self, bit_index: usize)
[src]
pub fn combit(&mut self, bit_index: usize)
[src]
pub fn tstbit(&self, bit_index: usize) -> bool
[src]
pub fn root(&self, n: u32) -> Mpz
[src]
pub fn sqrt(&self) -> Mpz
[src]
pub fn millerrabin(&self, reps: i32) -> i32
[src]
pub fn sign(&self) -> Sign
[src]
pub fn one() -> Mpz
[src]
pub fn zero() -> Mpz
[src]
pub fn is_zero(&self) -> bool
[src]
Trait Implementations
impl BigNum for Mpz
[src]
fn probab_prime(&self, iterations: u32) -> bool
[src]
fn setbit(&mut self, bit_index: usize)
[src]
fn mod_powm(&mut self, base: &Self, exponent: &Self, modulus: &Self)
[src]
impl BigNumExt for Mpz
[src]
impl Ord for Mpz
[src]
fn cmp(&self, other: &Mpz) -> Ordering
[src]
fn max(self, other: Self) -> Self
1.21.0[src]
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
1.21.0[src]
Compares and returns the minimum of two values. Read more
impl<'b> From<&'b Mpz> for Vec<u8>
[src]
impl<'b> From<&'b Mpz> for Option<i64>
[src]
impl<'b> From<&'b Mpz> for Option<u64>
[src]
impl<'a> From<&'a Mpz> for f64
[src]
impl<'a> From<&'a [u8]> for Mpz
[src]
impl From<u64> for Mpz
[src]
impl From<u32> for Mpz
[src]
impl From<i64> for Mpz
[src]
impl From<i32> for Mpz
[src]
impl Drop for Mpz
[src]
impl Send for Mpz
[src]
impl Eq for Mpz
[src]
impl PartialOrd<Mpz> for Mpz
[src]
fn partial_cmp(&self, other: &Mpz) -> Option<Ordering>
[src]
#[must_use]
fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests less than (for self
and other
) and is used by the <
operator. Read more
#[must_use]
fn le(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
#[must_use]
fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
#[must_use]
fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl Sync for Mpz
[src]
impl PartialEq<Mpz> for Mpz
[src]
fn eq(&self, other: &Mpz) -> bool
[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests for !=
.
impl Clone for Mpz
[src]
fn clone(&self) -> Mpz
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Display for Mpz
[src]
impl Debug for Mpz
[src]
impl Hash for Mpz
[src]
fn hash<S: Hasher>(&self, state: &mut S)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl Add<Mpz> for Mpz
[src]
type Output = Mpz
The resulting type after applying the +
operator.
fn add(self, other: Mpz) -> Mpz
[src]
impl<'a> Add<&'a Mpz> for Mpz
[src]
type Output = Mpz
The resulting type after applying the +
operator.
fn add(self, other: &Mpz) -> Mpz
[src]
impl<'a> Add<Mpz> for &'a Mpz
[src]
type Output = Mpz
The resulting type after applying the +
operator.
fn add(self, other: Mpz) -> Mpz
[src]
impl<'a, 'b> Add<&'b Mpz> for &'a Mpz
[src]
type Output = Mpz
The resulting type after applying the +
operator.
fn add(self, other: &Mpz) -> Mpz
[src]
impl Add<u64> for Mpz
[src]
type Output = Mpz
The resulting type after applying the +
operator.
fn add(self, other: u64) -> Mpz
[src]
impl<'a> Add<u64> for &'a Mpz
[src]
type Output = Mpz
The resulting type after applying the +
operator.
fn add(self, other: u64) -> Mpz
[src]
impl Add<Mpz> for u64
[src]
type Output = Mpz
The resulting type after applying the +
operator.
fn add(self, other: Mpz) -> Mpz
[src]
impl<'a> Add<&'a Mpz> for u64
[src]
type Output = Mpz
The resulting type after applying the +
operator.
fn add(self, other: &'a Mpz) -> Mpz
[src]
impl Sub<Mpz> for Mpz
[src]
type Output = Mpz
The resulting type after applying the -
operator.
fn sub(self, other: Mpz) -> Mpz
[src]
impl<'a> Sub<&'a Mpz> for Mpz
[src]
type Output = Mpz
The resulting type after applying the -
operator.
fn sub(self, other: &Mpz) -> Mpz
[src]
impl<'a> Sub<Mpz> for &'a Mpz
[src]
type Output = Mpz
The resulting type after applying the -
operator.
fn sub(self, other: Mpz) -> Mpz
[src]
impl<'a, 'b> Sub<&'b Mpz> for &'a Mpz
[src]
type Output = Mpz
The resulting type after applying the -
operator.
fn sub(self, other: &Mpz) -> Mpz
[src]
impl Sub<u64> for Mpz
[src]
type Output = Mpz
The resulting type after applying the -
operator.
fn sub(self, other: u64) -> Mpz
[src]
impl<'a> Sub<u64> for &'a Mpz
[src]
type Output = Mpz
The resulting type after applying the -
operator.
fn sub(self, other: u64) -> Mpz
[src]
impl Sub<Mpz> for u64
[src]
type Output = Mpz
The resulting type after applying the -
operator.
fn sub(self, other: Mpz) -> Mpz
[src]
impl<'a> Sub<&'a Mpz> for u64
[src]
type Output = Mpz
The resulting type after applying the -
operator.
fn sub(self, other: &'a Mpz) -> Mpz
[src]
impl Mul<Mpz> for Mpz
[src]
type Output = Mpz
The resulting type after applying the *
operator.
fn mul(self, other: Mpz) -> Mpz
[src]
impl<'a> Mul<&'a Mpz> for Mpz
[src]
type Output = Mpz
The resulting type after applying the *
operator.
fn mul(self, other: &Mpz) -> Mpz
[src]
impl<'a> Mul<Mpz> for &'a Mpz
[src]
type Output = Mpz
The resulting type after applying the *
operator.
fn mul(self, other: Mpz) -> Mpz
[src]
impl<'a, 'b> Mul<&'b Mpz> for &'a Mpz
[src]
type Output = Mpz
The resulting type after applying the *
operator.
fn mul(self, other: &Mpz) -> Mpz
[src]
impl Mul<i64> for Mpz
[src]
type Output = Mpz
The resulting type after applying the *
operator.
fn mul(self, other: i64) -> Mpz
[src]
impl<'a> Mul<i64> for &'a Mpz
[src]
type Output = Mpz
The resulting type after applying the *
operator.
fn mul(self, other: i64) -> Mpz
[src]
impl Mul<Mpz> for i64
[src]
type Output = Mpz
The resulting type after applying the *
operator.
fn mul(self, other: Mpz) -> Mpz
[src]
impl<'a> Mul<&'a Mpz> for i64
[src]
type Output = Mpz
The resulting type after applying the *
operator.
fn mul(self, other: &'a Mpz) -> Mpz
[src]
impl Mul<u64> for Mpz
[src]
type Output = Mpz
The resulting type after applying the *
operator.
fn mul(self, other: u64) -> Mpz
[src]
impl<'a> Mul<u64> for &'a Mpz
[src]
type Output = Mpz
The resulting type after applying the *
operator.
fn mul(self, other: u64) -> Mpz
[src]
impl Mul<Mpz> for u64
[src]
type Output = Mpz
The resulting type after applying the *
operator.
fn mul(self, other: Mpz) -> Mpz
[src]
impl<'a> Mul<&'a Mpz> for u64
[src]
type Output = Mpz
The resulting type after applying the *
operator.
fn mul(self, other: &'a Mpz) -> Mpz
[src]
impl Div<Mpz> for Mpz
[src]
type Output = Mpz
The resulting type after applying the /
operator.
fn div(self, other: Mpz) -> Mpz
[src]
impl<'a> Div<&'a Mpz> for Mpz
[src]
type Output = Mpz
The resulting type after applying the /
operator.
fn div(self, other: &Mpz) -> Mpz
[src]
impl<'a> Div<Mpz> for &'a Mpz
[src]
type Output = Mpz
The resulting type after applying the /
operator.
fn div(self, other: Mpz) -> Mpz
[src]
impl<'a, 'b> Div<&'b Mpz> for &'a Mpz
[src]
type Output = Mpz
The resulting type after applying the /
operator.
fn div(self, other: &Mpz) -> Mpz
[src]
impl Div<u64> for Mpz
[src]
type Output = Mpz
The resulting type after applying the /
operator.
fn div(self, other: u64) -> Mpz
[src]
impl<'a> Div<u64> for &'a Mpz
[src]
type Output = Mpz
The resulting type after applying the /
operator.
fn div(self, other: u64) -> Mpz
[src]
impl Rem<Mpz> for Mpz
[src]
type Output = Mpz
The resulting type after applying the %
operator.
fn rem(self, other: Mpz) -> Mpz
[src]
impl<'a> Rem<&'a Mpz> for Mpz
[src]
type Output = Mpz
The resulting type after applying the %
operator.
fn rem(self, other: &Mpz) -> Mpz
[src]
impl<'a> Rem<Mpz> for &'a Mpz
[src]
type Output = Mpz
The resulting type after applying the %
operator.
fn rem(self, other: Mpz) -> Mpz
[src]
impl<'a, 'b> Rem<&'b Mpz> for &'a Mpz
[src]
type Output = Mpz
The resulting type after applying the %
operator.
fn rem(self, other: &Mpz) -> Mpz
[src]
impl Rem<u64> for Mpz
[src]
type Output = Mpz
The resulting type after applying the %
operator.
fn rem(self, other: u64) -> Mpz
[src]
impl<'a> Rem<u64> for &'a Mpz
[src]
type Output = Mpz
The resulting type after applying the %
operator.
fn rem(self, other: u64) -> Mpz
[src]
impl<'b> Neg for &'b Mpz
[src]
impl Neg for Mpz
[src]
impl AddAssign<Mpz> for Mpz
[src]
fn add_assign(&mut self, other: Mpz)
[src]
impl<'a> AddAssign<&'a Mpz> for Mpz
[src]
fn add_assign(&mut self, other: &Mpz)
[src]
impl AddAssign<u64> for Mpz
[src]
fn add_assign(&mut self, other: u64)
[src]
impl SubAssign<Mpz> for Mpz
[src]
fn sub_assign(&mut self, other: Mpz)
[src]
impl<'a> SubAssign<&'a Mpz> for Mpz
[src]
fn sub_assign(&mut self, other: &Mpz)
[src]
impl SubAssign<u64> for Mpz
[src]
fn sub_assign(&mut self, other: u64)
[src]
impl MulAssign<Mpz> for Mpz
[src]
fn mul_assign(&mut self, other: Mpz)
[src]
impl<'a> MulAssign<&'a Mpz> for Mpz
[src]
fn mul_assign(&mut self, other: &Mpz)
[src]
impl MulAssign<i64> for Mpz
[src]
fn mul_assign(&mut self, other: i64)
[src]
impl MulAssign<u64> for Mpz
[src]
fn mul_assign(&mut self, other: u64)
[src]
impl DivAssign<Mpz> for Mpz
[src]
fn div_assign(&mut self, other: Mpz)
[src]
impl<'a> DivAssign<&'a Mpz> for Mpz
[src]
fn div_assign(&mut self, other: &Mpz)
[src]
impl DivAssign<u64> for Mpz
[src]
fn div_assign(&mut self, other: u64)
[src]
impl RemAssign<Mpz> for Mpz
[src]
fn rem_assign(&mut self, other: Mpz)
[src]
impl<'a> RemAssign<&'a Mpz> for Mpz
[src]
fn rem_assign(&mut self, other: &Mpz)
[src]
impl RemAssign<u64> for Mpz
[src]
fn rem_assign(&mut self, other: u64)
[src]
impl<'b> Not for &'b Mpz
[src]
impl Not for Mpz
[src]
impl BitAnd<Mpz> for Mpz
[src]
type Output = Mpz
The resulting type after applying the &
operator.
fn bitand(self, other: Mpz) -> Mpz
[src]
impl<'a> BitAnd<&'a Mpz> for Mpz
[src]
type Output = Mpz
The resulting type after applying the &
operator.
fn bitand(self, other: &Mpz) -> Mpz
[src]
impl<'a> BitAnd<Mpz> for &'a Mpz
[src]
type Output = Mpz
The resulting type after applying the &
operator.
fn bitand(self, other: Mpz) -> Mpz
[src]
impl<'a, 'b> BitAnd<&'b Mpz> for &'a Mpz
[src]
type Output = Mpz
The resulting type after applying the &
operator.
fn bitand(self, other: &Mpz) -> Mpz
[src]
impl BitOr<Mpz> for Mpz
[src]
type Output = Mpz
The resulting type after applying the |
operator.
fn bitor(self, other: Mpz) -> Mpz
[src]
impl<'a> BitOr<&'a Mpz> for Mpz
[src]
type Output = Mpz
The resulting type after applying the |
operator.
fn bitor(self, other: &Mpz) -> Mpz
[src]
impl<'a> BitOr<Mpz> for &'a Mpz
[src]
type Output = Mpz
The resulting type after applying the |
operator.
fn bitor(self, other: Mpz) -> Mpz
[src]
impl<'a, 'b> BitOr<&'b Mpz> for &'a Mpz
[src]
type Output = Mpz
The resulting type after applying the |
operator.
fn bitor(self, other: &Mpz) -> Mpz
[src]
impl BitXor<Mpz> for Mpz
[src]
type Output = Mpz
The resulting type after applying the ^
operator.
fn bitxor(self, other: Mpz) -> Mpz
[src]
impl<'a> BitXor<&'a Mpz> for Mpz
[src]
type Output = Mpz
The resulting type after applying the ^
operator.
fn bitxor(self, other: &Mpz) -> Mpz
[src]
impl<'a> BitXor<Mpz> for &'a Mpz
[src]
type Output = Mpz
The resulting type after applying the ^
operator.
fn bitxor(self, other: Mpz) -> Mpz
[src]
impl<'a, 'b> BitXor<&'b Mpz> for &'a Mpz
[src]
type Output = Mpz
The resulting type after applying the ^
operator.
fn bitxor(self, other: &Mpz) -> Mpz
[src]
impl<'b> Shl<usize> for &'b Mpz
[src]
type Output = Mpz
The resulting type after applying the <<
operator.
fn shl(self, other: usize) -> Mpz
[src]
impl Shl<usize> for Mpz
[src]
type Output = Mpz
The resulting type after applying the <<
operator.
fn shl(self, other: usize) -> Mpz
[src]
impl<'b> Shr<usize> for &'b Mpz
[src]
type Output = Mpz
The resulting type after applying the >>
operator.
fn shr(self, other: usize) -> Mpz
[src]
impl Shr<usize> for Mpz
[src]
type Output = Mpz
The resulting type after applying the >>
operator.
fn shr(self, other: usize) -> Mpz
[src]
impl BitAndAssign<Mpz> for Mpz
[src]
fn bitand_assign(&mut self, other: Mpz)
[src]
impl<'a> BitAndAssign<&'a Mpz> for Mpz
[src]
fn bitand_assign(&mut self, other: &Mpz)
[src]
impl BitOrAssign<Mpz> for Mpz
[src]
fn bitor_assign(&mut self, other: Mpz)
[src]
impl<'a> BitOrAssign<&'a Mpz> for Mpz
[src]
fn bitor_assign(&mut self, other: &Mpz)
[src]
impl BitXorAssign<Mpz> for Mpz
[src]
fn bitxor_assign(&mut self, other: Mpz)
[src]
impl<'a> BitXorAssign<&'a Mpz> for Mpz
[src]
fn bitxor_assign(&mut self, other: &Mpz)
[src]
impl ShlAssign<usize> for Mpz
[src]
fn shl_assign(&mut self, other: usize)
[src]
impl ShrAssign<usize> for Mpz
[src]
fn shr_assign(&mut self, other: usize)
[src]
impl FromStr for Mpz
[src]
type Err = ParseMpzError
The associated error which can be returned from parsing.
fn from_str(s: &str) -> Result<Self, Self::Err>
[src]
impl Zero for Mpz
[src]
impl One for Mpz
[src]
Blanket Implementations
impl<T> From for T
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T, Rhs, Output> NumOps for T where
T: Sub<Rhs, Output = Output> + Mul<Rhs, Output = Output> + Div<Rhs, Output = Output> + Add<Rhs, Output = Output> + Rem<Rhs, Output = Output>,
[src]
T: Sub<Rhs, Output = Output> + Mul<Rhs, Output = Output> + Div<Rhs, Output = Output> + Add<Rhs, Output = Output> + Rem<Rhs, Output = Output>,
impl<T, Base> RefNum for T where
T: NumOps<Base, Base> + NumOps<&'r Base, Base>,
[src]
T: NumOps<Base, Base> + NumOps<&'r Base, Base>,
impl<T, Rhs> NumAssignOps for T where
T: AddAssign<Rhs> + SubAssign<Rhs> + MulAssign<Rhs> + DivAssign<Rhs> + RemAssign<Rhs>,
[src]
T: AddAssign<Rhs> + SubAssign<Rhs> + MulAssign<Rhs> + DivAssign<Rhs> + RemAssign<Rhs>,
impl<T> Same for T
type Output = T
Should always be Self