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

pub struct Mpz {
    pub mpz: mpz_struct,
}

Fields

mpz: mpz_struct

Methods

impl Mpz
[src]

fn new() -> Mpz

fn new_reserve(n: usize) -> Mpz

fn reserve(&mut self, n: usize)

fn to_str_radix(&self, base: u8) -> String

fn from_str_radix(s: &str, base: u8) -> Result<Mpz()>

fn set(&mut self, other: &Mpz)

fn set_from_str_radix(&mut self, s: &str, base: u8) -> bool

fn bit_length(&self) -> usize

fn compl(&self) -> Mpz

fn abs(&self) -> Mpz

fn div_floor(&self, other: &Mpz) -> Mpz

fn mod_floor(&self, other: &Mpz) -> Mpz

fn nextprime(&self) -> Mpz

fn gcd(&self, other: &Mpz) -> Mpz

fn gcdext(&self, other: &Mpz) -> (Mpz, Mpz, Mpz)

Given (a, b), return (g, s, t) such that g = gcd(a, b) = s*a + t*b.

fn lcm(&self, other: &Mpz) -> Mpz

fn is_multiple_of(&self, other: &Mpz) -> bool

fn divides(&self, other: &Mpz) -> bool

fn modulus(&self, modulo: &Mpz) -> Mpz

fn invert(&self, modulo: &Mpz) -> Option<Mpz>

fn popcount(&self) -> usize

fn pow(&self, exp: u32) -> Mpz

fn powm(&self, exp: &Mpz, modulus: &Mpz) -> Mpz

fn ui_pow_ui(x: u64, y: u64) -> Mpz

fn hamdist(&self, other: &Mpz) -> usize

fn setbit(&mut self, bit_index: usize)

fn clrbit(&mut self, bit_index: usize)

fn combit(&mut self, bit_index: usize)

fn tstbit(&self, bit_index: usize) -> bool

fn root(&self, n: u64) -> Mpz

fn sqrt(&self) -> Mpz

fn millerrabin(&self, reps: i32) -> i32

fn one() -> Mpz

fn zero() -> Mpz

fn is_zero(&self) -> bool

Trait Implementations

impl Send for Mpz
[src]

impl Drop for Mpz
[src]

fn drop(&mut self)

A method called when the value goes out of scope. Read more

impl Clone for Mpz
[src]

fn clone(&self) -> Mpz

Returns a copy of the value. Read more

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

Performs copy-assignment from source. Read more

impl Eq for Mpz
[src]

impl PartialEq for Mpz
[src]

fn eq(&self, other: &Mpz) -> bool

This method tests for self and other values to be equal, and is used by ==. Read more

fn ne(&self, other: &Rhs) -> bool
1.0.0

This method tests for !=.

impl Ord for Mpz
[src]

fn cmp(&self, other: &Mpz) -> Ordering

This method returns an Ordering between self and other. Read more

impl PartialOrd for Mpz
[src]

fn partial_cmp(&self, other: &Mpz) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more

fn lt(&self, other: &Rhs) -> bool
1.0.0

This method tests less than (for self and other) and is used by the < operator. Read more

fn le(&self, other: &Rhs) -> bool
1.0.0

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

fn gt(&self, other: &Rhs) -> bool
1.0.0

This method tests greater than (for self and other) and is used by the > operator. Read more

fn ge(&self, other: &Rhs) -> bool
1.0.0

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

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

type Output = Mpz

The resulting type after applying the + operator

fn add(self, other: &Mpz) -> Mpz

The method for the + operator

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

type Output = Mpz

The resulting type after applying the + operator

fn add(self, other: &Mpz) -> Mpz

The method for the + operator

impl Add<u64> for Mpz
[src]

type Output = Mpz

The resulting type after applying the + operator

fn add(self, other: u64) -> Mpz

The method for the + operator

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

type Output = Mpz

The resulting type after applying the + operator

fn add(self, other: u64) -> Mpz

The method for the + operator

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

type Output = Mpz

The resulting type after applying the - operator

fn sub(self, other: &Mpz) -> Mpz

The method for the - operator

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

type Output = Mpz

The resulting type after applying the - operator

fn sub(self, other: &Mpz) -> Mpz

The method for the - operator

impl Sub<u64> for Mpz
[src]

type Output = Mpz

The resulting type after applying the - operator

fn sub(self, other: u64) -> Mpz

The method for the - operator

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

type Output = Mpz

The resulting type after applying the - operator

fn sub(self, other: u64) -> Mpz

The method for the - operator

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

type Output = Mpz

The resulting type after applying the * operator

fn mul(self, other: &Mpz) -> Mpz

The method for the * operator

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

type Output = Mpz

The resulting type after applying the * operator

fn mul(self, other: &Mpz) -> Mpz

The method for the * operator

impl Mul<i64> for Mpz
[src]

type Output = Mpz

The resulting type after applying the * operator

fn mul(self, other: i64) -> Mpz

The method for the * operator

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

type Output = Mpz

The resulting type after applying the * operator

fn mul(self, other: i64) -> Mpz

The method for the * operator

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

type Output = Mpz

The resulting type after applying the / operator

fn div(self, other: &Mpz) -> Mpz

The method for the / operator

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

type Output = Mpz

The resulting type after applying the / operator

fn div(self, other: &Mpz) -> Mpz

The method for the / operator

impl Div<u64> for Mpz
[src]

type Output = Mpz

The resulting type after applying the / operator

fn div(self, other: u64) -> Mpz

The method for the / operator

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

type Output = Mpz

The resulting type after applying the / operator

fn div(self, other: u64) -> Mpz

The method for the / operator

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

type Output = Mpz

The resulting type after applying the % operator

fn rem(self, other: &Mpz) -> Mpz

The method for the % operator

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

type Output = Mpz

The resulting type after applying the % operator

fn rem(self, other: &Mpz) -> Mpz

The method for the % operator

impl Rem<u64> for Mpz
[src]

type Output = Mpz

The resulting type after applying the % operator

fn rem(self, other: u64) -> Mpz

The method for the % operator

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

type Output = Mpz

The resulting type after applying the % operator

fn rem(self, other: u64) -> Mpz

The method for the % operator

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

type Output = Mpz

The resulting type after applying the - operator

fn neg(self) -> Mpz

The method for the unary - operator

impl Neg for Mpz
[src]

type Output = Mpz

The resulting type after applying the - operator

fn neg(self) -> Mpz

The method for the unary - operator

impl<'b> Into<Option<i64>> for &'b Mpz
[src]

fn into(self) -> Option<i64>

Performs the conversion.

impl<'b> Into<Option<u64>> for &'b Mpz
[src]

fn into(self) -> Option<u64>

Performs the conversion.

impl<'a> Into<f64> for &'a Mpz
[src]

fn into(self) -> f64

Performs the conversion.

impl From<u64> for Mpz
[src]

fn from(other: u64) -> Mpz

Performs the conversion.

impl From<i64> for Mpz
[src]

fn from(other: i64) -> Mpz

Performs the conversion.

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

type Output = Mpz

The resulting type after applying the & operator

fn bitand(self, other: &Mpz) -> Mpz

The method for the & operator

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

type Output = Mpz

The resulting type after applying the & operator

fn bitand(self, other: &Mpz) -> Mpz

The method for the & operator

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

type Output = Mpz

The resulting type after applying the | operator

fn bitor(self, other: &Mpz) -> Mpz

The method for the | operator

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

type Output = Mpz

The resulting type after applying the | operator

fn bitor(self, other: &Mpz) -> Mpz

The method for the | operator

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

type Output = Mpz

The resulting type after applying the ^ operator

fn bitxor(self, other: &Mpz) -> Mpz

The method for the ^ operator

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

type Output = Mpz

The resulting type after applying the ^ operator

fn bitxor(self, other: &Mpz) -> Mpz

The method for the ^ operator

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

type Output = Mpz

The resulting type after applying the << operator

fn shl(self, other: usize) -> Mpz

The method for the << operator

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

type Output = Mpz

The resulting type after applying the >> operator

fn shr(self, other: usize) -> Mpz

The method for the >> operator

impl Shl<usize> for Mpz
[src]

type Output = Mpz

The resulting type after applying the << operator

fn shl(self, other: usize) -> Mpz

The method for the << operator

impl Shr<usize> for Mpz
[src]

type Output = Mpz

The resulting type after applying the >> operator

fn shr(self, other: usize) -> Mpz

The method for the >> operator

impl FromStr for Mpz
[src]

type Err = ()

The associated error which can be returned from parsing.

fn from_str(s: &str) -> Result<Self, Self::Err>

Parses a string s to return a value of this type. Read more

impl Display for Mpz
[src]

fn fmt(&self, f: &mut Formatter) -> Result

Formats the value using the given formatter.

impl Debug for Mpz
[src]

fn fmt(&self, f: &mut Formatter) -> Result

Formats the value using the given formatter.

impl Hash for Mpz
[src]

fn hash<S: Hasher>(&self, state: &mut S)

Feeds this value into the state given, updating the hasher as necessary.

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

Feeds a slice of this type into the state provided.

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

type Output = Mpz

The resulting type after applying the + operator

fn add(self, other: Mpz) -> Mpz

The method for the + operator

impl Add<Mpz> for Mpz
[src]

type Output = Mpz

The resulting type after applying the + operator

fn add(self, other: Mpz) -> Mpz

The method for the + operator

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

type Output = Mpz

The resulting type after applying the - operator

fn sub(self, other: Mpz) -> Mpz

The method for the - operator

impl Sub<Mpz> for Mpz
[src]

type Output = Mpz

The resulting type after applying the - operator

fn sub(self, other: Mpz) -> Mpz

The method for the - operator

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

type Output = Mpz

The resulting type after applying the * operator

fn mul(self, other: Mpz) -> Mpz

The method for the * operator

impl Mul<Mpz> for Mpz
[src]

type Output = Mpz

The resulting type after applying the * operator

fn mul(self, other: Mpz) -> Mpz

The method for the * operator

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

type Output = Mpz

The resulting type after applying the / operator

fn div(self, other: Mpz) -> Mpz

The method for the / operator

impl Div<Mpz> for Mpz
[src]

type Output = Mpz

The resulting type after applying the / operator

fn div(self, other: Mpz) -> Mpz

The method for the / operator

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

type Output = Mpz

The resulting type after applying the ^ operator

fn bitxor(self, other: Mpz) -> Mpz

The method for the ^ operator

impl BitXor<Mpz> for Mpz
[src]

type Output = Mpz

The resulting type after applying the ^ operator

fn bitxor(self, other: Mpz) -> Mpz

The method for the ^ operator

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

type Output = Mpz

The resulting type after applying the & operator

fn bitand(self, other: Mpz) -> Mpz

The method for the & operator

impl BitAnd<Mpz> for Mpz
[src]

type Output = Mpz

The resulting type after applying the & operator

fn bitand(self, other: Mpz) -> Mpz

The method for the & operator

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

type Output = Mpz

The resulting type after applying the | operator

fn bitor(self, other: Mpz) -> Mpz

The method for the | operator

impl BitOr<Mpz> for Mpz
[src]

type Output = Mpz

The resulting type after applying the | operator

fn bitor(self, other: Mpz) -> Mpz

The method for the | operator

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

type Output = Mpz

The resulting type after applying the % operator

fn rem(self, other: Mpz) -> Mpz

The method for the % operator

impl Rem<Mpz> for Mpz
[src]

type Output = Mpz

The resulting type after applying the % operator

fn rem(self, other: Mpz) -> Mpz

The method for the % operator