Givaro
Public Types | Static Public Attributes | Protected Types | Protected Member Functions | Protected Attributes | Friends
Integer Class Reference

This is the Integer class. More...

#include <gmp++_int.h>

+ Inheritance diagram for Integer:
+ Collaboration diagram for Integer:

Public Types

typedef std::vector< mp_limb_t > vect_t
 vector of limbs (ie a gmp number). More...
 

Public Member Functions

Constructor/Destructors.

Constructors and destructor for an Integer.

giv_all_inlined Integer (int32_t n=0)
 Constructor form a known type. More...
 
giv_all_inlined Integer (int64_t n)
 
giv_all_inlined Integer (unsigned char n)
 
giv_all_inlined Integer (uint32_t n)
 
giv_all_inlined Integer (uint64_t n)
 
giv_all_inlined Integer (double n)
 
giv_all_inlined Integer (const char *n)
 
giv_all_inlined Integer (const mpz_class &a)
 
template<size_t K>
 Integer (const RecInt::ruint< K > &n)
 
template<size_t K>
 Integer (const RecInt::rint< K > &n)
 
giv_all_inlined Integer (const Integer &n)
 Copy constructor. More...
 
giv_all_inlined Integer (uint64_t *d, int64_t sz)
 Creates a new Integer from pointers. More...
 
giv_all_inlined Integer (const vect_t &v)
 Creates a new Integers for a vector of limbs. More...
 
giv_all_inlined ~Integer ()
 destructor More...
 
Assignment and copy operators
giv_all_inlined Integeroperator= (const Integer &n)
 copy from an integer. More...
 
giv_all_inlined Integerlogcpy (const Integer &n)
 copy from an integer. More...
 
giv_all_inlined Integercopy (const Integer &n)
 copy from an integer. More...
 
Bit logic operators.
giv_all_inlined Integer operator^ (const Integer &a) const
 XOR (^) More...
 
giv_all_inlined Integer operator^ (const uint64_t &a) const
 
giv_all_inlined Integer operator^ (const uint32_t &a) const
 
giv_all_inlined Integeroperator^= (const Integer &a)
 XOR inplace (^=) More...
 
giv_all_inlined Integeroperator^= (const uint64_t &a)
 
giv_all_inlined Integeroperator^= (const uint32_t &a)
 
giv_all_inlined Integer operator| (const Integer &a) const
 OR (|) More...
 
giv_all_inlined Integer operator| (const uint64_t &a) const
 
giv_all_inlined Integer operator| (const uint32_t &a) const
 
giv_all_inlined Integeroperator|= (const Integer &a)
 OR inplace (|=) More...
 
giv_all_inlined Integeroperator|= (const uint64_t &a)
 
giv_all_inlined Integeroperator|= (const uint32_t &a)
 
giv_all_inlined Integer operator& (const Integer &a) const
 AND (&) More...
 
giv_all_inlined uint32_t operator& (const uint32_t &a) const
 
giv_all_inlined uint64_t operator& (const uint64_t &a) const
 
giv_all_inlined Integeroperator&= (const Integer &a)
 AND inplace (&=) More...
 
giv_all_inlined Integeroperator&= (const uint64_t &a)
 
giv_all_inlined Integeroperator&= (const uint32_t &a)
 
giv_all_inlined Integer operator~ () const
 complement to 1 (~) More...
 
giv_all_inlined Integer operator<< (int32_t l) const
 left shift (<<) More...
 
giv_all_inlined Integer operator<< (int64_t l) const
 
giv_all_inlined Integer operator<< (uint32_t l) const
 
giv_all_inlined Integer operator<< (uint64_t l) const
 
giv_all_inlined Integeroperator<<= (int32_t l)
 left shift inplace (<<=) More...
 
giv_all_inlined Integeroperator<<= (int64_t l)
 
giv_all_inlined Integeroperator<<= (uint32_t l)
 
giv_all_inlined Integeroperator<<= (uint64_t l)
 
giv_all_inlined Integer operator>> (int32_t l) const
 right shift (>>) More...
 
giv_all_inlined Integer operator>> (int64_t l) const
 
giv_all_inlined Integer operator>> (uint32_t l) const
 
giv_all_inlined Integer operator>> (uint64_t l) const
 
giv_all_inlined Integeroperator>>= (int32_t l)
 right shift inplace (>>=) More...
 
giv_all_inlined Integeroperator>>= (int64_t l)
 
giv_all_inlined Integeroperator>>= (uint32_t l)
 
giv_all_inlined Integeroperator>>= (uint64_t l)
 
Increment/Decrement operators
Integeroperator++ ()
 
Integer operator++ (int)
 
Integeroperator-- ()
 
Integer operator-- (int)
 
Cast operators.

Convert an Integer to a basic C++ type.

Warning
Cast towards unsigned consider only the absolute value
 operator bool () const
 
 operator int16_t () const
 
 operator uint16_t () const
 
 operator unsigned char () const
 
giv_all_inlined operator uint32_t () const
 
giv_all_inlined operator int32_t () const
 
 operator signed char () const
 
giv_all_inlined operator uint64_t () const
 
giv_all_inlined operator int64_t () const
 
giv_all_inlined operator std::string () const
 
giv_all_inlined operator float () const
 
giv_all_inlined operator double () const
 
giv_all_inlined operator vect_t () const
 
template<size_t K>
 operator RecInt::ruint< K > () const
 
template<size_t K>
 operator RecInt::rint< K > () const
 

Static Public Member Functions

Addition, substraction, multiplication
static giv_all_inlined Integeraddin (Integer &res, const Integer &n)
 Addition (inplace) res+=n. More...
 
static giv_all_inlined Integeraddin (Integer &res, const int64_t n)
 
static giv_all_inlined Integeraddin (Integer &res, const uint64_t n)
 
static giv_all_inlined Integeraddin (Integer &res, const int32_t n)
 
static giv_all_inlined Integeraddin (Integer &res, const uint32_t n)
 
static giv_all_inlined Integeradd (Integer &res, const Integer &n1, const Integer &n2)
 Addition res=n1+n2. More...
 
static giv_all_inlined Integeradd (Integer &res, const Integer &n1, const int64_t n2)
 
static giv_all_inlined Integeradd (Integer &res, const Integer &n1, const uint64_t n2)
 
static giv_all_inlined Integeradd (Integer &res, const Integer &n1, const int32_t n2)
 Addition (inplace) res+=n. More...
 
static giv_all_inlined Integeradd (Integer &res, const Integer &n1, const uint32_t n2)
 
static giv_all_inlined Integersubin (Integer &res, const Integer &n)
 Substraction (inplace) res-=n. More...
 
static giv_all_inlined Integersubin (Integer &res, const int64_t n)
 
static giv_all_inlined Integersubin (Integer &res, const uint64_t n)
 
static giv_all_inlined Integersubin (Integer &res, const int32_t n)
 
static giv_all_inlined Integersubin (Integer &res, const uint32_t n)
 
static giv_all_inlined Integersub (Integer &res, const Integer &n1, const Integer &n2)
 Substraction res=n1-n2. More...
 
static giv_all_inlined Integersub (Integer &res, const Integer &n1, const int64_t n2)
 
static giv_all_inlined Integersub (Integer &res, const Integer &n1, const uint64_t n2)
 
static giv_all_inlined Integersub (Integer &res, const Integer &n1, const int32_t n2)
 Addition (inplace) res+=n. More...
 
static giv_all_inlined Integersub (Integer &res, const Integer &n1, const uint32_t n2)
 
static giv_all_inlined Integernegin (Integer &res)
 Negation (inplace) res=-res. More...
 
static giv_all_inlined Integerneg (Integer &res, const Integer &n)
 Negation res=-n. More...
 
static giv_all_inlined Integermulin (Integer &res, const Integer &n)
 Multiplication (inplace) res*=n. More...
 
static giv_all_inlined Integermulin (Integer &res, const int64_t n)
 
static giv_all_inlined Integermulin (Integer &res, const uint64_t n)
 
static giv_all_inlined Integermulin (Integer &res, const int32_t n)
 
static giv_all_inlined Integermulin (Integer &res, const uint32_t n)
 
static giv_all_inlined Integermul (Integer &res, const Integer &n1, const Integer &n2)
 Multiplication res=n1*n2. More...
 
static giv_all_inlined Integermul (Integer &res, const Integer &n1, const int64_t n2)
 
static giv_all_inlined Integermul (Integer &res, const Integer &n1, const uint64_t n2)
 
static giv_all_inlined Integermul (Integer &res, const Integer &n1, const int32_t n2)
 
static giv_all_inlined Integermul (Integer &res, const Integer &n1, const uint32_t n2)
 
fused add-multiply

Groups a multiplication and an addition/division in a single function.

This is usually faster than doing the two operations separately (and preferable to using operators).

static giv_all_inlined Integeraxpy (Integer &res, const Integer &a, const Integer &x, const Integer &y)
 axpy res = ax+y. More...
 
static giv_all_inlined Integeraxpy (Integer &res, const Integer &a, const uint64_t x, const Integer &y)
 
static giv_all_inlined Integeraxpyin (Integer &res, const Integer &a, const Integer &x)
 axpyin (inplace) res += ax. More...
 
static giv_all_inlined Integeraxpyin (Integer &res, const Integer &a, const uint64_t x)
 
static giv_all_inlined Integermaxpy (Integer &res, const Integer &a, const Integer &x, const Integer &y)
 maxpy res = y - ax. More...
 
static giv_all_inlined Integermaxpy (Integer &res, const Integer &a, const uint64_t x, const Integer &y)
 
static giv_all_inlined Integermaxpyin (Integer &res, const Integer &a, const Integer &x)
 maxpyin res -= ax. More...
 
static giv_all_inlined Integermaxpyin (Integer &res, const Integer &a, const uint64_t x)
 
static giv_all_inlined Integeraxmy (Integer &res, const Integer &a, const Integer &x, const Integer &y)
 axmy res = ax - y. More...
 
static giv_all_inlined Integeraxmy (Integer &res, const Integer &a, const uint64_t x, const Integer &y)
 
static giv_all_inlined Integeraxmyin (Integer &res, const Integer &a, const Integer &x)
 axmyin (in place) res = ax - res. More...
 
static giv_all_inlined Integeraxmyin (Integer &res, const Integer &a, const uint64_t x)
 
Random numbers functions
static void seeding (uint64_t s)
 Random numbers (no doc) More...
 
static void seeding (Integer s)
 Random numbers (no doc) More...
 
static void seeding ()
 Random numbers (no doc) More...
 
static bool RandBool ()
 Random numbers (no doc) More...
 
template<bool ALWAYSPOSITIVE>
static Integerrandom_lessthan (Integer &r, const Integer &m)
 returns a random integer r in the intervall [[x, m-1]] where x = 0 or -(m-1) according to ALWAYSPOSITIVE More...
 
static Integerrandom_lessthan (Integer &r, const Integer &m)
 Random numbers (no doc) More...
 
template<bool ALWAYSPOSITIVE>
static Integerrandom_lessthan_2exp (Integer &r, const uint64_t &m)
 returns a random integer r in the intervall [[x, 2^m-1]] where x = 0 or -(2^m-1) according to ALWAYSPOSITIVE returns a random integer r of at most m bits More...
 
static Integerrandom_lessthan_2exp (Integer &r, const uint64_t &m)
 Random numbers (no doc) More...
 
template<bool ALWAYSPOSITIVE>
static Integer random_lessthan_2exp (const uint64_t &m)
 Random numbers (no doc) More...
 
static Integer random_lessthan_2exp (const uint64_t &m)
 Random numbers (no doc) More...
 
template<bool ALWAYSPOSITIVE>
static Integerrandom_lessthan (Integer &r, const uint64_t &m)
 Random numbers (no doc) More...
 
static Integerrandom_lessthan (Integer &r, const uint64_t &m)
 Random numbers (no doc) More...
 
template<bool ALWAYSPOSITIVE, class T >
static Integer random_lessthan (const T &m)
 Random numbers (no doc) More...
 
template<class T >
static Integer random_lessthan (const T &m)
 Random numbers (no doc) More...
 
template<bool ALWAYSPOSITIVE>
static Integerrandom_exact_2exp (Integer &r, const uint64_t &m)
 returns a reference to a random number r of the size m bits, exactly. More...
 
static Integerrandom_exact_2exp (Integer &r, const uint64_t &m)
 Random numbers (no doc) More...
 
template<bool ALWAYSPOSITIVE>
static Integerrandom_exact (Integer &r, const Integer &s)
 returns a reference to a random number r of the size of s, exactly. More...
 
static Integerrandom_exact (Integer &r, const Integer &s)
 Random numbers (no doc) More...
 
template<bool ALWAYSPOSITIVE>
static Integerrandom_exact (Integer &r, const uint64_t &m)
 Random numbers (no doc) More...
 
static Integerrandom_exact (Integer &r, const uint64_t &m)
 Random numbers (no doc) More...
 
template<bool ALWAYSPOSITIVE, class T >
static Integerrandom_exact (Integer &r, const T &m)
 Random numbers (no doc) More...
 
template<class T >
static Integerrandom_exact (Integer &r, const T &m)
 Random numbers (no doc) More...
 
template<bool ALWAYSPOSITIVE, class T >
static Integer random_exact (const T &s)
 Random numbers (no doc) More...
 
template<class T >
static Integer random_exact (const T &s)
 Random numbers (no doc) More...
 
static Integerrandom_between (Integer &r, const Integer &m, const Integer &M)
 Random numbers (no doc) More...
 
static Integer random_between (const Integer &m, const Integer &M)
 Random numbers (no doc) More...
 
static Integerrandom_between_2exp (Integer &r, const uint64_t &m, const uint64_t &M)
 Random numbers (no doc) More...
 
static Integerrandom_between (Integer &r, const uint64_t &m, const uint64_t &M)
 Random numbers (no doc) More...
 
static Integer random_between_2exp (const uint64_t &m, const uint64_t &M)
 Random numbers (no doc) More...
 
static Integer random_between (const uint64_t &m, const uint64_t &M)
 Random numbers (no doc) More...
 
template<class R >
static Integer random_between (const R &m, const R &M)
 Random numbers (no doc) More...
 
template<class R >
static Integerrandom_between (Integer &r, const R &m, const R &M)
 Random numbers (no doc) More...
 
template<bool ALWAYSPOSITIVE, class T >
static Integerrandom (Integer &r, const T &m)
 returns a random integer less than... More...
 
template<class T >
static Integerrandom (Integer &r, const T &m)
 Random numbers (no doc) More...
 
template<bool ALWAYSPOSITIVE, class T >
static Integer random (const T &sz)
 returns a random integer less than... More...
 
template<class T >
static Integer random (const T &sz)
 Random numbers (no doc) More...
 
template<bool ALWAYSPOSITIVE>
static Integer random ()
 Random numbers (no doc) More...
 
static Integer random ()
 Random numbers (no doc) More...
 
template<bool ALWAYSPOSITIVE, class T >
static Integer nonzerorandom (const T &sz)
 Random numbers (no doc) More...
 
template<bool ALWAYSPOSITIVE, class T >
static Integernonzerorandom (Integer &r, const T &size)
 Random numbers (no doc) More...
 
template<class T >
static Integer nonzerorandom (const T &sz)
 Random numbers (no doc) More...
 
template<class T >
static Integernonzerorandom (Integer &r, const T &size)
 Random numbers (no doc) More...
 
static Integer nonzerorandom ()
 Random numbers (no doc) More...
 

Static Public Attributes

static const Integer zero
 zero (0) More...
 
static const Integer one
 one (1) More...
 
static const Integer mOne
 minus one (-1) More...
 

Protected Types

typedef __mpz_struct Rep
 

Protected Member Functions

const Repget_rep () const
 

Protected Attributes

Rep gmp_rep
 

Friends

giv_all_inlined Integerpowmod (Integer &Res, const Integer &n, const uint64_t e, const Integer &m)
 modular pow. return $n^e \mod m$. More...
 
giv_all_inlined Integerpowmod (Integer &Res, const Integer &n, const int64_t e, const Integer &m)
 
giv_all_inlined Integerpowmod (Integer &Res, const Integer &n, const uint32_t e, const Integer &m)
 
giv_all_inlined Integerpowmod (Integer &Res, const Integer &n, const int32_t e, const Integer &m)
 
giv_all_inlined Integerpowmod (Integer &Res, const Integer &n, const Integer &e, const Integer &m)
 
giv_all_inlined Integer powmod (const Integer &n, const uint64_t e, const Integer &m)
 modular pow. More...
 
giv_all_inlined Integer powmod (const Integer &n, const int64_t e, const Integer &m)
 
giv_all_inlined Integer powmod (const Integer &n, const uint32_t e, const Integer &m)
 
giv_all_inlined Integer powmod (const Integer &n, const int32_t e, const Integer &m)
 
giv_all_inlined Integer powmod (const Integer &n, const Integer &e, const Integer &m)
 
giv_all_inlined Integer fact (uint64_t l)
 fact More...
 
giv_all_inlined Integer sqrt (const Integer &p)
 (square) roots More...
 
giv_all_inlined Integersqrt (Integer &r, const Integer &p)
 (square) roots More...
 
giv_all_inlined Integer sqrtrem (const Integer &p, Integer &rem)
 (square) roots More...
 
giv_all_inlined Integersqrtrem (Integer &r, const Integer &p, Integer &rem)
 (square) roots More...
 
giv_all_inlined bool root (Integer &q, const Integer &a, uint32_t n)
 (square) roots More...
 
giv_all_inlined int64_t logp (const Integer &a, const Integer &p)
 logs More...
 
giv_all_inlined double logtwo (const Integer &a)
 logs More...
 
giv_all_inlined double naturallog (const Integer &a)
 logs More...
 
Arithmetic functions
giv_all_inlined Integer gcd (const Integer &a, const Integer &b)
 gcd. More...
 
giv_all_inlined Integer gcd (Integer &u, Integer &v, const Integer &a, const Integer &b)
 
giv_all_inlined Integergcd (Integer &g, const Integer &a, const Integer &b)
 
giv_all_inlined Integergcd (Integer &g, Integer &u, Integer &v, const Integer &a, const Integer &b)
 
giv_all_inlined Integerinv (Integer &u, const Integer &a, const Integer &b)
 Inverse. More...
 
giv_all_inlined Integerinvin (Integer &u, const Integer &b)
 Compute the inverse inplace u = u/b. More...
 
giv_all_inlined Integer pp (const Integer &P, const Integer &Q)
 pp More...
 
giv_all_inlined Integerlcm (Integer &g, const Integer &a, const Integer &b)
 lcm More...
 
giv_all_inlined Integer lcm (const Integer &a, const Integer &b)
 lcm More...
 
giv_all_inlined Integerpow (Integer &Res, const Integer &n, const int64_t l)
 pow. More...
 
giv_all_inlined Integerpow (Integer &Res, const uint64_t n, const uint64_t l)
 
giv_all_inlined Integerpow (Integer &Res, const Integer &n, const uint64_t l)
 
giv_all_inlined Integerpow (Integer &Res, const Integer &n, const int32_t l)
 
giv_all_inlined Integerpow (Integer &Res, const Integer &n, const uint32_t l)
 
giv_all_inlined Integer pow (const Integer &n, const int64_t l)
 pow. More...
 
giv_all_inlined Integer pow (const Integer &n, const uint64_t l)
 
giv_all_inlined Integer pow (const Integer &n, const int32_t l)
 
giv_all_inlined Integer pow (const Integer &n, const uint32_t l)
 
primes
giv_all_inlined Integerprevprime (Integer &, const Integer &p)
 
giv_all_inlined Integernextprime (Integer &, const Integer &p)
 
giv_all_inlined int32_t probab_prime (const Integer &p)
 
giv_all_inlined int32_t probab_prime (const Integer &p, int32_t r)
 
giv_all_inlined int32_t jacobi (const Integer &u, const Integer &v)
 
giv_all_inlined int32_t legendre (const Integer &u, const Integer &v)
 

Comparisons functions.

giv_all_inlined friend int32_t compare (const Integer &a, const Integer &b)
 Compares two integers. More...
 
giv_all_inlined friend int32_t absCompare (const Integer &a, const Integer &b)
 Compare the norm of two integers. More...
 
giv_all_inlined friend int32_t absCompare (const Integer &a, const double b)
 
giv_all_inlined friend int32_t absCompare (const Integer &a, const float b)
 
giv_all_inlined friend int32_t absCompare (const Integer &a, const uint64_t b)
 
giv_all_inlined friend int32_t absCompare (const Integer &a, const unsigned b)
 
giv_all_inlined friend int32_t absCompare (const Integer &a, const int64_t b)
 
giv_all_inlined friend int32_t absCompare (const Integer &a, const int32_t b)
 
template<class T >
giv_all_inlined friend int32_t absCompare (const T a, const Integer &b)
 
giv_all_inlined int32_t isOne (const Integer &a)
 name compare to 1 and 0 More...
 
giv_all_inlined int32_t isMOne (const Integer &a)
 Compares two integers. More...
 
giv_all_inlined int32_t nonZero (const Integer &a)
 name compare to 1 and 0 More...
 
giv_all_inlined int32_t isZero (const Integer &a)
 name compare to 1 and 0 More...
 
giv_all_inlined int32_t isZero (const int16_t a)
 
giv_all_inlined int32_t isZero (const int32_t a)
 
giv_all_inlined int32_t isZero (const int64_t a)
 
giv_all_inlined int32_t isZero (const uint16_t a)
 
giv_all_inlined int32_t isZero (const uint32_t a)
 
giv_all_inlined int32_t isZero (const uint64_t a)
 
template<class A , class B >
static giv_all_inlined bool isleq (const A &a, const B &b)
 isleq More...
 

Comparison operators.

Compare with operators.

giv_all_inlined int32_t operator>= (const Integer &l) const
 greater or equal. More...
 
giv_all_inlined int32_t operator>= (const int32_t l) const
 
giv_all_inlined int32_t operator>= (const int64_t l) const
 
giv_all_inlined int32_t operator>= (const uint64_t l) const
 
giv_all_inlined int32_t operator>= (const uint32_t l) const
 
giv_all_inlined int32_t operator>= (const double l) const
 
giv_all_inlined int32_t operator>= (const float l) const
 
giv_all_inlined int32_t operator<= (const Integer &l) const
 less or equal More...
 
giv_all_inlined int32_t operator<= (const int32_t l) const
 
giv_all_inlined int32_t operator<= (const int64_t l) const
 
giv_all_inlined int32_t operator<= (const uint64_t l) const
 
giv_all_inlined int32_t operator<= (const uint32_t l) const
 
giv_all_inlined int32_t operator<= (const double l) const
 
giv_all_inlined int32_t operator<= (const float l) const
 
giv_all_inlined int32_t operator!= (const Integer &l) const
 operator != (not equal) More...
 
giv_all_inlined int32_t operator!= (const int32_t l) const
 
giv_all_inlined int32_t operator!= (const int64_t l) const
 
giv_all_inlined int32_t operator!= (const uint64_t l) const
 
giv_all_inlined int32_t operator!= (const uint32_t l) const
 
giv_all_inlined int32_t operator!= (const double l) const
 
giv_all_inlined int32_t operator!= (const float l) const
 
giv_all_inlined int32_t operator== (const Integer &l) const
 Equality. More...
 
giv_all_inlined int32_t operator== (const int32_t l) const
 
giv_all_inlined int32_t operator== (const int64_t l) const
 
giv_all_inlined int32_t operator== (const uint64_t l) const
 
giv_all_inlined int32_t operator== (const uint32_t l) const
 
giv_all_inlined int32_t operator== (const double l) const
 
giv_all_inlined int32_t operator== (const float l) const
 
giv_all_inlined int32_t operator> (const Integer &l) const
 greater (strict) More...
 
giv_all_inlined int32_t operator> (const int32_t l) const
 
giv_all_inlined int32_t operator> (const int64_t l) const
 
giv_all_inlined int32_t operator> (const uint64_t l) const
 
giv_all_inlined int32_t operator> (const uint32_t l) const
 
giv_all_inlined int32_t operator> (const double l) const
 
giv_all_inlined int32_t operator> (const float l) const
 
giv_all_inlined int32_t operator< (const Integer &l) const
 less (strict) More...
 
giv_all_inlined int32_t operator< (const int32_t l) const
 
giv_all_inlined int32_t operator< (const int64_t l) const
 
giv_all_inlined int32_t operator< (const uint64_t l) const
 
giv_all_inlined int32_t operator< (const uint32_t l) const
 
giv_all_inlined int32_t operator< (const double l) const
 
giv_all_inlined int32_t operator< (const float l) const
 
giv_all_inlined friend int32_t operator>= (uint32_t l, const Integer &n)
 greater or equal. More...
 
giv_all_inlined friend int32_t operator>= (float l, const Integer &n)
 
giv_all_inlined friend int32_t operator>= (double l, const Integer &n)
 
giv_all_inlined friend int32_t operator>= (int32_t l, const Integer &n)
 
giv_all_inlined friend int32_t operator>= (int64_t l, const Integer &n)
 
giv_all_inlined friend int32_t operator>= (uint64_t l, const Integer &n)
 
giv_all_inlined friend int32_t operator<= (uint32_t l, const Integer &n)
 less or equal More...
 
giv_all_inlined friend int32_t operator<= (float l, const Integer &n)
 
giv_all_inlined friend int32_t operator<= (double l, const Integer &n)
 
giv_all_inlined friend int32_t operator<= (int32_t l, const Integer &n)
 
giv_all_inlined friend int32_t operator<= (int64_t l, const Integer &n)
 
giv_all_inlined friend int32_t operator<= (uint64_t l, const Integer &n)
 
giv_all_inlined friend int32_t operator!= (uint32_t l, const Integer &n)
 operator != (not equal) More...
 
giv_all_inlined friend int32_t operator!= (float l, const Integer &n)
 
giv_all_inlined friend int32_t operator!= (double l, const Integer &n)
 
giv_all_inlined friend int32_t operator!= (int32_t l, const Integer &n)
 
giv_all_inlined friend int32_t operator!= (int64_t l, const Integer &n)
 
giv_all_inlined friend int32_t operator!= (uint64_t l, const Integer &n)
 
giv_all_inlined friend int32_t operator== (uint32_t l, const Integer &n)
 Equality. More...
 
giv_all_inlined friend int32_t operator== (float l, const Integer &n)
 
giv_all_inlined friend int32_t operator== (double l, const Integer &n)
 
giv_all_inlined friend int32_t operator== (int32_t l, const Integer &n)
 
giv_all_inlined friend int32_t operator== (int64_t l, const Integer &n)
 
giv_all_inlined friend int32_t operator== (uint64_t l, const Integer &n)
 
giv_all_inlined friend int32_t operator> (uint32_t l, const Integer &n)
 greater (strict) More...
 
giv_all_inlined friend int32_t operator> (float l, const Integer &n)
 
giv_all_inlined friend int32_t operator> (double l, const Integer &n)
 
giv_all_inlined friend int32_t operator> (int32_t l, const Integer &n)
 
giv_all_inlined friend int32_t operator> (int64_t l, const Integer &n)
 
giv_all_inlined friend int32_t operator> (uint64_t l, const Integer &n)
 
giv_all_inlined friend int32_t operator< (uint32_t l, const Integer &n)
 less (strict) More...
 
giv_all_inlined friend int32_t operator< (float l, const Integer &n)
 
giv_all_inlined friend int32_t operator< (double l, const Integer &n)
 
giv_all_inlined friend int32_t operator< (int32_t l, const Integer &n)
 
giv_all_inlined friend int32_t operator< (int64_t l, const Integer &n)
 
giv_all_inlined friend int32_t operator< (uint64_t l, const Integer &n)
 

Addition, substraction, multiplication operators

giv_all_inlined Integer operator+ (const Integer &n) const
 operator +. More...
 
giv_all_inlined Integer operator+ (const uint64_t n) const
 
giv_all_inlined Integer operator+ (const int64_t n) const
 
giv_all_inlined Integer operator+ (const uint32_t n) const
 
giv_all_inlined Integer operator+ (const int32_t n) const
 
giv_all_inlined Integeroperator+= (const Integer &n)
 operator += . More...
 
giv_all_inlined Integeroperator+= (const uint64_t n)
 
giv_all_inlined Integeroperator+= (const int64_t n)
 
giv_all_inlined Integeroperator+= (const uint32_t n)
 
giv_all_inlined Integeroperator+= (const int32_t n)
 
template<class XXX >
Integeroperator+= (const XXX &n)
 
giv_all_inlined Integer operator- (const Integer &n) const
 operator -. More...
 
giv_all_inlined Integer operator- (const uint64_t n) const
 
giv_all_inlined Integer operator- (const int64_t n) const
 
giv_all_inlined Integer operator- (const uint32_t n) const
 
giv_all_inlined Integer operator- (const int32_t n) const
 
giv_all_inlined Integeroperator-= (const Integer &n)
 operator -= . More...
 
giv_all_inlined Integeroperator-= (const uint64_t n)
 
giv_all_inlined Integeroperator-= (const int64_t n)
 
giv_all_inlined Integeroperator-= (const uint32_t n)
 
giv_all_inlined Integeroperator-= (const int32_t n)
 
template<class XXX >
Integeroperator-= (const XXX &n)
 
giv_all_inlined Integer operator- () const
 Opposite. More...
 
giv_all_inlined Integer operator* (const Integer &n) const
 operator *. More...
 
giv_all_inlined Integer operator* (const uint64_t n) const
 
giv_all_inlined Integer operator* (const int64_t n) const
 
giv_all_inlined Integer operator* (const uint32_t n) const
 
giv_all_inlined Integer operator* (const int32_t n) const
 
giv_all_inlined Integeroperator*= (const Integer &n)
 operator *= . More...
 
giv_all_inlined Integeroperator*= (const uint64_t n)
 
giv_all_inlined Integeroperator*= (const int64_t n)
 
giv_all_inlined Integeroperator*= (const uint32_t n)
 
giv_all_inlined Integeroperator*= (const int32_t n)
 
template<class XXX >
Integeroperator*= (const XXX &n)
 
giv_all_inlined Integer operator+ (const int32_t l, const Integer &n)
 operator +. More...
 
giv_all_inlined Integer operator+ (const uint32_t l, const Integer &n)
 
giv_all_inlined Integer operator+ (const int64_t l, const Integer &n)
 
giv_all_inlined Integer operator+ (const uint64_t l, const Integer &n)
 
giv_all_inlined Integer operator- (const int32_t l, const Integer &n)
 operator - More...
 
giv_all_inlined Integer operator- (const uint32_t l, const Integer &n)
 
giv_all_inlined Integer operator- (const int64_t l, const Integer &n)
 
giv_all_inlined Integer operator- (const uint64_t l, const Integer &n)
 
giv_all_inlined Integer operator* (const int32_t l, const Integer &n)
 operator * More...
 
giv_all_inlined Integer operator* (const uint32_t l, const Integer &n)
 
giv_all_inlined Integer operator* (const int64_t l, const Integer &n)
 
giv_all_inlined Integer operator* (const uint64_t l, const Integer &n)
 

Division/euclidean division/modulo

The convention for rounding are the following :

  • q = a/b, or equivalent operations with the name div or divin, return q rounded towards 0, in the same manner as C's '/' (truncated division).
  • r = a % b behaves like C %. The modulo function % rounds towards 0 and the sign of the dividend is preserved. This is :

    \[ a= b q + r, \text{with } \vert r\vert < \vert b\vert \text{ and } a r \geq 0 \]

  • r = a mod b or similar functions have the same behaviour as GMP mpz_mod, that is the remainder is always positive (>=0). This is the division algorithm convention that is used (see divmod). In a formula :

    \[ a= b q + r, \text{with } 0 \leq r < \vert b\vert \]

Warning
if q=a/b and r= a % b then a = b q + r is always true (with in addition 0 <= |r| < |b|). This is also true for divmod(q,a,b,r) (and 0<=r<|b|). However, one should not mix the two conventions and expect equalities (except if a>=0).
giv_all_inlined Integer operator/ (const Integer &d) const
 Division operator. More...
 
giv_all_inlined Integer operator/ (const uint64_t d) const
 
giv_all_inlined Integer operator/ (const int64_t d) const
 
giv_all_inlined Integer operator/ (const uint32_t d) const
 
giv_all_inlined Integer operator/ (const int32_t d) const
 
giv_all_inlined Integeroperator/= (const Integer &d)
 Division operator (inplace). More...
 
giv_all_inlined Integeroperator/= (const uint64_t d)
 
giv_all_inlined Integeroperator/= (const int64_t d)
 
giv_all_inlined Integeroperator/= (const uint32_t d)
 
giv_all_inlined Integeroperator/= (const int32_t d)
 
template<class XXX >
Integeroperator/= (const XXX &d)
 
giv_all_inlined Integer operator% (const Integer &n) const
 Modulo operator. More...
 
giv_all_inlined int64_t operator% (const uint64_t n) const
 
giv_all_inlined int64_t operator% (const int64_t n) const
 
giv_all_inlined int32_t operator% (const uint32_t n) const
 
giv_all_inlined int32_t operator% (const int32_t n) const
 
giv_all_inlined double operator% (const double n) const
 
int16_t operator% (const uint16_t n) const
 
template<class XXX >
XXX operator% (const XXX &n) const
 
giv_all_inlined Integeroperator%= (const Integer &n)
 Modulo operator (inplace). More...
 
giv_all_inlined Integeroperator%= (const uint64_t n)
 
giv_all_inlined Integeroperator%= (const int64_t n)
 
giv_all_inlined Integeroperator%= (const uint32_t n)
 
giv_all_inlined Integeroperator%= (const int32_t n)
 
template<class XXX >
Integeroperator%= (const XXX &n)
 
giv_all_inlined Integer operator/ (const int32_t l, const Integer &n)
 operator / More...
 
giv_all_inlined Integer operator/ (const int64_t l, const Integer &n)
 
giv_all_inlined Integer operator/ (const uint32_t l, const Integer &n)
 operator / More...
 
giv_all_inlined Integer operator/ (const uint64_t l, const Integer &n)
 
giv_all_inlined Integer operator% (const int64_t l, const Integer &n)
 operator % More...
 
giv_all_inlined Integer operator% (const uint64_t l, const Integer &n)
 
giv_all_inlined Integer operator% (const int32_t l, const Integer &n)
 
giv_all_inlined Integer operator% (const uint32_t l, const Integer &n)
 
static giv_all_inlined Integerdivin (Integer &q, const Integer &d)
 Division q/=d. More...
 
static giv_all_inlined Integerdivin (Integer &q, const int64_t d)
 
static giv_all_inlined Integerdivin (Integer &q, const uint64_t d)
 
static giv_all_inlined Integerdiv (Integer &q, const Integer &n, const Integer &d)
 Division q=n/d. More...
 
static giv_all_inlined Integerdiv (Integer &q, const Integer &n, const int64_t d)
 
static giv_all_inlined Integerdiv (Integer &q, const Integer &n, const int32_t d)
 
static giv_all_inlined Integerdiv (Integer &q, const Integer &n, const uint64_t d)
 
static giv_all_inlined Integerdivexact (Integer &q, const Integer &n, const Integer &d)
 Division when d divides n. More...
 
static giv_all_inlined Integerdivexact (Integer &q, const Integer &n, const uint64_t &d)
 Division operator. More...
 
static giv_all_inlined Integerdivexact (Integer &q, const Integer &n, const int64_t &d)
 Division operator. More...
 
static giv_all_inlined Integer divexact (const Integer &n, const Integer &d)
 Division when d divides n. More...
 
static giv_all_inlined Integer divexact (const Integer &n, const uint64_t &d)
 Division operator. More...
 
static giv_all_inlined Integer divexact (const Integer &n, const int64_t &d)
 Division operator. More...
 
static giv_all_inlined Integertrem (Integer &r, const Integer &n, const Integer &d)
 Stuff. More...
 
static giv_all_inlined Integercrem (Integer &r, const Integer &n, const Integer &d)
 Division operator. More...
 
static giv_all_inlined Integerfrem (Integer &r, const Integer &n, const Integer &d)
 Division operator. More...
 
static giv_all_inlined Integertrem (Integer &r, const Integer &n, const uint64_t &d)
 Stuff. More...
 
static giv_all_inlined Integercrem (Integer &r, const Integer &n, const uint64_t &d)
 Division operator. More...
 
static giv_all_inlined Integerfrem (Integer &r, const Integer &n, const uint64_t &d)
 Division operator. More...
 
static giv_all_inlined uint64_t trem (const Integer &n, const uint64_t &d)
 Stuff. More...
 
static giv_all_inlined uint64_t crem (const Integer &n, const uint64_t &d)
 Division operator. More...
 
static giv_all_inlined uint64_t frem (const Integer &n, const uint64_t &d)
 Division operator. More...
 
static giv_all_inlined Integermodin (Integer &r, const Integer &n)
 Function mod (inplace). More...
 
static giv_all_inlined Integermodin (Integer &r, const int64_t n)
 
static giv_all_inlined Integermodin (Integer &r, const uint64_t n)
 
static giv_all_inlined Integermod (Integer &r, const Integer &n, const Integer &d)
 Function mod. More...
 
static giv_all_inlined Integermod (Integer &r, const Integer &n, const int64_t d)
 
static giv_all_inlined Integermod (Integer &r, const Integer &n, const uint64_t d)
 
static giv_all_inlined Integermod (Integer &r, const Integer &n, const int32_t d)
 
static giv_all_inlined Integermod (Integer &r, const Integer &n, const uint32_t d)
 
static giv_all_inlined Integerdivmod (Integer &q, Integer &r, const Integer &n, const Integer &d)
 Euclidean division. More...
 
static giv_all_inlined Integerdivmod (Integer &q, int64_t &r, const Integer &n, const int64_t d)
 
static giv_all_inlined Integerdivmod (Integer &q, uint64_t &r, const Integer &n, const uint64_t d)
 
static giv_all_inlined Integerceil (Integer &res, const Integer &n, const Integer &d)
 rounding functions. More...
 
static giv_all_inlined Integerfloor (Integer &res, const Integer &n, const Integer &d)
 
static giv_all_inlined Integertrunc (Integer &res, const Integer &n, const Integer &d)
 
static giv_all_inlined Integer ceil (const Integer &n, const Integer &d)
 rounding functions. More...
 
static giv_all_inlined Integer floor (const Integer &n, const Integer &d)
 
static giv_all_inlined Integer trunc (const Integer &n, const Integer &d)
 

Miscellaneous.

int32_t sign () const
 sign More...
 
int32_t priv_sign () const
 private sign More...
 
giv_all_inlined void swap (Integer &a, Integer &b)
 
int32_t sign (const Integer &a)
 sign More...
 

representation

get representation

mpz_ptr get_mpz ()
 get representation (constant) More...
 
mpz_srcptr get_mpz () const
 get representation (constant) More...
 
mpz_srcptr get_mpz_const () const
 get representation (constant) More...
 
giv_all_inlined size_t size () const
 returns the number of machine words used to store *this More...
 
giv_all_inlined size_t size_in_base (int32_t B) const
 returns ceil(log_BASE(*this)). More...
 
giv_all_inlined size_t bitsize () const
 returns ceil(log_2(*this)) . More...
 
giv_all_inlined uint64_t operator[] (size_t i) const
 return the i-th word of the integer. More...
 
giv_all_inlined uint64_t length (const Integer &a)
 returns the number of bytes used to store *this More...
 
giv_all_inlined int32_t isperfectpower (const Integer &n)
 perfect power More...
 
giv_all_inlined Integer abs (const Integer &n)
 absolute value More...
 
giv_all_inlined bool isOdd (const Integer &)
 parity of an integer More...
 

I/O

giv_all_inlined std::ostream & print (std::ostream &o) const
 print32_t integer. More...
 
giv_all_inlined std::istream & operator>> (std::istream &i, Integer &n)
 Input/Output of Integers. More...
 
giv_all_inlined std::ostream & operator<< (std::ostream &o, const Integer &n)
 out operator. More...
 
giv_all_inlined std::ostream & absOutput (std::ostream &o, const Integer &n)
 nodoc More...
 
giv_all_inlined void importWords (Integer &x, size_t count, int32_t order, int32_t size, int32_t endian, size_t nails, const void *op)
 nodoc More...
 

Detailed Description

This is the Integer class.

An Integer is represented as a GMP integer. This class provides arithmetic on Integers.

Examples:
examples/FiniteField/all_field.C, examples/FiniteField/domain_to_operatorstyle.C, examples/FiniteField/GF128.C, examples/FiniteField/kronecker.C, examples/FiniteField/Test_Extension.C, examples/Integer/givaro-ssh-keygen.C, examples/Integer/iexponentiation.C, examples/Integer/ifactor.C, examples/Integer/ifactor_lenstra.C, examples/Integer/igcd.C, examples/Integer/igcdext.C, examples/Integer/ilcm.C, examples/Integer/ispower.C, examples/Integer/isprime.C, examples/Integer/isproot.C, examples/Integer/ModularSquareRoot.C, examples/Integer/nb_primes.C, examples/Integer/nextprime.C, examples/Integer/order.C, examples/Integer/prevprime.C, examples/Integer/primitiveroot.C, examples/Integer/ProbLucas.C, examples/Integer/RSA_breaking.C, examples/Integer/RSA_decipher.C, examples/Integer/RSA_encipher.C, examples/Polynomial/PolynomialCRT.C, examples/Rational/iratrecon.C, and examples/Rational/polydouble.C.

Member Typedef Documentation

typedef std::vector<mp_limb_t> vect_t

vector of limbs (ie a gmp number).

typedef __mpz_struct Rep
protected

rep type

Constructor & Destructor Documentation

Integer ( int32_t  n = 0)

Constructor form a known type.

Parameters
ninput to be constructed from
Integer ( int64_t  n)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Integer ( unsigned char  n)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Integer ( uint32_t  n)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Integer ( uint64_t  n)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Integer ( double  n)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Integer ( const char *  n)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

giv_all_inlined Integer ( const mpz_class &  a)
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Integer ( const RecInt::ruint< K > &  n)
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Integer ( const RecInt::rint< K > &  n)
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Integer ( const Integer n)

Copy constructor.

Parameters
ninput to be constructed from
giv_all_inlined Integer ( uint64_t *  d,
int64_t  sz 
)

Creates a new Integer from pointers.

Parameters
darray
szsize
Integer ( const vect_t v)

Creates a new Integers for a vector of limbs.

Parameters
vvector of limbs
~Integer ( )

destructor

Member Function Documentation

Integer & operator= ( const Integer n)

copy from an integer.

Parameters
ninteger to copy.
Integer & logcpy ( const Integer n)

copy from an integer.

Parameters
ninteger to copy.
Integer & copy ( const Integer n)

copy from an integer.

Parameters
ninteger to copy.
Examples:
examples/Integer/ProbLucas.C.
static giv_all_inlined bool isleq ( const A &  a,
const B &  b 
)
inlinestatic

isleq

Parameters
a,b
int32_t operator>= ( const Integer l) const

greater or equal.

Parameters
linteger to be compared to
int32_t operator>= ( const int32_t  l) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

int32_t operator>= ( const int64_t  l) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

int32_t operator>= ( const uint64_t  l) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

int32_t operator>= ( const uint32_t  l) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

int32_t operator>= ( const double  l) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

int32_t operator>= ( const float  l) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

int32_t operator<= ( const Integer l) const

less or equal

Parameters
linteger to be compared to
int32_t operator<= ( const int32_t  l) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

int32_t operator<= ( const int64_t  l) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

int32_t operator<= ( const uint64_t  l) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

int32_t operator<= ( const uint32_t  l) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

int32_t operator<= ( const double  l) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

int32_t operator<= ( const float  l) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

int32_t operator!= ( const Integer l) const

operator != (not equal)

Parameters
linteger
Returns
1 iff l == this
int32_t operator!= ( const int32_t  l) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

int32_t operator!= ( const int64_t  l) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

int32_t operator!= ( const uint64_t  l) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

int32_t operator!= ( const uint32_t  l) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

int32_t operator!= ( const double  l) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

int32_t operator!= ( const float  l) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

int32_t operator== ( const Integer l) const

Equality.

Parameters
linteger to be compared to
int32_t operator== ( const int32_t  l) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

int32_t operator== ( const int64_t  l) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

int32_t operator== ( const uint64_t  l) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

int32_t operator== ( const uint32_t  l) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

int32_t operator== ( const double  l) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

int32_t operator== ( const float  l) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

int32_t operator> ( const Integer l) const

greater (strict)

Parameters
linteger to be compared to
int32_t operator> ( const int32_t  l) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

int32_t operator> ( const int64_t  l) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

int32_t operator> ( const uint64_t  l) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

int32_t operator> ( const uint32_t  l) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

int32_t operator> ( const double  l) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

int32_t operator> ( const float  l) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

int32_t operator< ( const Integer l) const

less (strict)

Parameters
linteger to be compared to
int32_t operator< ( const int32_t  l) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

int32_t operator< ( const int64_t  l) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

int32_t operator< ( const uint64_t  l) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

int32_t operator< ( const uint32_t  l) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

int32_t operator< ( const double  l) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

int32_t operator< ( const float  l) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Integer operator^ ( const Integer a) const

XOR (^)

Parameters
ainteger
Integer operator^ ( const uint64_t &  a) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Integer operator^ ( const uint32_t &  a) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Integer & operator^= ( const Integer a)

XOR inplace (^=)

Parameters
ainteger
Integer & operator^= ( const uint64_t &  a)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Integer & operator^= ( const uint32_t &  a)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Integer operator| ( const Integer a) const

OR (|)

Parameters
ainteger
Integer operator| ( const uint64_t &  a) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Integer operator| ( const uint32_t &  a) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Integer & operator|= ( const Integer a)

OR inplace (|=)

Parameters
ainteger
Integer & operator|= ( const uint64_t &  a)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Integer & operator|= ( const uint32_t &  a)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Integer operator& ( const Integer a) const

AND (&)

Parameters
ainteger
uint32_t operator& ( const uint32_t &  a) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

uint64_t operator& ( const uint64_t &  a) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Integer & operator&= ( const Integer a)

AND inplace (&=)

Parameters
ainteger
Integer & operator&= ( const uint64_t &  a)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Integer & operator&= ( const uint32_t &  a)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Integer operator~ ( ) const

complement to 1 (~)

Integer operator<< ( int32_t  l) const

left shift (<<)

Parameters
lshift
Integer operator<< ( int64_t  l) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Integer operator<< ( uint32_t  l) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Integer operator<< ( uint64_t  l) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Integer & operator<<= ( int32_t  l)

left shift inplace (<<=)

Parameters
lshift
Integer & operator<<= ( int64_t  l)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Integer & operator<<= ( uint32_t  l)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Integer & operator<<= ( uint64_t  l)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Integer operator>> ( int32_t  l) const

right shift (>>)

Parameters
lshift
Integer operator>> ( int64_t  l) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Integer operator>> ( uint32_t  l) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Integer operator>> ( uint64_t  l) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Integer & operator>>= ( int32_t  l)

right shift inplace (>>=)

Parameters
lshift
Integer & operator>>= ( int64_t  l)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Integer & operator>>= ( uint32_t  l)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Integer & operator>>= ( uint64_t  l)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Integer & addin ( Integer res,
const Integer n 
)
static

Addition (inplace) res+=n.

Parameters
resas in the formula
nas in the formula
Examples:
examples/Integer/givaro-ssh-keygen.C.
Integer & addin ( Integer res,
const int64_t  n 
)
static

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Integer & addin ( Integer res,
const uint64_t  n 
)
static

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

static giv_all_inlined Integer& addin ( Integer res,
const int32_t  n 
)
inlinestatic

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

static giv_all_inlined Integer& addin ( Integer res,
const uint32_t  n 
)
inlinestatic

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Integer & add ( Integer res,
const Integer n1,
const Integer n2 
)
static

Addition res=n1+n2.

Parameters
resas in the formula
n1as in the formula
n2as in the formula
Integer & add ( Integer res,
const Integer n1,
const int64_t  n2 
)
static

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Integer & add ( Integer res,
const Integer n1,
const uint64_t  n2 
)
static

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

static giv_all_inlined Integer& add ( Integer res,
const Integer n1,
const int32_t  n2 
)
inlinestatic

Addition (inplace) res+=n.

Parameters
resas in the formula
nas in the formula
static giv_all_inlined Integer& add ( Integer res,
const Integer n1,
const uint32_t  n2 
)
inlinestatic

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Integer & subin ( Integer res,
const Integer n 
)
static

Substraction (inplace) res-=n.

Parameters
resas in the formula
nas in the formula
Integer & subin ( Integer res,
const int64_t  n 
)
static

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Integer & subin ( Integer res,
const uint64_t  n 
)
static

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

static giv_all_inlined Integer& subin ( Integer res,
const int32_t  n 
)
inlinestatic

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

static giv_all_inlined Integer& subin ( Integer res,
const uint32_t  n 
)
inlinestatic

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Integer & sub ( Integer res,
const Integer n1,
const Integer n2 
)
static

Substraction res=n1-n2.

Parameters
resas in the formula
n1as in the formula
n2as in the formula
Examples:
examples/Integer/givaro-ssh-keygen.C.
Integer & sub ( Integer res,
const Integer n1,
const int64_t  n2 
)
static

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Integer & sub ( Integer res,
const Integer n1,
const uint64_t  n2 
)
static

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

static giv_all_inlined Integer& sub ( Integer res,
const Integer n1,
const int32_t  n2 
)
inlinestatic

Addition (inplace) res+=n.

Parameters
resas in the formula
nas in the formula
static giv_all_inlined Integer& sub ( Integer res,
const Integer n1,
const uint32_t  n2 
)
inlinestatic

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Integer & negin ( Integer res)
static

Negation (inplace) res=-res.

Parameters
resas in the formula
Integer & neg ( Integer res,
const Integer n 
)
static

Negation res=-n.

Parameters
nas in the formula
resas in the formula
Integer & mulin ( Integer res,
const Integer n 
)
static

Multiplication (inplace) res*=n.

Parameters
resas in the formula
nas in the formula
Integer & mulin ( Integer res,
const int64_t  n 
)
static

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Integer & mulin ( Integer res,
const uint64_t  n 
)
static

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

static giv_all_inlined Integer& mulin ( Integer res,
const int32_t  n 
)
inlinestatic

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

static giv_all_inlined Integer& mulin ( Integer res,
const uint32_t  n 
)
inlinestatic

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Integer & mul ( Integer res,
const Integer n1,
const Integer n2 
)
static

Multiplication res=n1*n2.

Parameters
resas in the formula
n1as in the formula
n2as in the formula
Examples:
examples/Integer/givaro-ssh-keygen.C.
Integer & mul ( Integer res,
const Integer n1,
const int64_t  n2 
)
static

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Integer & mul ( Integer res,
const Integer n1,
const uint64_t  n2 
)
static

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

static giv_all_inlined Integer& mul ( Integer res,
const Integer n1,
const int32_t  n2 
)
inlinestatic

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

static giv_all_inlined Integer& mul ( Integer res,
const Integer n1,
const uint32_t  n2 
)
inlinestatic

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Integer operator+ ( const Integer n) const

operator +.

Returns
(*this)+n
Parameters
nas in the formula.
Integer operator+ ( const uint64_t  n) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Integer operator+ ( const int64_t  n) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

giv_all_inlined Integer operator+ ( const uint32_t  n) const
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

giv_all_inlined Integer operator+ ( const int32_t  n) const
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Integer & operator+= ( const Integer n)

operator += .

Parameters
nasfriend In the formula.
Returns
(*this) += n.
Integer & operator+= ( const uint64_t  n)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Integer & operator+= ( const int64_t  n)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

giv_all_inlined Integer& operator+= ( const uint32_t  n)
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

giv_all_inlined Integer& operator+= ( const int32_t  n)
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Integer& operator+= ( const XXX &  n)
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Integer operator- ( const Integer n) const

operator -.

Returns
(*this)-n
Parameters
nas in the formula.
Integer operator- ( const uint64_t  n) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Integer operator- ( const int64_t  n) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

giv_all_inlined Integer operator- ( const uint32_t  n) const
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

giv_all_inlined Integer operator- ( const int32_t  n) const
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Integer & operator-= ( const Integer n)

operator -= .

Parameters
nas in the formula.
Returns
(*this) -= n.
Integer & operator-= ( const uint64_t  n)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Integer & operator-= ( const int64_t  n)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

giv_all_inlined Integer& operator-= ( const uint32_t  n)
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

giv_all_inlined Integer& operator-= ( const int32_t  n)
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Integer& operator-= ( const XXX &  n)
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Integer operator- ( ) const

Opposite.

Returns
-(*this).
Integer operator* ( const Integer n) const

operator *.

Returns
(*this)*n
Parameters
nas in the formula.
Integer operator* ( const uint64_t  n) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Integer operator* ( const int64_t  n) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

giv_all_inlined Integer operator* ( const uint32_t  n) const
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

giv_all_inlined Integer operator* ( const int32_t  n) const
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Integer & operator*= ( const Integer n)

operator *= .

Parameters
nas in the formula.
Returns
(*this) *= n.
Integer & operator*= ( const uint64_t  n)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Integer & operator*= ( const int64_t  n)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

giv_all_inlined Integer& operator*= ( const uint32_t  n)
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

giv_all_inlined Integer& operator*= ( const int32_t  n)
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Integer& operator*= ( const XXX &  n)
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Integer & axpy ( Integer res,
const Integer a,
const Integer x,
const Integer y 
)
static

axpy res = ax+y.

Parameters
resIntegers as in the forumla
aIntegers as in the forumla
xIntegers as in the forumla
yIntegers as in the forumla
Integer & axpy ( Integer res,
const Integer a,
const uint64_t  x,
const Integer y 
)
static

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Integer & axpyin ( Integer res,
const Integer a,
const Integer x 
)
static

axpyin (inplace) res += ax.

Parameters
resIntegers as in the formula.
aIntegers as in the formula.
xIntegers as in the formula.
Integer & axpyin ( Integer res,
const Integer a,
const uint64_t  x 
)
static

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Integer & maxpy ( Integer res,
const Integer a,
const Integer x,
const Integer y 
)
static

maxpy res = y - ax.

Parameters
resIntegers as in the formula.
aIntegers as in the formula.
xIntegers as in the formula.
yIntegers as in the formula.
Integer & maxpy ( Integer res,
const Integer a,
const uint64_t  x,
const Integer y 
)
static

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Integer & maxpyin ( Integer res,
const Integer a,
const Integer x 
)
static

maxpyin res -= ax.

Parameters
resIntegers as in the formula.
aIntegers as in the formula.
xIntegers as in the formula.
Integer & maxpyin ( Integer res,
const Integer a,
const uint64_t  x 
)
static

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Integer & axmy ( Integer res,
const Integer a,
const Integer x,
const Integer y 
)
static

axmy res = ax - y.

Parameters
resIntegers as in the formula.
aIntegers as in the formula.
xIntegers as in the formula.
yIntegers as in the formula.
Integer & axmy ( Integer res,
const Integer a,
const uint64_t  x,
const Integer y 
)
static

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Integer & axmyin ( Integer res,
const Integer a,
const Integer x 
)
static

axmyin (in place) res = ax - res.

Parameters
resIntegers as in the formula.
aIntegers as in the formula.
xIntegers as in the formula.
Integer & axmyin ( Integer res,
const Integer a,
const uint64_t  x 
)
static

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Integer & divin ( Integer q,
const Integer d 
)
static

Division q/=d.

Parameters
qquotient
ddivisor.
Returns
q
Integer & divin ( Integer q,
const int64_t  d 
)
static

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Integer & divin ( Integer q,
const uint64_t  d 
)
static

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Integer & div ( Integer q,
const Integer n,
const Integer d 
)
static

Division q=n/d.

Parameters
qquotient
ndividand.
ddivisor
Returns
q
Integer & div ( Integer q,
const Integer n,
const int64_t  d 
)
static

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Integer & div ( Integer q,
const Integer n,
const int32_t  d 
)
static

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Integer & div ( Integer q,
const Integer n,
const uint64_t  d 
)
static

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Integer & divexact ( Integer q,
const Integer n,
const Integer d 
)
static

Division when d divides n.

Parameters
qexact quotient
ndividend
ddivisor
Warning
if quotient is not exact, the result is not predictable.
Integer & divexact ( Integer q,
const Integer n,
const uint64_t &  d 
)
static

Division operator.

Parameters
ddivisor
Integer & divexact ( Integer q,
const Integer n,
const int64_t &  d 
)
static

Division operator.

Parameters
ddivisor
Integer divexact ( const Integer n,
const Integer d 
)
static

Division when d divides n.

Parameters
ndividend
ddivisor
Returns
exact quotient n/d
Warning
if quotient is not exact, the result is not predictable.
Integer divexact ( const Integer n,
const uint64_t &  d 
)
static

Division operator.

Parameters
ddivisor
Integer divexact ( const Integer n,
const int64_t &  d 
)
static

Division operator.

Parameters
ddivisor
Integer & trem ( Integer r,
const Integer n,
const Integer d 
)
static

Stuff.

Integer & crem ( Integer r,
const Integer n,
const Integer d 
)
static

Division operator.

Parameters
ddivisor
Integer & frem ( Integer r,
const Integer n,
const Integer d 
)
static

Division operator.

Parameters
ddivisor
Integer & trem ( Integer r,
const Integer n,
const uint64_t &  d 
)
static

Stuff.

Integer & crem ( Integer r,
const Integer n,
const uint64_t &  d 
)
static

Division operator.

Parameters
ddivisor
Integer & frem ( Integer r,
const Integer n,
const uint64_t &  d 
)
static

Division operator.

Parameters
ddivisor
uint64_t trem ( const Integer n,
const uint64_t &  d 
)
static

Stuff.

uint64_t crem ( const Integer n,
const uint64_t &  d 
)
static

Division operator.

Parameters
ddivisor
uint64_t frem ( const Integer n,
const uint64_t &  d 
)
static

Division operator.

Parameters
ddivisor
Integer operator/ ( const Integer d) const

Division operator.

Parameters
ddivisor
Integer operator/ ( const uint64_t  d) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Integer operator/ ( const int64_t  d) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

giv_all_inlined Integer operator/ ( const uint32_t  d) const
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

giv_all_inlined Integer operator/ ( const int32_t  d) const
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Integer & operator/= ( const Integer d)

Division operator (inplace).

Parameters
ddivisor
Integer & operator/= ( const uint64_t  d)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Integer & operator/= ( const int64_t  d)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

giv_all_inlined Integer& operator/= ( const uint32_t  d)
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

giv_all_inlined Integer& operator/= ( const int32_t  d)
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Integer& operator/= ( const XXX &  d)
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Integer & modin ( Integer r,
const Integer n 
)
static

Function mod (inplace).

$ r \gets r \mod n$

Parameters
rremainder
nmodulus
Examples:
examples/Integer/givaro-ssh-keygen.C.
Integer & modin ( Integer r,
const int64_t  n 
)
static

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Integer & modin ( Integer r,
const uint64_t  n 
)
static

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Integer & mod ( Integer r,
const Integer n,
const Integer d 
)
static

Function mod.

$ r \gets n \mod d$

Parameters
rremainder
ninteger
dmodulus
Examples:
examples/Integer/givaro-ssh-keygen.C.
Integer & mod ( Integer r,
const Integer n,
const int64_t  d 
)
static

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Integer & mod ( Integer r,
const Integer n,
const uint64_t  d 
)
static

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

static giv_all_inlined Integer& mod ( Integer r,
const Integer n,
const int32_t  d 
)
inlinestatic

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

static giv_all_inlined Integer& mod ( Integer r,
const Integer n,
const uint32_t  d 
)
inlinestatic

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Integer & divmod ( Integer q,
Integer r,
const Integer n,
const Integer d 
)
static

Euclidean division.

n = d q + r . Computes both the quotient and the residue (as in quorem).

Parameters
qas in the formula
ras in the formula
nas in the formula
das in the formula
Returns
the quotient q
Integer & divmod ( Integer q,
int64_t &  r,
const Integer n,
const int64_t  d 
)
static

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Integer & divmod ( Integer q,
uint64_t &  r,
const Integer n,
const uint64_t  d 
)
static

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Integer & ceil ( Integer res,
const Integer n,
const Integer d 
)
static

rounding functions.

these are the same as the STL ones, except for the signature.

Parameters
resthe result
nthe numerator
dthe demominator

same as std::ceil (n/d)

Integer & floor ( Integer res,
const Integer n,
const Integer d 
)
static

same as std::floor(n/d)

Integer & trunc ( Integer res,
const Integer n,
const Integer d 
)
static

same as std::trunc(n/d)

Integer ceil ( const Integer n,
const Integer d 
)
static

rounding functions.

these are the same as the STL ones, except for the signature.

Parameters
nthe numerator
dthe demominator
Returns
n/d rounded.

same as std::ceil (n/d)

Integer floor ( const Integer n,
const Integer d 
)
static

same as std::floor(n/d)

Integer trunc ( const Integer n,
const Integer d 
)
static

same as std::trunc(n/d)

Integer operator% ( const Integer n) const

Modulo operator.

Parameters
nmodulus
Returns
remainder (*this) mod n
int64_t operator% ( const uint64_t  n) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

int64_t operator% ( const int64_t  n) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

giv_all_inlined int32_t operator% ( const uint32_t  n) const
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

giv_all_inlined int32_t operator% ( const int32_t  n) const
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

double operator% ( const double  n) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

int16_t operator% ( const uint16_t  n) const
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

XXX operator% ( const XXX &  n) const
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Integer & operator%= ( const Integer n)

Modulo operator (inplace).

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
nmodulus
Returns
remainder (*this) <- (*this) mod n
Integer & operator%= ( const uint64_t  n)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Integer & operator%= ( const int64_t  n)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

giv_all_inlined Integer& operator%= ( const uint32_t  n)
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

giv_all_inlined Integer& operator%= ( const int32_t  n)
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Integer& operator%= ( const XXX &  n)
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

int32_t sign ( ) const
inline

sign

int32_t priv_sign ( ) const
inline

private sign

mpz_ptr get_mpz ( )
inline

get representation (constant)

mpz_srcptr get_mpz ( ) const
inline

get representation (constant)

mpz_srcptr get_mpz_const ( ) const
inline

get representation (constant)

size_t size ( ) const

returns the number of machine words used to store *this

size_t size_in_base ( int32_t  B) const

returns ceil(log_BASE(*this)).

size_t bitsize ( ) const

returns ceil(log_2(*this)) .

uint64_t operator[] ( size_t  i) const

return the i-th word of the integer.

Word 0 is lowest word.

Integer& operator++ ( )
inline
Integer operator++ ( int  )
inline
Integer& operator-- ( )
inline
Integer operator-- ( int  )
inline
operator bool ( ) const
inline
operator int16_t ( ) const
inline
operator uint16_t ( ) const
inline
operator unsigned char ( ) const
inline
operator uint32_t ( ) const
operator int32_t ( ) const
operator signed char ( ) const
inline
operator uint64_t ( ) const
operator int64_t ( ) const
operator std::string ( ) const
operator float ( ) const
operator double ( ) const
operator Integer::vect_t ( ) const
operator RecInt::ruint< K > ( ) const
inline
operator RecInt::rint< K > ( ) const
inline
void seeding ( uint64_t  s)
inlinestatic

Random numbers (no doc)

void seeding ( Integer  s)
inlinestatic

Random numbers (no doc)

void seeding ( )
inlinestatic
bool RandBool ( )
inlinestatic

Random numbers (no doc)

Integer & random_lessthan ( Integer r,
const Integer m 
)
inlinestatic

returns a random integer r in the intervall [[x, m-1]] where x = 0 or -(m-1) according to ALWAYSPOSITIVE

Bug:
m has to be an integer here.
Integer & random_lessthan ( Integer r,
const Integer m 
)
inlinestatic

Random numbers (no doc)

Integer & random_lessthan_2exp ( Integer r,
const uint64_t &  m 
)
inlinestatic

returns a random integer r in the intervall [[x, 2^m-1]] where x = 0 or -(2^m-1) according to ALWAYSPOSITIVE returns a random integer r of at most m bits

Integer & random_lessthan_2exp ( Integer r,
const uint64_t &  m 
)
inlinestatic

Random numbers (no doc)

Integer random_lessthan_2exp ( const uint64_t &  m)
inlinestatic

Random numbers (no doc)

Integer random_lessthan_2exp ( const uint64_t &  m)
inlinestatic

Random numbers (no doc)

Integer & random_lessthan ( Integer r,
const uint64_t &  m 
)
inlinestatic

Random numbers (no doc)

Integer & random_lessthan ( Integer r,
const uint64_t &  m 
)
inlinestatic

Random numbers (no doc)

Integer random_lessthan ( const T &  m)
inlinestatic

Random numbers (no doc)

Integer random_lessthan ( const T &  m)
inlinestatic

Random numbers (no doc)

Integer & random_exact_2exp ( Integer r,
const uint64_t &  m 
)
inlinestatic

returns a reference to a random number r of the size m bits, exactly.

Integer & random_exact_2exp ( Integer r,
const uint64_t &  m 
)
inlinestatic

Random numbers (no doc)

Integer & random_exact ( Integer r,
const Integer s 
)
inlinestatic

returns a reference to a random number r of the size of s, exactly.

Integer & random_exact ( Integer r,
const Integer s 
)
inlinestatic

Random numbers (no doc)

Integer & random_exact ( Integer r,
const uint64_t &  m 
)
inlinestatic

Random numbers (no doc)

Integer & random_exact ( Integer r,
const uint64_t &  m 
)
inlinestatic

Random numbers (no doc)

Integer & random_exact ( Integer r,
const T &  m 
)
inlinestatic

Random numbers (no doc)

Integer & random_exact ( Integer r,
const T &  m 
)
inlinestatic

Random numbers (no doc)

Integer random_exact ( const T &  s)
inlinestatic

Random numbers (no doc)

Integer random_exact ( const T &  s)
inlinestatic

Random numbers (no doc)

Integer & random_between ( Integer r,
const Integer m,
const Integer M 
)
inlinestatic

Random numbers (no doc)

Integer random_between ( const Integer m,
const Integer M 
)
inlinestatic

Random numbers (no doc)

Integer & random_between_2exp ( Integer r,
const uint64_t &  m,
const uint64_t &  M 
)
inlinestatic

Random numbers (no doc)

Integer & random_between ( Integer r,
const uint64_t &  m,
const uint64_t &  M 
)
inlinestatic

Random numbers (no doc)

Integer random_between_2exp ( const uint64_t &  m,
const uint64_t &  M 
)
inlinestatic

Random numbers (no doc)

Integer random_between ( const uint64_t &  m,
const uint64_t &  M 
)
inlinestatic

Random numbers (no doc)

Integer random_between ( const R &  m,
const R &  M 
)
inlinestatic

Random numbers (no doc)

Integer & random_between ( Integer r,
const R &  m,
const R &  M 
)
inlinestatic

Random numbers (no doc)

Integer & random ( Integer r,
const T &  m 
)
inlinestatic

returns a random integer less than...

Integer & random ( Integer r,
const T &  m 
)
inlinestatic

Random numbers (no doc)

Integer random ( const T &  sz)
inlinestatic

returns a random integer less than...

Integer random ( const T &  sz)
inlinestatic

Random numbers (no doc)

Integer random ( )
inlinestatic

Random numbers (no doc)

Integer random ( )
inlinestatic

Random numbers (no doc)

Integer nonzerorandom ( const T &  sz)
inlinestatic

Random numbers (no doc)

Integer & nonzerorandom ( Integer r,
const T &  size 
)
inlinestatic

Random numbers (no doc)

Integer nonzerorandom ( const T &  sz)
inlinestatic

Random numbers (no doc)

Integer & nonzerorandom ( Integer r,
const T &  size 
)
inlinestatic

Random numbers (no doc)

Integer nonzerorandom ( )
inlinestatic

Random numbers (no doc)

std::ostream & print ( std::ostream &  o) const

print32_t integer.

Parameters
ooutput stream.
const Rep* get_rep ( ) const
inlineprotected

get representation.

Friends And Related Function Documentation

giv_all_inlined friend int32_t compare ( const Integer a,
const Integer b 
)
friend

Compares two integers.

Parameters
ainteger
binteger
Returns
1 if $a > b$, 0 if $a = b$ and -1 otherwise.
giv_all_inlined friend int32_t absCompare ( const Integer a,
const Integer b 
)
friend

Compare the norm of two integers.

Parameters
ainteger
binteger
Returns
1 if $|a| > |b|$, 0 if $|a| = |b|$ and -1 otherwise.
giv_all_inlined friend int32_t absCompare ( const Integer a,
const double  b 
)
friend

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

giv_all_inlined friend int32_t absCompare ( const Integer a,
const float  b 
)
friend

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

giv_all_inlined friend int32_t absCompare ( const Integer a,
const uint64_t  b 
)
friend

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

giv_all_inlined friend int32_t absCompare ( const Integer a,
const unsigned  b 
)
friend

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

giv_all_inlined friend int32_t absCompare ( const Integer a,
const int64_t  b 
)
friend

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

giv_all_inlined friend int32_t absCompare ( const Integer a,
const int32_t  b 
)
friend

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

giv_all_inlined friend int32_t absCompare ( const T  a,
const Integer b 
)
friend

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

giv_all_inlined int32_t isOne ( const Integer a)
friend

name compare to 1 and 0

Parameters
a
giv_all_inlined int32_t isMOne ( const Integer a)
friend

Compares two integers.

Parameters
ainteger
binteger
Returns
1 if $a > b$, 0 if $a = b$ and -1 otherwise.
giv_all_inlined int32_t nonZero ( const Integer a)
friend

name compare to 1 and 0

Parameters
a
giv_all_inlined int32_t isZero ( const Integer a)
friend

name compare to 1 and 0

Parameters
a
giv_all_inlined int32_t isZero ( const int16_t  a)
friend

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

giv_all_inlined int32_t isZero ( const int32_t  a)
friend

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

giv_all_inlined int32_t isZero ( const int64_t  a)
friend

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

giv_all_inlined int32_t isZero ( const uint16_t  a)
friend

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

giv_all_inlined int32_t isZero ( const uint32_t  a)
friend

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

giv_all_inlined int32_t isZero ( const uint64_t  a)
friend

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

giv_all_inlined friend int32_t operator>= ( uint32_t  l,
const Integer n 
)
friend

greater or equal.

Parameters
l,nintegers to compare
giv_all_inlined friend int32_t operator>= ( float  l,
const Integer n 
)
friend

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

giv_all_inlined friend int32_t operator>= ( double  l,
const Integer n 
)
friend

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

giv_all_inlined friend int32_t operator>= ( int32_t  l,
const Integer n 
)
friend

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

giv_all_inlined friend int32_t operator>= ( int64_t  l,
const Integer n 
)
friend

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

giv_all_inlined friend int32_t operator>= ( uint64_t  l,
const Integer n 
)
friend

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

giv_all_inlined friend int32_t operator<= ( uint32_t  l,
const Integer n 
)
friend

less or equal

Parameters
l,nintegers to compare
giv_all_inlined friend int32_t operator<= ( float  l,
const Integer n 
)
friend

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

giv_all_inlined friend int32_t operator<= ( double  l,
const Integer n 
)
friend

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

giv_all_inlined friend int32_t operator<= ( int32_t  l,
const Integer n 
)
friend

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

giv_all_inlined friend int32_t operator<= ( int64_t  l,
const Integer n 
)
friend

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

giv_all_inlined friend int32_t operator<= ( uint64_t  l,
const Integer n 
)
friend

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

giv_all_inlined friend int32_t operator!= ( uint32_t  l,
const Integer n 
)
friend

operator != (not equal)

Parameters
l,ninteger
Returns
1 iff l == n
giv_all_inlined friend int32_t operator!= ( float  l,
const Integer n 
)
friend

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

giv_all_inlined friend int32_t operator!= ( double  l,
const Integer n 
)
friend

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

giv_all_inlined friend int32_t operator!= ( int32_t  l,
const Integer n 
)
friend

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

giv_all_inlined friend int32_t operator!= ( int64_t  l,
const Integer n 
)
friend

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

giv_all_inlined friend int32_t operator!= ( uint64_t  l,
const Integer n 
)
friend

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

giv_all_inlined friend int32_t operator== ( uint32_t  l,
const Integer n 
)
friend

Equality.

Parameters
l,nintegers to compare
giv_all_inlined friend int32_t operator== ( float  l,
const Integer n 
)
friend

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

giv_all_inlined friend int32_t operator== ( double  l,
const Integer n 
)
friend

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

giv_all_inlined friend int32_t operator== ( int32_t  l,
const Integer n 
)
friend

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

giv_all_inlined friend int32_t operator== ( int64_t  l,
const Integer n 
)
friend

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

giv_all_inlined friend int32_t operator== ( uint64_t  l,
const Integer n 
)
friend

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

giv_all_inlined friend int32_t operator> ( uint32_t  l,
const Integer n 
)
friend

greater (strict)

Parameters
l,nintegers to compare
giv_all_inlined friend int32_t operator> ( float  l,
const Integer n 
)
friend

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

giv_all_inlined friend int32_t operator> ( double  l,
const Integer n 
)
friend

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

giv_all_inlined friend int32_t operator> ( int32_t  l,
const Integer n 
)
friend

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

giv_all_inlined friend int32_t operator> ( int64_t  l,
const Integer n 
)
friend

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

giv_all_inlined friend int32_t operator> ( uint64_t  l,
const Integer n 
)
friend

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

giv_all_inlined friend int32_t operator< ( uint32_t  l,
const Integer n 
)
friend

less (strict)

Parameters
l,nintegers to compare
giv_all_inlined friend int32_t operator< ( float  l,
const Integer n 
)
friend

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

giv_all_inlined friend int32_t operator< ( double  l,
const Integer n 
)
friend

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

giv_all_inlined friend int32_t operator< ( int32_t  l,
const Integer n 
)
friend

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

giv_all_inlined friend int32_t operator< ( int64_t  l,
const Integer n 
)
friend

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

giv_all_inlined friend int32_t operator< ( uint64_t  l,
const Integer n 
)
friend

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

giv_all_inlined Integer operator+ ( const int32_t  l,
const Integer n 
)
friend

operator +.

Parameters
l,nto be added
giv_all_inlined Integer operator+ ( const uint32_t  l,
const Integer n 
)
friend

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

giv_all_inlined Integer operator+ ( const int64_t  l,
const Integer n 
)
friend

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

giv_all_inlined Integer operator+ ( const uint64_t  l,
const Integer n 
)
friend

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

giv_all_inlined Integer operator- ( const int32_t  l,
const Integer n 
)
friend

operator -

Parameters
l,nto be substracted
giv_all_inlined Integer operator- ( const uint32_t  l,
const Integer n 
)
friend

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

giv_all_inlined Integer operator- ( const int64_t  l,
const Integer n 
)
friend

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

giv_all_inlined Integer operator- ( const uint64_t  l,
const Integer n 
)
friend

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

giv_all_inlined Integer operator* ( const int32_t  l,
const Integer n 
)
friend

operator *

Parameters
l,nto be multpct
giv_all_inlined Integer operator* ( const uint32_t  l,
const Integer n 
)
friend

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

giv_all_inlined Integer operator* ( const int64_t  l,
const Integer n 
)
friend

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

giv_all_inlined Integer operator* ( const uint64_t  l,
const Integer n 
)
friend

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

giv_all_inlined Integer operator/ ( const int32_t  l,
const Integer n 
)
friend

operator /

giv_all_inlined Integer operator/ ( const int64_t  l,
const Integer n 
)
friend

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

giv_all_inlined Integer operator/ ( const uint32_t  l,
const Integer n 
)
friend

operator /

giv_all_inlined Integer operator/ ( const uint64_t  l,
const Integer n 
)
friend

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

giv_all_inlined Integer operator% ( const int64_t  l,
const Integer n 
)
friend

operator %

Parameters
l
n
Returns
nl
giv_all_inlined Integer operator% ( const uint64_t  l,
const Integer n 
)
friend

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

giv_all_inlined Integer operator% ( const int32_t  l,
const Integer n 
)
friend

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

giv_all_inlined Integer operator% ( const uint32_t  l,
const Integer n 
)
friend

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

giv_all_inlined Integer gcd ( const Integer a,
const Integer b 
)
friend

gcd.

Parameters
a,bintegers
Returns
gcd(a,b)
Examples:
examples/Integer/givaro-ssh-keygen.C.
giv_all_inlined Integer gcd ( Integer u,
Integer v,
const Integer a,
const Integer b 
)
friend

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

giv_all_inlined Integer& gcd ( Integer g,
const Integer a,
const Integer b 
)
friend

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

giv_all_inlined Integer& gcd ( Integer g,
Integer u,
Integer v,
const Integer a,
const Integer b 
)
friend

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

giv_all_inlined Integer& inv ( Integer u,
const Integer a,
const Integer b 
)
friend

Inverse.

Compute the inverse u = a/b.

Parameters
u
a
b
a
b
[out]uis set to $a^{-1}$ modulo b
giv_all_inlined Integer& invin ( Integer u,
const Integer b 
)
friend

Compute the inverse inplace u = u/b.

Parameters
u
b
giv_all_inlined Integer pp ( const Integer P,
const Integer Q 
)
friend

pp

Parameters
P,Qparams
giv_all_inlined Integer& lcm ( Integer g,
const Integer a,
const Integer b 
)
friend

lcm

Parameters
g,a,b
Returns
g=lcm(a,b)
giv_all_inlined Integer lcm ( const Integer a,
const Integer b 
)
friend

lcm

Parameters
a,b
giv_all_inlined Integer& pow ( Integer Res,
const Integer n,
const int64_t  l 
)
friend

pow.

return $n^l$

Parameters
Res,n,l
giv_all_inlined Integer& pow ( Integer Res,
const uint64_t  n,
const uint64_t  l 
)
friend

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

giv_all_inlined Integer& pow ( Integer Res,
const Integer n,
const uint64_t  l 
)
friend

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

giv_all_inlined Integer& pow ( Integer Res,
const Integer n,
const int32_t  l 
)
friend

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

giv_all_inlined Integer& pow ( Integer Res,
const Integer n,
const uint32_t  l 
)
friend

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

giv_all_inlined Integer pow ( const Integer n,
const int64_t  l 
)
friend

pow.

return $n^l$

Parameters
n,l
giv_all_inlined Integer pow ( const Integer n,
const uint64_t  l 
)
friend

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

giv_all_inlined Integer pow ( const Integer n,
const int32_t  l 
)
friend

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

giv_all_inlined Integer pow ( const Integer n,
const uint32_t  l 
)
friend

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

giv_all_inlined Integer& powmod ( Integer Res,
const Integer n,
const uint64_t  e,
const Integer m 
)
friend

modular pow. return $n^e \mod m$.

giv_all_inlined Integer& powmod ( Integer Res,
const Integer n,
const int64_t  e,
const Integer m 
)
friend

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

giv_all_inlined Integer& powmod ( Integer Res,
const Integer n,
const uint32_t  e,
const Integer m 
)
friend

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

giv_all_inlined Integer& powmod ( Integer Res,
const Integer n,
const int32_t  e,
const Integer m 
)
friend

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

giv_all_inlined Integer& powmod ( Integer Res,
const Integer n,
const Integer e,
const Integer m 
)
friend

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

giv_all_inlined Integer powmod ( const Integer n,
const uint64_t  e,
const Integer m 
)
friend

modular pow.

return $n^e \mod m$.

Parameters
n,e,m
giv_all_inlined Integer powmod ( const Integer n,
const int64_t  e,
const Integer m 
)
friend

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

giv_all_inlined Integer powmod ( const Integer n,
const uint32_t  e,
const Integer m 
)
friend

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

giv_all_inlined Integer powmod ( const Integer n,
const int32_t  e,
const Integer m 
)
friend

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

giv_all_inlined Integer powmod ( const Integer n,
const Integer e,
const Integer m 
)
friend

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

giv_all_inlined Integer fact ( uint64_t  l)
friend

fact

Parameters
l
giv_all_inlined Integer sqrt ( const Integer p)
friend

(square) roots

Parameters
p
giv_all_inlined Integer& sqrt ( Integer r,
const Integer p 
)
friend

(square) roots

Parameters
r,p
giv_all_inlined Integer sqrtrem ( const Integer p,
Integer rem 
)
friend

(square) roots

Parameters
p,rem
giv_all_inlined Integer& sqrtrem ( Integer r,
const Integer p,
Integer rem 
)
friend

(square) roots

Parameters
r,p,rem
giv_all_inlined bool root ( Integer q,
const Integer a,
uint32_t  n 
)
friend

(square) roots

Parameters
q,a,n
giv_all_inlined int64_t logp ( const Integer a,
const Integer p 
)
friend

logs

Parameters
a,p
giv_all_inlined double logtwo ( const Integer a)
friend

logs

Parameters
a
giv_all_inlined double naturallog ( const Integer a)
friend

logs

Parameters
a
giv_all_inlined void swap ( Integer a,
Integer b 
)
friend

swap

Parameters
a,b
int32_t sign ( const Integer a)
friend

sign

Parameters
a
giv_all_inlined uint64_t length ( const Integer a)
friend

returns the number of bytes used to store *this

Parameters
a
Bug:
JGD 23.04.2012: shouldn't it be "mp_limb_t" instead of "uint64_t"?
giv_all_inlined int32_t isperfectpower ( const Integer n)
friend

perfect power

giv_all_inlined Integer abs ( const Integer n)
friend

absolute value

giv_all_inlined bool isOdd ( const Integer a)
friend

parity of an integer

Parameters
ainteger
Returns
1 if odd, 0 if even
giv_all_inlined Integer& prevprime ( Integer r,
const Integer p 
)
friend
giv_all_inlined Integer& nextprime ( Integer r,
const Integer p 
)
friend
giv_all_inlined int32_t probab_prime ( const Integer p)
friend
giv_all_inlined int32_t probab_prime ( const Integer p,
int32_t  r 
)
friend
giv_all_inlined int32_t jacobi ( const Integer u,
const Integer v 
)
friend
giv_all_inlined int32_t legendre ( const Integer u,
const Integer v 
)
friend
giv_all_inlined std::istream& operator>> ( std::istream &  i,
Integer n 
)
friend

Input/Output of Integers.

in operator.

Parameters
iinput stream
ninteger to be built
giv_all_inlined std::ostream& operator<< ( std::ostream &  o,
const Integer n 
)
friend

out operator.

Parameters
ooutput stream
ninteger to be printed
giv_all_inlined std::ostream& absOutput ( std::ostream &  o,
const Integer n 
)
friend

nodoc

Parameters
ooutput
ninteger
giv_all_inlined void importWords ( Integer x,
size_t  count,
int32_t  order,
int32_t  size,
int32_t  endian,
size_t  nails,
const void *  op 
)
friend

nodoc

Parameters
xx
countx
orderx
sizex
endianx
nailsx
opx

Field Documentation

const Integer zero
static
const Integer one
static
const Integer mOne
static

minus one (-1)

Rep gmp_rep
protected

rep


The documentation for this class was generated from the following files: