Givaro
Public Types | Static Public Attributes | Friends
Integer Class Reference

#include <gmp++_int.h>

Inherited by SpyInteger::InHeritsInteger.

+ Collaboration diagram for Integer:

Public Types

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

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)
 Constructor form a known type. More...
 
giv_all_inlined Integer (unsigned char n)
 Constructor form a known type. More...
 
giv_all_inlined Integer (uint32_t n)
 Constructor form a known type. More...
 
giv_all_inlined Integer (uint64_t n)
 Constructor form a known type. More...
 
giv_all_inlined Integer (double n)
 Constructor form a known type. More...
 
giv_all_inlined Integer (const char *n)
 Constructor form a known type. More...
 
giv_all_inlined Integer (const mpz_class &a)
 Constructor form a known type. More...
 
template<size_t K>
 Integer (const RecInt::ruint< K > &n)
 Constructor form a known type. More...
 
template<size_t K>
 Integer (const RecInt::rint< K > &n)
 Constructor form a known type. More...
 
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
 

Static Public Attributes

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

Friends

giv_all_inlined Integerpowmod (Integer &Res, const Integer &n, const uint64_t e, const Integer &m)
 modular pow. return $n^e \mod m$.
 
giv_all_inlined Integer powmod (const Integer &n, const uint64_t e, const Integer &m)
 modular pow. More...
 
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)
 gcd. More...
 
giv_all_inlined Integergcd (Integer &g, const Integer &a, const Integer &b)
 gcd. More...
 
giv_all_inlined Integergcd (Integer &g, Integer &u, Integer &v, const Integer &a, const Integer &b)
 gcd. More...
 
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)
 gcd. More...
 
giv_all_inlined Integerpow (Integer &Res, const Integer &n, const uint64_t l)
 gcd. More...
 
giv_all_inlined Integerpow (Integer &Res, const Integer &n, const int32_t l)
 gcd. More...
 
giv_all_inlined Integerpow (Integer &Res, const Integer &n, const uint32_t l)
 gcd. More...
 
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)
 gcd. More...
 
giv_all_inlined Integer pow (const Integer &n, const int32_t l)
 gcd. More...
 
giv_all_inlined Integer pow (const Integer &n, const uint32_t l)
 gcd. More...
 
primes
giv_all_inlined IntegerProtected::prevprime (Integer &, const Integer &p)
 
giv_all_inlined IntegerProtected::nextprime (Integer &, const Integer &p)
 
giv_all_inlined int32_t Protected::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)
 

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...
 

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)
 Compares two integers. More...
 
giv_all_inlined friend int32_t absCompare (const Integer &a, const float b)
 Compares two integers. More...
 
giv_all_inlined friend int32_t absCompare (const Integer &a, const uint64_t b)
 Compares two integers. More...
 
giv_all_inlined friend int32_t absCompare (const Integer &a, const unsigned b)
 Compares two integers. More...
 
giv_all_inlined friend int32_t absCompare (const Integer &a, const int64_t b)
 Compares two integers. More...
 
giv_all_inlined friend int32_t absCompare (const Integer &a, const int32_t b)
 Compares two integers. More...
 
template<class T >
giv_all_inlined friend int32_t absCompare (const T a, const Integer &b)
 Compares two integers. More...
 
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)
 Compares two integers. More...
 
giv_all_inlined int32_t isZero (const int32_t a)
 Compares two integers. More...
 
giv_all_inlined int32_t isZero (const int64_t a)
 Compares two integers. More...
 
giv_all_inlined int32_t isZero (const uint16_t a)
 Compares two integers. More...
 
giv_all_inlined int32_t isZero (const uint32_t a)
 Compares two integers. More...
 
giv_all_inlined int32_t isZero (const uint64_t a)
 Compares two integers. More...
 
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
 greater or equal. More...
 
giv_all_inlined int32_t operator>= (const int64_t l) const
 greater or equal. More...
 
giv_all_inlined int32_t operator>= (const uint64_t l) const
 greater or equal. More...
 
giv_all_inlined int32_t operator>= (const uint32_t l) const
 greater or equal. More...
 
giv_all_inlined int32_t operator>= (const double l) const
 greater or equal. More...
 
giv_all_inlined int32_t operator>= (const float l) const
 greater or equal. More...
 
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
 greater or equal. More...
 
giv_all_inlined int32_t operator<= (const int64_t l) const
 greater or equal. More...
 
giv_all_inlined int32_t operator<= (const uint64_t l) const
 greater or equal. More...
 
giv_all_inlined int32_t operator<= (const uint32_t l) const
 greater or equal. More...
 
giv_all_inlined int32_t operator<= (const double l) const
 greater or equal. More...
 
giv_all_inlined int32_t operator<= (const float l) const
 greater or equal. More...
 
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
 greater or equal. More...
 
giv_all_inlined int32_t operator!= (const int64_t l) const
 greater or equal. More...
 
giv_all_inlined int32_t operator!= (const uint64_t l) const
 greater or equal. More...
 
giv_all_inlined int32_t operator!= (const uint32_t l) const
 greater or equal. More...
 
giv_all_inlined int32_t operator!= (const double l) const
 greater or equal. More...
 
giv_all_inlined int32_t operator!= (const float l) const
 greater or equal. More...
 
giv_all_inlined int32_t operator== (const Integer &l) const
 Equality. More...
 
giv_all_inlined int32_t operator== (const int32_t l) const
 greater or equal. More...
 
giv_all_inlined int32_t operator== (const int64_t l) const
 greater or equal. More...
 
giv_all_inlined int32_t operator== (const uint64_t l) const
 greater or equal. More...
 
giv_all_inlined int32_t operator== (const uint32_t l) const
 greater or equal. More...
 
giv_all_inlined int32_t operator== (const double l) const
 greater or equal. More...
 
giv_all_inlined int32_t operator== (const float l) const
 greater or equal. More...
 
giv_all_inlined int32_t operator> (const Integer &l) const
 greater (strict) More...
 
giv_all_inlined int32_t operator> (const int32_t l) const
 greater or equal. More...
 
giv_all_inlined int32_t operator> (const int64_t l) const
 greater or equal. More...
 
giv_all_inlined int32_t operator> (const uint64_t l) const
 greater or equal. More...
 
giv_all_inlined int32_t operator> (const uint32_t l) const
 greater or equal. More...
 
giv_all_inlined int32_t operator> (const double l) const
 greater or equal. More...
 
giv_all_inlined int32_t operator> (const float l) const
 greater or equal. More...
 
giv_all_inlined int32_t operator< (const Integer &l) const
 less (strict) More...
 
giv_all_inlined int32_t operator< (const int32_t l) const
 greater or equal. More...
 
giv_all_inlined int32_t operator< (const int64_t l) const
 greater or equal. More...
 
giv_all_inlined int32_t operator< (const uint64_t l) const
 greater or equal. More...
 
giv_all_inlined int32_t operator< (const uint32_t l) const
 greater or equal. More...
 
giv_all_inlined int32_t operator< (const double l) const
 greater or equal. More...
 
giv_all_inlined int32_t operator< (const float l) const
 greater or equal. More...
 
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)
 greater or equal. More...
 
giv_all_inlined friend int32_t operator>= (double l, const Integer &n)
 greater or equal. More...
 
giv_all_inlined friend int32_t operator>= (int32_t l, const Integer &n)
 greater or equal. More...
 
giv_all_inlined friend int32_t operator>= (int64_t l, const Integer &n)
 greater or equal. More...
 
giv_all_inlined friend int32_t operator>= (uint64_t l, const Integer &n)
 greater or equal. More...
 
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)
 greater or equal. More...
 
giv_all_inlined friend int32_t operator<= (double l, const Integer &n)
 greater or equal. More...
 
giv_all_inlined friend int32_t operator<= (int32_t l, const Integer &n)
 greater or equal. More...
 
giv_all_inlined friend int32_t operator<= (int64_t l, const Integer &n)
 greater or equal. More...
 
giv_all_inlined friend int32_t operator<= (uint64_t l, const Integer &n)
 greater or equal. More...
 
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)
 greater or equal. More...
 
giv_all_inlined friend int32_t operator!= (double l, const Integer &n)
 greater or equal. More...
 
giv_all_inlined friend int32_t operator!= (int32_t l, const Integer &n)
 greater or equal. More...
 
giv_all_inlined friend int32_t operator!= (int64_t l, const Integer &n)
 greater or equal. More...
 
giv_all_inlined friend int32_t operator!= (uint64_t l, const Integer &n)
 greater or equal. More...
 
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)
 greater or equal. More...
 
giv_all_inlined friend int32_t operator== (double l, const Integer &n)
 greater or equal. More...
 
giv_all_inlined friend int32_t operator== (int32_t l, const Integer &n)
 greater or equal. More...
 
giv_all_inlined friend int32_t operator== (int64_t l, const Integer &n)
 greater or equal. More...
 
giv_all_inlined friend int32_t operator== (uint64_t l, const Integer &n)
 greater or equal. More...
 
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)
 greater or equal. More...
 
giv_all_inlined friend int32_t operator> (double l, const Integer &n)
 greater or equal. More...
 
giv_all_inlined friend int32_t operator> (int32_t l, const Integer &n)
 greater or equal. More...
 
giv_all_inlined friend int32_t operator> (int64_t l, const Integer &n)
 greater or equal. More...
 
giv_all_inlined friend int32_t operator> (uint64_t l, const Integer &n)
 greater or equal. More...
 
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)
 greater or equal. More...
 
giv_all_inlined friend int32_t operator< (double l, const Integer &n)
 greater or equal. More...
 
giv_all_inlined friend int32_t operator< (int32_t l, const Integer &n)
 greater or equal. More...
 
giv_all_inlined friend int32_t operator< (int64_t l, const Integer &n)
 greater or equal. More...
 
giv_all_inlined friend int32_t operator< (uint64_t l, const Integer &n)
 greater or equal. More...
 

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
 operator +. More...
 
giv_all_inlined Integer operator+ (const int64_t n) const
 operator +. More...
 
giv_all_inlined Integer operator+ (const uint32_t n) const
 operator +. More...
 
giv_all_inlined Integer operator+ (const int32_t n) const
 operator +. More...
 
giv_all_inlined Integeroperator+= (const Integer &n)
 operator += . More...
 
giv_all_inlined Integeroperator+= (const uint64_t n)
 operator +. More...
 
giv_all_inlined Integeroperator+= (const int64_t n)
 operator +. More...
 
giv_all_inlined Integeroperator+= (const uint32_t n)
 operator +. More...
 
giv_all_inlined Integeroperator+= (const int32_t n)
 operator +. More...
 
template<class XXX >
Integeroperator+= (const XXX &n)
 operator +. More...
 
giv_all_inlined Integer operator- (const Integer &n) const
 operator -. More...
 
giv_all_inlined Integer operator- (const uint64_t n) const
 operator +. More...
 
giv_all_inlined Integer operator- (const int64_t n) const
 operator +. More...
 
giv_all_inlined Integer operator- (const uint32_t n) const
 operator +. More...
 
giv_all_inlined Integer operator- (const int32_t n) const
 operator +. More...
 
giv_all_inlined Integeroperator-= (const Integer &n)
 operator -= . More...
 
giv_all_inlined Integeroperator-= (const uint64_t n)
 operator +. More...
 
giv_all_inlined Integeroperator-= (const int64_t n)
 operator +. More...
 
giv_all_inlined Integeroperator-= (const uint32_t n)
 operator +. More...
 
giv_all_inlined Integeroperator-= (const int32_t n)
 operator +. More...
 
template<class XXX >
Integeroperator-= (const XXX &n)
 operator +. More...
 
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
 operator +. More...
 
giv_all_inlined Integer operator* (const int64_t n) const
 operator +. More...
 
giv_all_inlined Integer operator* (const uint32_t n) const
 operator +. More...
 
giv_all_inlined Integer operator* (const int32_t n) const
 operator +. More...
 
giv_all_inlined Integeroperator*= (const Integer &n)
 operator *= . More...
 
giv_all_inlined Integeroperator*= (const uint64_t n)
 operator +. More...
 
giv_all_inlined Integeroperator*= (const int64_t n)
 operator +. More...
 
giv_all_inlined Integeroperator*= (const uint32_t n)
 operator +. More...
 
giv_all_inlined Integeroperator*= (const int32_t n)
 operator +. More...
 
template<class XXX >
Integeroperator*= (const XXX &n)
 operator +. More...
 
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)
 operator +. More...
 
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)
 operator +. More...
 
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)
 operator +. More...
 
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)
 operator +. More...
 
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)
 operator +. More...
 
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)
 operator +. More...
 

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
 Division operator. More...
 
giv_all_inlined Integer operator/ (const int64_t d) const
 Division operator. More...
 
giv_all_inlined Integer operator/ (const uint32_t d) const
 Division operator. More...
 
giv_all_inlined Integer operator/ (const int32_t d) const
 Division operator. More...
 
giv_all_inlined Integeroperator/= (const Integer &d)
 Division operator (inplace). More...
 
giv_all_inlined Integeroperator/= (const uint64_t d)
 Division operator. More...
 
giv_all_inlined Integeroperator/= (const int64_t d)
 Division operator. More...
 
giv_all_inlined Integeroperator/= (const uint32_t d)
 Division operator. More...
 
giv_all_inlined Integeroperator/= (const int32_t d)
 Division operator. More...
 
template<class XXX >
Integeroperator/= (const XXX &d)
 Division operator. More...
 
giv_all_inlined Integer operator% (const Integer &n) const
 Modulo operator. More...
 
giv_all_inlined int64_t operator% (const uint64_t n) const
 Division operator. More...
 
giv_all_inlined int64_t operator% (const int64_t n) const
 Division operator. More...
 
giv_all_inlined int32_t operator% (const uint32_t n) const
 Division operator. More...
 
giv_all_inlined int32_t operator% (const int32_t n) const
 Division operator. More...
 
giv_all_inlined double operator% (const double n) const
 Division operator. More...
 
int16_t operator% (const uint16_t n) const
 Division operator. More...
 
template<class XXX >
XXX operator% (const XXX &n) const
 Division operator. More...
 
giv_all_inlined Integeroperator%= (const Integer &n)
 Modulo operator (inplace). More...
 
giv_all_inlined Integeroperator%= (const uint64_t n)
 Division operator. More...
 
giv_all_inlined Integeroperator%= (const int64_t n)
 Division operator. More...
 
giv_all_inlined Integeroperator%= (const uint32_t n)
 Division operator. More...
 
giv_all_inlined Integeroperator%= (const int32_t n)
 Division operator. More...
 
template<class XXX >
Integeroperator%= (const XXX &n)
 Division operator. More...
 
giv_all_inlined Integer operator/ (const int32_t l, const Integer &n)
 operator /
 
giv_all_inlined Integer operator/ (const int64_t l, const Integer &n)
 Division operator. More...
 
giv_all_inlined Integer operator/ (const uint32_t l, const Integer &n)
 operator /
 
giv_all_inlined Integer operator/ (const uint64_t l, const Integer &n)
 Division operator. More...
 
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)
 Division operator. More...
 
giv_all_inlined Integer operator% (const int32_t l, const Integer &n)
 Division operator. More...
 
giv_all_inlined Integer operator% (const uint32_t l, const Integer &n)
 Division operator. More...
 
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)
 Division operator. More...
 
static giv_all_inlined Integerdivin (Integer &q, const uint64_t d)
 Division operator. More...
 
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)
 Division operator. More...
 
static giv_all_inlined Integerdiv (Integer &q, const Integer &n, const int32_t d)
 Division operator. More...
 
static giv_all_inlined Integerdiv (Integer &q, const Integer &n, const uint64_t d)
 Division operator. More...
 
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.
 
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.
 
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.
 
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)
 Division operator. More...
 
static giv_all_inlined Integermodin (Integer &r, const uint64_t n)
 Division operator. More...
 
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)
 Division operator. More...
 
static giv_all_inlined Integermod (Integer &r, const Integer &n, const uint64_t d)
 Division operator. More...
 
static giv_all_inlined Integermod (Integer &r, const Integer &n, const int32_t d)
 Division operator. More...
 
static giv_all_inlined Integermod (Integer &r, const Integer &n, const uint32_t d)
 Division operator. More...
 
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)
 Division operator. More...
 
static giv_all_inlined Integerdivmod (Integer &q, uint64_t &r, const Integer &n, const uint64_t d)
 Division operator. More...
 
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
 
int32_t priv_sign () const
 private sign
 
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)
 
mpz_srcptr get_mpz () const
 get representation (constant)
 
mpz_srcptr get_mpz_const () const
 get representation (constant)
 
giv_all_inlined size_t size () const
 returns the number of machine words used to store *this

 
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
 
giv_all_inlined Integer abs (const Integer &n)
 absolute value
 
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 Protected::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/Test_Extension.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.

Constructor & Destructor Documentation

◆ Integer() [1/13]

Integer ( int32_t  n = 0)

Constructor form a known type.

Parameters
ninput to be constructed from

◆ Integer() [2/13]

Integer ( int64_t  n)

Constructor form a known type.

Parameters
ninput to be constructed from

◆ Integer() [3/13]

Integer ( unsigned char  n)

Constructor form a known type.

Parameters
ninput to be constructed from

◆ Integer() [4/13]

Integer ( uint32_t  n)

Constructor form a known type.

Parameters
ninput to be constructed from

◆ Integer() [5/13]

Integer ( uint64_t  n)

Constructor form a known type.

Parameters
ninput to be constructed from

◆ Integer() [6/13]

Integer ( double  n)

Constructor form a known type.

Parameters
ninput to be constructed from

◆ Integer() [7/13]

Integer ( const char *  n)

Constructor form a known type.

Parameters
ninput to be constructed from

◆ Integer() [8/13]

giv_all_inlined Integer ( const mpz_class &  a)
inline

Constructor form a known type.

Parameters
ninput to be constructed from

◆ Integer() [9/13]

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

Constructor form a known type.

Parameters
ninput to be constructed from

◆ Integer() [10/13]

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

Constructor form a known type.

Parameters
ninput to be constructed from

◆ Integer() [11/13]

Integer ( const Integer n)

Copy constructor.

Parameters
ninput to be constructed from

◆ Integer() [12/13]

giv_all_inlined Integer ( uint64_t *  d,
int64_t  sz 
)

Creates a new Integer from pointers.

Parameters
darray
szsize

◆ Integer() [13/13]

Integer ( const vect_t v)

Creates a new Integers for a vector of limbs.

Parameters
vvector of limbs

Member Function Documentation

◆ operator=()

Integer & operator= ( const Integer n)

copy from an integer.

Parameters
ninteger to copy.

◆ logcpy()

Integer & logcpy ( const Integer n)

copy from an integer.

Parameters
ninteger to copy.

◆ copy()

Integer & copy ( const Integer n)

copy from an integer.

Parameters
ninteger to copy.
Examples
examples/Integer/ProbLucas.C.

◆ isleq()

static giv_all_inlined bool isleq ( const A &  a,
const B &  b 
)
inlinestatic

isleq

Parameters
a,b

◆ operator>=() [1/7]

int32_t operator>= ( const Integer l) const

greater or equal.

Parameters
linteger to be compared to

◆ operator>=() [2/7]

int32_t operator>= ( const int32_t  l) const

greater or equal.

Parameters
linteger to be compared to

◆ operator>=() [3/7]

int32_t operator>= ( const int64_t  l) const

greater or equal.

Parameters
linteger to be compared to

◆ operator>=() [4/7]

int32_t operator>= ( const uint64_t  l) const

greater or equal.

Parameters
linteger to be compared to

◆ operator>=() [5/7]

int32_t operator>= ( const uint32_t  l) const

greater or equal.

Parameters
linteger to be compared to

◆ operator>=() [6/7]

int32_t operator>= ( const double  l) const

greater or equal.

Parameters
linteger to be compared to

◆ operator>=() [7/7]

int32_t operator>= ( const float  l) const

greater or equal.

Parameters
linteger to be compared to

◆ operator<=() [1/7]

int32_t operator<= ( const Integer l) const

less or equal

Parameters
linteger to be compared to

◆ operator<=() [2/7]

int32_t operator<= ( const int32_t  l) const

greater or equal.

Parameters
linteger to be compared to

◆ operator<=() [3/7]

int32_t operator<= ( const int64_t  l) const

greater or equal.

Parameters
linteger to be compared to

◆ operator<=() [4/7]

int32_t operator<= ( const uint64_t  l) const

greater or equal.

Parameters
linteger to be compared to

◆ operator<=() [5/7]

int32_t operator<= ( const uint32_t  l) const

greater or equal.

Parameters
linteger to be compared to

◆ operator<=() [6/7]

int32_t operator<= ( const double  l) const

greater or equal.

Parameters
linteger to be compared to

◆ operator<=() [7/7]

int32_t operator<= ( const float  l) const

greater or equal.

Parameters
linteger to be compared to

◆ operator!=() [1/7]

int32_t operator!= ( const Integer l) const

operator != (not equal)

Parameters
linteger
Returns
1 iff l == this

◆ operator!=() [2/7]

int32_t operator!= ( const int32_t  l) const

greater or equal.

Parameters
linteger to be compared to

◆ operator!=() [3/7]

int32_t operator!= ( const int64_t  l) const

greater or equal.

Parameters
linteger to be compared to

◆ operator!=() [4/7]

int32_t operator!= ( const uint64_t  l) const

greater or equal.

Parameters
linteger to be compared to

◆ operator!=() [5/7]

int32_t operator!= ( const uint32_t  l) const

greater or equal.

Parameters
linteger to be compared to

◆ operator!=() [6/7]

int32_t operator!= ( const double  l) const

greater or equal.

Parameters
linteger to be compared to

◆ operator!=() [7/7]

int32_t operator!= ( const float  l) const

greater or equal.

Parameters
linteger to be compared to

◆ operator==() [1/7]

int32_t operator== ( const Integer l) const

Equality.

Parameters
linteger to be compared to

◆ operator==() [2/7]

int32_t operator== ( const int32_t  l) const

greater or equal.

Parameters
linteger to be compared to

◆ operator==() [3/7]

int32_t operator== ( const int64_t  l) const

greater or equal.

Parameters
linteger to be compared to

◆ operator==() [4/7]

int32_t operator== ( const uint64_t  l) const

greater or equal.

Parameters
linteger to be compared to

◆ operator==() [5/7]

int32_t operator== ( const uint32_t  l) const

greater or equal.

Parameters
linteger to be compared to

◆ operator==() [6/7]

int32_t operator== ( const double  l) const

greater or equal.

Parameters
linteger to be compared to

◆ operator==() [7/7]

int32_t operator== ( const float  l) const

greater or equal.

Parameters
linteger to be compared to

◆ operator>() [1/7]

int32_t operator> ( const Integer l) const

greater (strict)

Parameters
linteger to be compared to

◆ operator>() [2/7]

int32_t operator> ( const int32_t  l) const

greater or equal.

Parameters
linteger to be compared to

◆ operator>() [3/7]

int32_t operator> ( const int64_t  l) const

greater or equal.

Parameters
linteger to be compared to

◆ operator>() [4/7]

int32_t operator> ( const uint64_t  l) const

greater or equal.

Parameters
linteger to be compared to

◆ operator>() [5/7]

int32_t operator> ( const uint32_t  l) const

greater or equal.

Parameters
linteger to be compared to

◆ operator>() [6/7]

int32_t operator> ( const double  l) const

greater or equal.

Parameters
linteger to be compared to

◆ operator>() [7/7]

int32_t operator> ( const float  l) const

greater or equal.

Parameters
linteger to be compared to

◆ operator<() [1/7]

int32_t operator< ( const Integer l) const

less (strict)

Parameters
linteger to be compared to

◆ operator<() [2/7]

int32_t operator< ( const int32_t  l) const

greater or equal.

Parameters
linteger to be compared to

◆ operator<() [3/7]

int32_t operator< ( const int64_t  l) const

greater or equal.

Parameters
linteger to be compared to

◆ operator<() [4/7]

int32_t operator< ( const uint64_t  l) const

greater or equal.

Parameters
linteger to be compared to

◆ operator<() [5/7]

int32_t operator< ( const uint32_t  l) const

greater or equal.

Parameters
linteger to be compared to

◆ operator<() [6/7]

int32_t operator< ( const double  l) const

greater or equal.

Parameters
linteger to be compared to

◆ operator<() [7/7]

int32_t operator< ( const float  l) const

greater or equal.

Parameters
linteger to be compared to

◆ operator^() [1/3]

Integer operator^ ( const Integer a) const

XOR (^)

Parameters
ainteger

◆ operator^() [2/3]

Integer operator^ ( const uint64_t &  a) const

XOR (^)

Parameters
ainteger

◆ operator^() [3/3]

Integer operator^ ( const uint32_t &  a) const

XOR (^)

Parameters
ainteger

◆ operator^=() [1/3]

Integer & operator^= ( const Integer a)

XOR inplace (^=)

Parameters
ainteger

◆ operator^=() [2/3]

Integer & operator^= ( const uint64_t &  a)

XOR (^)

Parameters
ainteger

◆ operator^=() [3/3]

Integer & operator^= ( const uint32_t &  a)

XOR (^)

Parameters
ainteger

◆ operator|() [1/3]

Integer operator| ( const Integer a) const

OR (|)

Parameters
ainteger

◆ operator|() [2/3]

Integer operator| ( const uint64_t &  a) const

XOR (^)

Parameters
ainteger

◆ operator|() [3/3]

Integer operator| ( const uint32_t &  a) const

XOR (^)

Parameters
ainteger

◆ operator|=() [1/3]

Integer & operator|= ( const Integer a)

OR inplace (|=)

Parameters
ainteger

◆ operator|=() [2/3]

Integer & operator|= ( const uint64_t &  a)

XOR (^)

Parameters
ainteger

◆ operator|=() [3/3]

Integer & operator|= ( const uint32_t &  a)

XOR (^)

Parameters
ainteger

◆ operator&() [1/3]

Integer operator& ( const Integer a) const

AND (&)

Parameters
ainteger

◆ operator&() [2/3]

uint32_t operator& ( const uint32_t &  a) const

XOR (^)

Parameters
ainteger

◆ operator&() [3/3]

uint64_t operator& ( const uint64_t &  a) const

XOR (^)

Parameters
ainteger

◆ operator&=() [1/3]

Integer & operator&= ( const Integer a)

AND inplace (&=)

Parameters
ainteger

◆ operator&=() [2/3]

Integer & operator&= ( const uint64_t &  a)

XOR (^)

Parameters
ainteger

◆ operator&=() [3/3]

Integer & operator&= ( const uint32_t &  a)

XOR (^)

Parameters
ainteger

◆ operator<<() [1/4]

Integer operator<< ( int32_t  l) const

left shift (<<)

Parameters
lshift

◆ operator<<() [2/4]

Integer operator<< ( int64_t  l) const

XOR (^)

Parameters
ainteger

◆ operator<<() [3/4]

Integer operator<< ( uint32_t  l) const

XOR (^)

Parameters
ainteger

◆ operator<<() [4/4]

Integer operator<< ( uint64_t  l) const

XOR (^)

Parameters
ainteger

◆ operator<<=() [1/4]

Integer & operator<<= ( int32_t  l)

left shift inplace (<<=)

Parameters
lshift

◆ operator<<=() [2/4]

Integer & operator<<= ( int64_t  l)

XOR (^)

Parameters
ainteger

◆ operator<<=() [3/4]

Integer & operator<<= ( uint32_t  l)

XOR (^)

Parameters
ainteger

◆ operator<<=() [4/4]

Integer & operator<<= ( uint64_t  l)

XOR (^)

Parameters
ainteger

◆ operator>>() [1/4]

Integer operator>> ( int32_t  l) const

right shift (>>)

Parameters
lshift

◆ operator>>() [2/4]

Integer operator>> ( int64_t  l) const

XOR (^)

Parameters
ainteger

◆ operator>>() [3/4]

Integer operator>> ( uint32_t  l) const

XOR (^)

Parameters
ainteger

◆ operator>>() [4/4]

Integer operator>> ( uint64_t  l) const

XOR (^)

Parameters
ainteger

◆ operator>>=() [1/4]

Integer & operator>>= ( int32_t  l)

right shift inplace (>>=)

Parameters
lshift

◆ operator>>=() [2/4]

Integer & operator>>= ( int64_t  l)

XOR (^)

Parameters
ainteger

◆ operator>>=() [3/4]

Integer & operator>>= ( uint32_t  l)

XOR (^)

Parameters
ainteger

◆ operator>>=() [4/4]

Integer & operator>>= ( uint64_t  l)

XOR (^)

Parameters
ainteger

◆ addin() [1/5]

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

Addition (inplace) res+=n.

Parameters
resas in the formula
nas in the formula

◆ addin() [2/5]

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

Addition (inplace) res+=n.

Parameters
resas in the formula
nas in the formula

◆ addin() [3/5]

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

Addition (inplace) res+=n.

Parameters
resas in the formula
nas in the formula

◆ addin() [4/5]

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

Addition (inplace) res+=n.

Parameters
resas in the formula
nas in the formula

◆ addin() [5/5]

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

Addition (inplace) res+=n.

Parameters
resas in the formula
nas in the formula

◆ add() [1/5]

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

◆ add() [2/5]

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

Addition (inplace) res+=n.

Parameters
resas in the formula
nas in the formula

◆ add() [3/5]

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

Addition (inplace) res+=n.

Parameters
resas in the formula
nas in the formula

◆ add() [4/5]

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

◆ add() [5/5]

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

Addition (inplace) res+=n.

Parameters
resas in the formula
nas in the formula

◆ subin() [1/5]

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

Substraction (inplace) res-=n.

Parameters
resas in the formula
nas in the formula

◆ subin() [2/5]

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

Addition (inplace) res+=n.

Parameters
resas in the formula
nas in the formula

◆ subin() [3/5]

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

Addition (inplace) res+=n.

Parameters
resas in the formula
nas in the formula

◆ subin() [4/5]

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

Addition (inplace) res+=n.

Parameters
resas in the formula
nas in the formula

◆ subin() [5/5]

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

Addition (inplace) res+=n.

Parameters
resas in the formula
nas in the formula

◆ sub() [1/5]

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

◆ sub() [2/5]

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

Addition (inplace) res+=n.

Parameters
resas in the formula
nas in the formula

◆ sub() [3/5]

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

Addition (inplace) res+=n.

Parameters
resas in the formula
nas in the formula

◆ sub() [4/5]

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

◆ sub() [5/5]

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

Addition (inplace) res+=n.

Parameters
resas in the formula
nas in the formula

◆ negin()

Integer & negin ( Integer res)
static

Negation (inplace) res=-res.

Parameters
resas in the formula

◆ neg()

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

Negation res=-n.

Parameters
nas in the formula
resas in the formula

◆ mulin() [1/5]

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

Multiplication (inplace) res*=n.

Parameters
resas in the formula
nas in the formula

◆ mulin() [2/5]

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

Addition (inplace) res+=n.

Parameters
resas in the formula
nas in the formula

◆ mulin() [3/5]

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

Addition (inplace) res+=n.

Parameters
resas in the formula
nas in the formula

◆ mulin() [4/5]

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

Addition (inplace) res+=n.

Parameters
resas in the formula
nas in the formula

◆ mulin() [5/5]

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

Addition (inplace) res+=n.

Parameters
resas in the formula
nas in the formula

◆ mul() [1/5]

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

◆ mul() [2/5]

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

Addition (inplace) res+=n.

Parameters
resas in the formula
nas in the formula

◆ mul() [3/5]

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

Addition (inplace) res+=n.

Parameters
resas in the formula
nas in the formula

◆ mul() [4/5]

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

Addition (inplace) res+=n.

Parameters
resas in the formula
nas in the formula

◆ mul() [5/5]

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

Addition (inplace) res+=n.

Parameters
resas in the formula
nas in the formula

◆ operator+() [1/5]

Integer operator+ ( const Integer n) const

operator +.

Returns
(*this)+n
Parameters
nas in the formula.

◆ operator+() [2/5]

Integer operator+ ( const uint64_t  n) const

operator +.

Returns
(*this)+n
Parameters
nas in the formula.

◆ operator+() [3/5]

Integer operator+ ( const int64_t  n) const

operator +.

Returns
(*this)+n
Parameters
nas in the formula.

◆ operator+() [4/5]

giv_all_inlined Integer operator+ ( const uint32_t  n) const
inline

operator +.

Returns
(*this)+n
Parameters
nas in the formula.

◆ operator+() [5/5]

giv_all_inlined Integer operator+ ( const int32_t  n) const
inline

operator +.

Returns
(*this)+n
Parameters
nas in the formula.

◆ operator+=() [1/6]

Integer & operator+= ( const Integer n)

operator += .

Parameters
nasfriend In the formula.
Returns
(*this) += n.

◆ operator+=() [2/6]

Integer & operator+= ( const uint64_t  n)

operator +.

Returns
(*this)+n
Parameters
nas in the formula.

◆ operator+=() [3/6]

Integer & operator+= ( const int64_t  n)

operator +.

Returns
(*this)+n
Parameters
nas in the formula.

◆ operator+=() [4/6]

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

operator +.

Returns
(*this)+n
Parameters
nas in the formula.

◆ operator+=() [5/6]

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

operator +.

Returns
(*this)+n
Parameters
nas in the formula.

◆ operator+=() [6/6]

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

operator +.

Returns
(*this)+n
Parameters
nas in the formula.

◆ operator-() [1/6]

Integer operator- ( const Integer n) const

operator -.

Returns
(*this)-n
Parameters
nas in the formula.

◆ operator-() [2/6]

Integer operator- ( const uint64_t  n) const

operator +.

Returns
(*this)+n
Parameters
nas in the formula.

◆ operator-() [3/6]

Integer operator- ( const int64_t  n) const

operator +.

Returns
(*this)+n
Parameters
nas in the formula.

◆ operator-() [4/6]

giv_all_inlined Integer operator- ( const uint32_t  n) const
inline

operator +.

Returns
(*this)+n
Parameters
nas in the formula.

◆ operator-() [5/6]

giv_all_inlined Integer operator- ( const int32_t  n) const
inline

operator +.

Returns
(*this)+n
Parameters
nas in the formula.

◆ operator-=() [1/6]

Integer & operator-= ( const Integer n)

operator -= .

Parameters
nas in the formula.
Returns
(*this) -= n.

◆ operator-=() [2/6]

Integer & operator-= ( const uint64_t  n)

operator +.

Returns
(*this)+n
Parameters
nas in the formula.

◆ operator-=() [3/6]

Integer & operator-= ( const int64_t  n)

operator +.

Returns
(*this)+n
Parameters
nas in the formula.

◆ operator-=() [4/6]

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

operator +.

Returns
(*this)+n
Parameters
nas in the formula.

◆ operator-=() [5/6]

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

operator +.

Returns
(*this)+n
Parameters
nas in the formula.

◆ operator-=() [6/6]

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

operator +.

Returns
(*this)+n
Parameters
nas in the formula.

◆ operator-() [6/6]

Integer operator- ( ) const

Opposite.

Returns
-(*this).

◆ operator*() [1/5]

Integer operator* ( const Integer n) const

operator *.

Returns
(*this)*n
Parameters
nas in the formula.

◆ operator*() [2/5]

Integer operator* ( const uint64_t  n) const

operator +.

Returns
(*this)+n
Parameters
nas in the formula.

◆ operator*() [3/5]

Integer operator* ( const int64_t  n) const

operator +.

Returns
(*this)+n
Parameters
nas in the formula.

◆ operator*() [4/5]

giv_all_inlined Integer operator* ( const uint32_t  n) const
inline

operator +.

Returns
(*this)+n
Parameters
nas in the formula.

◆ operator*() [5/5]

giv_all_inlined Integer operator* ( const int32_t  n) const
inline

operator +.

Returns
(*this)+n
Parameters
nas in the formula.

◆ operator*=() [1/6]

Integer & operator*= ( const Integer n)

operator *= .

Parameters
nas in the formula.
Returns
(*this) *= n.

◆ operator*=() [2/6]

Integer & operator*= ( const uint64_t  n)

operator +.

Returns
(*this)+n
Parameters
nas in the formula.

◆ operator*=() [3/6]

Integer & operator*= ( const int64_t  n)

operator +.

Returns
(*this)+n
Parameters
nas in the formula.

◆ operator*=() [4/6]

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

operator +.

Returns
(*this)+n
Parameters
nas in the formula.

◆ operator*=() [5/6]

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

operator +.

Returns
(*this)+n
Parameters
nas in the formula.

◆ operator*=() [6/6]

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

operator +.

Returns
(*this)+n
Parameters
nas in the formula.

◆ axpy() [1/2]

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

◆ axpy() [2/2]

Integer & axpy ( Integer res,
const Integer a,
const uint64_t  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

◆ axpyin() [1/2]

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.

◆ axpyin() [2/2]

Integer & axpyin ( Integer res,
const Integer a,
const uint64_t  x 
)
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

◆ maxpy() [1/2]

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.

◆ maxpy() [2/2]

Integer & maxpy ( Integer res,
const Integer a,
const uint64_t  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

◆ maxpyin() [1/2]

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.

◆ maxpyin() [2/2]

Integer & maxpyin ( Integer res,
const Integer a,
const uint64_t  x 
)
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

◆ axmy() [1/2]

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.

◆ axmy() [2/2]

Integer & axmy ( Integer res,
const Integer a,
const uint64_t  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

◆ axmyin() [1/2]

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.

◆ axmyin() [2/2]

Integer & axmyin ( Integer res,
const Integer a,
const uint64_t  x 
)
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

◆ divin() [1/3]

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

Division q/=d.

Parameters
qquotient
ddivisor.
Returns
q

◆ divin() [2/3]

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

Division operator.

Parameters
ddivisor

◆ divin() [3/3]

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

Division operator.

Parameters
ddivisor

◆ div() [1/4]

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

Division q=n/d.

Parameters
qquotient
ndividand.
ddivisor
Returns
q

◆ div() [2/4]

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

Division operator.

Parameters
ddivisor

◆ div() [3/4]

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

Division operator.

Parameters
ddivisor

◆ div() [4/4]

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

Division operator.

Parameters
ddivisor

◆ divexact() [1/6]

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.

◆ divexact() [2/6]

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

Division operator.

Parameters
ddivisor

◆ divexact() [3/6]

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

Division operator.

Parameters
ddivisor

◆ divexact() [4/6]

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.

◆ divexact() [5/6]

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

Division operator.

Parameters
ddivisor

◆ divexact() [6/6]

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

Division operator.

Parameters
ddivisor

◆ crem() [1/3]

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

Division operator.

Parameters
ddivisor

◆ frem() [1/3]

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

Division operator.

Parameters
ddivisor

◆ crem() [2/3]

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

Division operator.

Parameters
ddivisor

◆ frem() [2/3]

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

Division operator.

Parameters
ddivisor

◆ crem() [3/3]

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

Division operator.

Parameters
ddivisor

◆ frem() [3/3]

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

Division operator.

Parameters
ddivisor

◆ operator/() [1/5]

Integer operator/ ( const Integer d) const

Division operator.

Parameters
ddivisor

◆ operator/() [2/5]

Integer operator/ ( const uint64_t  d) const

Division operator.

Parameters
ddivisor

◆ operator/() [3/5]

Integer operator/ ( const int64_t  d) const

Division operator.

Parameters
ddivisor

◆ operator/() [4/5]

giv_all_inlined Integer operator/ ( const uint32_t  d) const
inline

Division operator.

Parameters
ddivisor

◆ operator/() [5/5]

giv_all_inlined Integer operator/ ( const int32_t  d) const
inline

Division operator.

Parameters
ddivisor

◆ operator/=() [1/6]

Integer & operator/= ( const Integer d)

Division operator (inplace).

Parameters
ddivisor

◆ operator/=() [2/6]

Integer & operator/= ( const uint64_t  d)

Division operator.

Parameters
ddivisor

◆ operator/=() [3/6]

Integer & operator/= ( const int64_t  d)

Division operator.

Parameters
ddivisor

◆ operator/=() [4/6]

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

Division operator.

Parameters
ddivisor

◆ operator/=() [5/6]

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

Division operator.

Parameters
ddivisor

◆ operator/=() [6/6]

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

Division operator.

Parameters
ddivisor

◆ modin() [1/3]

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

Function mod (inplace).

$ r \gets r \mod n$

Parameters
rremainder
nmodulus

◆ modin() [2/3]

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

Division operator.

Parameters
ddivisor

◆ modin() [3/3]

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

Division operator.

Parameters
ddivisor

◆ mod() [1/5]

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

Function mod.

$ r \gets n \mod d$

Parameters
rremainder
ninteger
dmodulus

◆ mod() [2/5]

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

Division operator.

Parameters
ddivisor

◆ mod() [3/5]

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

Division operator.

Parameters
ddivisor

◆ mod() [4/5]

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

Division operator.

Parameters
ddivisor

◆ mod() [5/5]

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

Division operator.

Parameters
ddivisor

◆ divmod() [1/3]

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

◆ divmod() [2/3]

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

Division operator.

Parameters
ddivisor

◆ divmod() [3/3]

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

Division operator.

Parameters
ddivisor

◆ ceil() [1/2]

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)

◆ floor() [1/2]

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

same as std::floor(n/d)

◆ trunc() [1/2]

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

same as std::trunc(n/d)

◆ ceil() [2/2]

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)

◆ floor() [2/2]

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

same as std::floor(n/d)

◆ trunc() [2/2]

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

same as std::trunc(n/d)

◆ operator%() [1/8]

Integer operator% ( const Integer n) const

Modulo operator.

Parameters
nmodulus
Returns
remainder (*this) mod n

◆ operator%() [2/8]

int64_t operator% ( const uint64_t  n) const

Division operator.

Parameters
ddivisor

◆ operator%() [3/8]

int64_t operator% ( const int64_t  n) const

Division operator.

Parameters
ddivisor

◆ operator%() [4/8]

giv_all_inlined int32_t operator% ( const uint32_t  n) const
inline

Division operator.

Parameters
ddivisor

◆ operator%() [5/8]

giv_all_inlined int32_t operator% ( const int32_t  n) const
inline

Division operator.

Parameters
ddivisor

◆ operator%() [6/8]

double operator% ( const double  n) const

Division operator.

Parameters
ddivisor

◆ operator%() [7/8]

int16_t operator% ( const uint16_t  n) const
inline

Division operator.

Parameters
ddivisor

◆ operator%() [8/8]

XXX operator% ( const XXX &  n) const
inline

Division operator.

Parameters
ddivisor

◆ operator%=() [1/6]

Integer & operator%= ( const Integer n)

Modulo operator (inplace).

Parameters
nmodulus
Returns
remainder (*this) <- (*this) mod n

◆ operator%=() [2/6]

Integer & operator%= ( const uint64_t  n)

Division operator.

Parameters
ddivisor

◆ operator%=() [3/6]

Integer & operator%= ( const int64_t  n)

Division operator.

Parameters
ddivisor

◆ operator%=() [4/6]

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

Division operator.

Parameters
ddivisor

◆ operator%=() [5/6]

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

Division operator.

Parameters
ddivisor

◆ operator%=() [6/6]

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

Division operator.

Parameters
ddivisor

◆ size_in_base()

size_t size_in_base ( int32_t  B) const

returns ceil(log_BASE(*this)).


◆ bitsize()

size_t bitsize ( ) const

returns ceil(log_2(*this)) .


◆ operator[]()

uint64_t operator[] ( size_t  i) const

return the i-th word of the integer.

Word 0 is lowest word.

◆ random_lessthan()

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.

◆ print()

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

print32_t integer.

Parameters
ooutput stream.

Friends And Related Function Documentation

◆ compare

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.

◆ absCompare [1/8]

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.

◆ absCompare [2/8]

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

Compares two integers.

Parameters
ainteger
binteger
Returns
1 if $a > b$, 0 if $a = b$ and -1 otherwise.

◆ absCompare [3/8]

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

Compares two integers.

Parameters
ainteger
binteger
Returns
1 if $a > b$, 0 if $a = b$ and -1 otherwise.

◆ absCompare [4/8]

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

Compares two integers.

Parameters
ainteger
binteger
Returns
1 if $a > b$, 0 if $a = b$ and -1 otherwise.

◆ absCompare [5/8]

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

Compares two integers.

Parameters
ainteger
binteger
Returns
1 if $a > b$, 0 if $a = b$ and -1 otherwise.

◆ absCompare [6/8]

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

Compares two integers.

Parameters
ainteger
binteger
Returns
1 if $a > b$, 0 if $a = b$ and -1 otherwise.

◆ absCompare [7/8]

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

Compares two integers.

Parameters
ainteger
binteger
Returns
1 if $a > b$, 0 if $a = b$ and -1 otherwise.

◆ absCompare [8/8]

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

Compares two integers.

Parameters
ainteger
binteger
Returns
1 if $a > b$, 0 if $a = b$ and -1 otherwise.

◆ isOne

giv_all_inlined int32_t isOne ( const Integer a)
friend

name compare to 1 and 0

Parameters
a

◆ isMOne

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.

◆ nonZero

giv_all_inlined int32_t nonZero ( const Integer a)
friend

name compare to 1 and 0

Parameters
a

◆ isZero [1/7]

giv_all_inlined int32_t isZero ( const Integer a)
friend

name compare to 1 and 0

Parameters
a

◆ isZero [2/7]

giv_all_inlined int32_t isZero ( const int16_t  a)
friend

Compares two integers.

Parameters
ainteger
binteger
Returns
1 if $a > b$, 0 if $a = b$ and -1 otherwise.

◆ isZero [3/7]

giv_all_inlined int32_t isZero ( const int32_t  a)
friend

Compares two integers.

Parameters
ainteger
binteger
Returns
1 if $a > b$, 0 if $a = b$ and -1 otherwise.

◆ isZero [4/7]

giv_all_inlined int32_t isZero ( const int64_t  a)
friend

Compares two integers.

Parameters
ainteger
binteger
Returns
1 if $a > b$, 0 if $a = b$ and -1 otherwise.

◆ isZero [5/7]

giv_all_inlined int32_t isZero ( const uint16_t  a)
friend

Compares two integers.

Parameters
ainteger
binteger
Returns
1 if $a > b$, 0 if $a = b$ and -1 otherwise.

◆ isZero [6/7]

giv_all_inlined int32_t isZero ( const uint32_t  a)
friend

Compares two integers.

Parameters
ainteger
binteger
Returns
1 if $a > b$, 0 if $a = b$ and -1 otherwise.

◆ isZero [7/7]

giv_all_inlined int32_t isZero ( const uint64_t  a)
friend

Compares two integers.

Parameters
ainteger
binteger
Returns
1 if $a > b$, 0 if $a = b$ and -1 otherwise.

◆ operator>= [1/6]

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

greater or equal.

Parameters
l,nintegers to compare

◆ operator>= [2/6]

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

greater or equal.

Parameters
linteger to be compared to

◆ operator>= [3/6]

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

greater or equal.

Parameters
linteger to be compared to

◆ operator>= [4/6]

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

greater or equal.

Parameters
linteger to be compared to

◆ operator>= [5/6]

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

greater or equal.

Parameters
linteger to be compared to

◆ operator>= [6/6]

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

greater or equal.

Parameters
linteger to be compared to

◆ operator<= [1/6]

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

less or equal

Parameters
l,nintegers to compare

◆ operator<= [2/6]

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

greater or equal.

Parameters
linteger to be compared to

◆ operator<= [3/6]

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

greater or equal.

Parameters
linteger to be compared to

◆ operator<= [4/6]

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

greater or equal.

Parameters
linteger to be compared to

◆ operator<= [5/6]

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

greater or equal.

Parameters
linteger to be compared to

◆ operator<= [6/6]

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

greater or equal.

Parameters
linteger to be compared to

◆ operator!= [1/6]

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

◆ operator!= [2/6]

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

greater or equal.

Parameters
linteger to be compared to

◆ operator!= [3/6]

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

greater or equal.

Parameters
linteger to be compared to

◆ operator!= [4/6]

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

greater or equal.

Parameters
linteger to be compared to

◆ operator!= [5/6]

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

greater or equal.

Parameters
linteger to be compared to

◆ operator!= [6/6]

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

greater or equal.

Parameters
linteger to be compared to

◆ operator== [1/6]

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

Equality.

Parameters
l,nintegers to compare

◆ operator== [2/6]

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

greater or equal.

Parameters
linteger to be compared to

◆ operator== [3/6]

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

greater or equal.

Parameters
linteger to be compared to

◆ operator== [4/6]

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

greater or equal.

Parameters
linteger to be compared to

◆ operator== [5/6]

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

greater or equal.

Parameters
linteger to be compared to

◆ operator== [6/6]

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

greater or equal.

Parameters
linteger to be compared to

◆ operator> [1/6]

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

greater (strict)

Parameters
l,nintegers to compare

◆ operator> [2/6]

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

greater or equal.

Parameters
linteger to be compared to

◆ operator> [3/6]

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

greater or equal.

Parameters
linteger to be compared to

◆ operator> [4/6]

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

greater or equal.

Parameters
linteger to be compared to

◆ operator> [5/6]

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

greater or equal.

Parameters
linteger to be compared to

◆ operator> [6/6]

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

greater or equal.

Parameters
linteger to be compared to

◆ operator< [1/6]

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

less (strict)

Parameters
l,nintegers to compare

◆ operator< [2/6]

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

greater or equal.

Parameters
linteger to be compared to

◆ operator< [3/6]

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

greater or equal.

Parameters
linteger to be compared to

◆ operator< [4/6]

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

greater or equal.

Parameters
linteger to be compared to

◆ operator< [5/6]

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

greater or equal.

Parameters
linteger to be compared to

◆ operator< [6/6]

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

greater or equal.

Parameters
linteger to be compared to

◆ operator+ [1/4]

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

operator +.

Parameters
l,nto be added

◆ operator+ [2/4]

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

operator +.

Returns
(*this)+n
Parameters
nas in the formula.

◆ operator+ [3/4]

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

operator +.

Returns
(*this)+n
Parameters
nas in the formula.

◆ operator+ [4/4]

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

operator +.

Returns
(*this)+n
Parameters
nas in the formula.

◆ operator- [1/4]

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

operator -

Parameters
l,nto be substracted

◆ operator- [2/4]

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

operator +.

Returns
(*this)+n
Parameters
nas in the formula.

◆ operator- [3/4]

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

operator +.

Returns
(*this)+n
Parameters
nas in the formula.

◆ operator- [4/4]

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

operator +.

Returns
(*this)+n
Parameters
nas in the formula.

◆ operator* [1/4]

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

operator *

Parameters
l,nto be multpct

◆ operator* [2/4]

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

operator +.

Returns
(*this)+n
Parameters
nas in the formula.

◆ operator* [3/4]

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

operator +.

Returns
(*this)+n
Parameters
nas in the formula.

◆ operator* [4/4]

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

operator +.

Returns
(*this)+n
Parameters
nas in the formula.

◆ operator/ [1/2]

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

Division operator.

Parameters
ddivisor

◆ operator/ [2/2]

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

Division operator.

Parameters
ddivisor

◆ operator% [1/4]

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

operator %

Parameters
l
n
Returns
nl

◆ operator% [2/4]

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

Division operator.

Parameters
ddivisor

◆ operator% [3/4]

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

Division operator.

Parameters
ddivisor

◆ operator% [4/4]

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

Division operator.

Parameters
ddivisor

◆ gcd [1/4]

gcd ( const Integer a,
const Integer b 
)
friend

gcd.

Parameters
a,bintegers
Returns
gcd(a,b)

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

◆ gcd [2/4]

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

gcd.

Parameters
a,bintegers
Returns
gcd(a,b)

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

◆ gcd [3/4]

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

gcd.

Parameters
a,bintegers
Returns
gcd(a,b)

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

◆ gcd [4/4]

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

gcd.

Parameters
a,bintegers
Returns
gcd(a,b)

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

◆ inv

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

◆ invin

giv_all_inlined Integer& invin ( Integer u,
const Integer b 
)
friend

Compute the inverse inplace u = u/b.

Parameters
u
b

◆ pp

giv_all_inlined Integer pp ( const Integer P,
const Integer Q 
)
friend

pp

Parameters
P,Qparams

◆ lcm [1/2]

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

lcm

Parameters
g,a,b
Returns
g=lcm(a,b)

◆ lcm [2/2]

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

lcm

Parameters
a,b

◆ pow [1/9]

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

pow.

return $n^l$

Parameters
Res,n,l

◆ pow [2/9]

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

gcd.

Parameters
a,bintegers
Returns
gcd(a,b)

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

◆ pow [3/9]

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

gcd.

Parameters
a,bintegers
Returns
gcd(a,b)

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

◆ pow [4/9]

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

gcd.

Parameters
a,bintegers
Returns
gcd(a,b)

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

◆ pow [5/9]

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

gcd.

Parameters
a,bintegers
Returns
gcd(a,b)

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

◆ pow [6/9]

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

pow.

return $n^l$

Parameters
n,l

◆ pow [7/9]

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

gcd.

Parameters
a,bintegers
Returns
gcd(a,b)

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

◆ pow [8/9]

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

gcd.

Parameters
a,bintegers
Returns
gcd(a,b)

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

◆ pow [9/9]

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

gcd.

Parameters
a,bintegers
Returns
gcd(a,b)

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

◆ powmod

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

◆ fact

giv_all_inlined Integer fact ( uint64_t  l)
friend

fact

Parameters
l

◆ sqrt [1/2]

giv_all_inlined Integer sqrt ( const Integer p)
friend

(square) roots

Parameters
p

◆ sqrt [2/2]

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

(square) roots

Parameters
r,p

◆ sqrtrem [1/2]

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

(square) roots

Parameters
p,rem

◆ sqrtrem [2/2]

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

(square) roots

Parameters
r,p,rem

◆ root

giv_all_inlined bool root ( Integer q,
const Integer a,
uint32_t  n 
)
friend

(square) roots

Parameters
q,a,n

◆ logp

giv_all_inlined int64_t logp ( const Integer a,
const Integer p 
)
friend

logs

Parameters
a,p

◆ logtwo

giv_all_inlined double logtwo ( const Integer a)
friend

logs

Parameters
a

◆ naturallog

giv_all_inlined double naturallog ( const Integer a)
friend

logs

Parameters
a

◆ swap

giv_all_inlined void swap ( Integer a,
Integer b 
)
friend

swap

Parameters
a,b

◆ sign

int32_t sign ( const Integer a)
friend

sign

Parameters
a

◆ length

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"?

◆ isOdd

giv_all_inlined bool isOdd ( const Integer a)
friend

parity of an integer

Parameters
ainteger
Returns
1 if odd, 0 if even

◆ operator>>

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

◆ operator<<

giv_all_inlined std::ostream& operator<< ( std::ostream &  o,
const Integer n 
)
friend

out operator.

Parameters
ooutput stream
ninteger to be printed

◆ absOutput

giv_all_inlined std::ostream& absOutput ( std::ostream &  o,
const Integer n 
)
friend

nodoc

Parameters
ooutput
ninteger

◆ Protected::importWords

giv_all_inlined void Protected::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

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