[][src]Struct classygroup::gmp::mpz::Mpz

#[repr(transparent)]
pub struct Mpz { /* fields omitted */ }

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]

impl BigNumExt for Mpz[src]

impl Drop for Mpz[src]

impl PartialOrd<Mpz> for Mpz[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 PartialEq<Mpz> for Mpz[src]

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0
[src]

This method tests for !=.

impl Sync for Mpz[src]

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 Clone for Mpz[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl Ord for Mpz[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 Send for Mpz[src]

impl Eq for Mpz[src]

impl Display for Mpz[src]

impl Debug for Mpz[src]

impl Hash for Mpz[src]

fn hash_slice<H>(data: &[Self], state: &mut H) where
    H: Hasher
1.3.0
[src]

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.

impl<'a> Add<&'a Mpz> for Mpz[src]

type Output = Mpz

The resulting type after applying the + operator.

impl<'a> Add<Mpz> for &'a Mpz[src]

type Output = Mpz

The resulting type after applying the + operator.

impl<'a, 'b> Add<&'b Mpz> for &'a Mpz[src]

type Output = Mpz

The resulting type after applying the + operator.

impl Add<u64> for Mpz[src]

type Output = Mpz

The resulting type after applying the + operator.

impl<'a> Add<u64> for &'a Mpz[src]

type Output = Mpz

The resulting type after applying the + operator.

impl Add<Mpz> for u64[src]

type Output = Mpz

The resulting type after applying the + operator.

impl<'a> Add<&'a Mpz> for u64[src]

type Output = Mpz

The resulting type after applying the + operator.

impl Sub<Mpz> for Mpz[src]

type Output = Mpz

The resulting type after applying the - operator.

impl<'a> Sub<&'a Mpz> for Mpz[src]

type Output = Mpz

The resulting type after applying the - operator.

impl<'a> Sub<Mpz> for &'a Mpz[src]

type Output = Mpz

The resulting type after applying the - operator.

impl<'a, 'b> Sub<&'b Mpz> for &'a Mpz[src]

type Output = Mpz

The resulting type after applying the - operator.

impl Sub<u64> for Mpz[src]

type Output = Mpz

The resulting type after applying the - operator.

impl<'a> Sub<u64> for &'a Mpz[src]

type Output = Mpz

The resulting type after applying the - operator.

impl Sub<Mpz> for u64[src]

type Output = Mpz

The resulting type after applying the - operator.

impl<'a> Sub<&'a Mpz> for u64[src]

type Output = Mpz

The resulting type after applying the - operator.

impl Mul<Mpz> for Mpz[src]

type Output = Mpz

The resulting type after applying the * operator.

impl<'a> Mul<&'a Mpz> for Mpz[src]

type Output = Mpz

The resulting type after applying the * operator.

impl<'a> Mul<Mpz> for &'a Mpz[src]

type Output = Mpz

The resulting type after applying the * operator.

impl<'a, 'b> Mul<&'b Mpz> for &'a Mpz[src]

type Output = Mpz

The resulting type after applying the * operator.

impl Mul<i64> for Mpz[src]

type Output = Mpz

The resulting type after applying the * operator.

impl<'a> Mul<i64> for &'a Mpz[src]

type Output = Mpz

The resulting type after applying the * operator.

impl Mul<Mpz> for i64[src]

type Output = Mpz

The resulting type after applying the * operator.

impl<'a> Mul<&'a Mpz> for i64[src]

type Output = Mpz

The resulting type after applying the * operator.

impl Mul<u64> for Mpz[src]

type Output = Mpz

The resulting type after applying the * operator.

impl<'a> Mul<u64> for &'a Mpz[src]

type Output = Mpz

The resulting type after applying the * operator.

impl Mul<Mpz> for u64[src]

type Output = Mpz

The resulting type after applying the * operator.

impl<'a> Mul<&'a Mpz> for u64[src]

type Output = Mpz

The resulting type after applying the * operator.

impl Div<Mpz> for Mpz[src]

type Output = Mpz

The resulting type after applying the / operator.

impl<'a> Div<&'a Mpz> for Mpz[src]

type Output = Mpz

The resulting type after applying the / operator.

impl<'a> Div<Mpz> for &'a Mpz[src]

type Output = Mpz

The resulting type after applying the / operator.

impl<'a, 'b> Div<&'b Mpz> for &'a Mpz[src]

type Output = Mpz

The resulting type after applying the / operator.

impl Div<u64> for Mpz[src]

type Output = Mpz

The resulting type after applying the / operator.

impl<'a> Div<u64> for &'a Mpz[src]

type Output = Mpz

The resulting type after applying the / operator.

impl Rem<Mpz> for Mpz[src]

type Output = Mpz

The resulting type after applying the % operator.

impl<'a> Rem<&'a Mpz> for Mpz[src]

type Output = Mpz

The resulting type after applying the % operator.

impl<'a> Rem<Mpz> for &'a Mpz[src]

type Output = Mpz

The resulting type after applying the % operator.

impl<'a, 'b> Rem<&'b Mpz> for &'a Mpz[src]

type Output = Mpz

The resulting type after applying the % operator.

impl Rem<u64> for Mpz[src]

type Output = Mpz

The resulting type after applying the % operator.

impl<'a> Rem<u64> for &'a Mpz[src]

type Output = Mpz

The resulting type after applying the % operator.

impl<'b> Neg for &'b Mpz[src]

type Output = Mpz

The resulting type after applying the - operator.

impl Neg for Mpz[src]

type Output = Mpz

The resulting type after applying the - operator.

impl AddAssign<Mpz> for Mpz[src]

impl<'a> AddAssign<&'a Mpz> for Mpz[src]

impl AddAssign<u64> for Mpz[src]

impl SubAssign<Mpz> for Mpz[src]

impl<'a> SubAssign<&'a Mpz> for Mpz[src]

impl SubAssign<u64> for Mpz[src]

impl MulAssign<Mpz> for Mpz[src]

impl<'a> MulAssign<&'a Mpz> for Mpz[src]

impl MulAssign<i64> for Mpz[src]

impl MulAssign<u64> for Mpz[src]

impl DivAssign<Mpz> for Mpz[src]

impl<'a> DivAssign<&'a Mpz> for Mpz[src]

impl DivAssign<u64> for Mpz[src]

impl RemAssign<Mpz> for Mpz[src]

impl<'a> RemAssign<&'a Mpz> for Mpz[src]

impl RemAssign<u64> for Mpz[src]

impl<'b> Not for &'b Mpz[src]

type Output = Mpz

The resulting type after applying the ! operator.

impl Not for Mpz[src]

type Output = Mpz

The resulting type after applying the ! operator.

impl BitAnd<Mpz> for Mpz[src]

type Output = Mpz

The resulting type after applying the & operator.

impl<'a> BitAnd<&'a Mpz> for Mpz[src]

type Output = Mpz

The resulting type after applying the & operator.

impl<'a> BitAnd<Mpz> for &'a Mpz[src]

type Output = Mpz

The resulting type after applying the & operator.

impl<'a, 'b> BitAnd<&'b Mpz> for &'a Mpz[src]

type Output = Mpz

The resulting type after applying the & operator.

impl BitOr<Mpz> for Mpz[src]

type Output = Mpz

The resulting type after applying the | operator.

impl<'a> BitOr<&'a Mpz> for Mpz[src]

type Output = Mpz

The resulting type after applying the | operator.

impl<'a> BitOr<Mpz> for &'a Mpz[src]

type Output = Mpz

The resulting type after applying the | operator.

impl<'a, 'b> BitOr<&'b Mpz> for &'a Mpz[src]

type Output = Mpz

The resulting type after applying the | operator.

impl BitXor<Mpz> for Mpz[src]

type Output = Mpz

The resulting type after applying the ^ operator.

impl<'a> BitXor<&'a Mpz> for Mpz[src]

type Output = Mpz

The resulting type after applying the ^ operator.

impl<'a> BitXor<Mpz> for &'a Mpz[src]

type Output = Mpz

The resulting type after applying the ^ operator.

impl<'a, 'b> BitXor<&'b Mpz> for &'a Mpz[src]

type Output = Mpz

The resulting type after applying the ^ operator.

impl<'b> Shl<usize> for &'b Mpz[src]

type Output = Mpz

The resulting type after applying the << operator.

impl Shl<usize> for Mpz[src]

type Output = Mpz

The resulting type after applying the << operator.

impl<'b> Shr<usize> for &'b Mpz[src]

type Output = Mpz

The resulting type after applying the >> operator.

impl Shr<usize> for Mpz[src]

type Output = Mpz

The resulting type after applying the >> operator.

impl BitAndAssign<Mpz> for Mpz[src]

impl<'a> BitAndAssign<&'a Mpz> for Mpz[src]

impl BitOrAssign<Mpz> for Mpz[src]

impl<'a> BitOrAssign<&'a Mpz> for Mpz[src]

impl BitXorAssign<Mpz> for Mpz[src]

impl<'a> BitXorAssign<&'a Mpz> for Mpz[src]

impl ShlAssign<usize> for Mpz[src]

impl ShrAssign<usize> for Mpz[src]

impl FromStr for Mpz[src]

type Err = ParseMpzError

The associated error which can be returned from parsing.

impl Zero for Mpz[src]

impl One for Mpz[src]

fn is_one(&self) -> bool where
    Self: PartialEq<Self>, 
[src]

Returns true if self is equal to the multiplicative identity. Read more

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]

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]

impl<T, Base> RefNum for T where
    T: NumOps<Base, Base> + NumOps<&'r Base, Base>, 
[src]

impl<T, Rhs> NumAssignOps for T where
    T: AddAssign<Rhs> + SubAssign<Rhs> + MulAssign<Rhs> + DivAssign<Rhs> + RemAssign<Rhs>, 
[src]

impl<T> Same for T

type Output = T

Should always be Self