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

This is the Integer class. More...

#include <gmp++_int.h>

Public Types

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

Public Member Functions

giv_all_inlined Integer operator% (const Integer &n) const
 Modulo operator.
giv_all_inlined Integeroperator%= (const Integer &n)
 Modulo operator (inplace).
Constructor/Destructors
giv_all_inlined Integer (const std::vector< mp_limb_t > &vect_t)
 Creates a new Integer.
giv_all_inlined Integer (int n=0)
 Creates a new Integer.
giv_all_inlined Integer (long n)
 Creates a new Integer.
giv_all_inlined Integer (unsigned char n)
 Creates a new Integer.
giv_all_inlined Integer (unsigned int n)
 Creates a new Integer.
giv_all_inlined Integer (unsigned long n)
 Creates a new Integer.
giv_all_inlined Integer (unsigned long *d, long sz)
 Creates a new Integer.
giv_all_inlined Integer (double d)
 Creates a new Integer.
giv_all_inlined Integer (const char *s)
 Creates a new Integer.
giv_all_inlined Integer (const Integer &n)
 Creates a new Integer.
giv_all_inlined ~Integer ()
 Creates a new Integer.
Assignment and copy operators
giv_all_inlined Integeroperator= (const Integer &n)
giv_all_inlined Integerlogcpy (const Integer &n)
giv_all_inlined Integercopy (const Integer &n)
Bit logic
giv_all_inlined Integer operator^ (const Integer &) const
giv_all_inlined Integer operator| (const Integer &) const
giv_all_inlined Integer operator& (const Integer &) const
giv_all_inlined unsigned long operator^ (const unsigned long &a) const
giv_all_inlined unsigned long operator| (const unsigned long &a) const
giv_all_inlined unsigned long operator& (const unsigned long &a) const
giv_all_inlined Integer operator~ () const
giv_all_inlined Integeroperator^= (const Integer &)
giv_all_inlined Integeroperator|= (const Integer &)
giv_all_inlined Integeroperator&= (const Integer &)
giv_all_inlined Integer operator<< (int l) const
giv_all_inlined Integer operator>> (int l) const
giv_all_inlined Integer operator<< (long l) const
giv_all_inlined Integer operator>> (long l) const
giv_all_inlined Integer operator<< (unsigned int l) const
giv_all_inlined Integer operator>> (unsigned int l) const
giv_all_inlined Integer operator<< (unsigned long l) const
giv_all_inlined Integer operator>> (unsigned long l) const
giv_all_inlined Integeroperator<<= (int l)
giv_all_inlined Integeroperator>>= (int l)
giv_all_inlined Integeroperator<<= (long l)
giv_all_inlined Integeroperator>>= (long l)
giv_all_inlined Integeroperator<<= (unsigned int l)
giv_all_inlined Integeroperator>>= (unsigned int l)
giv_all_inlined Integeroperator<<= (unsigned long l)
giv_all_inlined Integeroperator>>= (unsigned long l)

Static Public Member Functions

fused add-multiply

Groups a multiplication adn an addition/division is a single function.

This is usually faster than doing the two operations separately.

static giv_all_inlined Integeraxpy (Integer &res, const Integer &a, const Integer &x, const Integer &y)
 axpy res = ax+y.
static giv_all_inlined Integeraxpy (Integer &res, const Integer &a, const unsigned long x, const Integer &y)
 axpy res = ax+y.
static giv_all_inlined Integeraxpyin (Integer &res, const Integer &a, const Integer &x)
 axpyin (inplace) res += ax.
static giv_all_inlined Integeraxpyin (Integer &res, const Integer &a, const unsigned long x)
 axpy res = ax+y.
static giv_all_inlined Integermaxpy (Integer &res, const Integer &a, const Integer &x, const Integer &y)
 maxpy res = y - ax.
static giv_all_inlined Integermaxpy (Integer &res, const Integer &a, const unsigned long x, const Integer &y)
 axpy res = ax+y.
static giv_all_inlined Integermaxpyin (Integer &res, const Integer &a, const Integer &x)
 maxpyin res -= ax.
static giv_all_inlined Integermaxpyin (Integer &res, const Integer &a, const unsigned long x)
 axpy res = ax+y.
static giv_all_inlined Integeraxmy (Integer &res, const Integer &a, const Integer &x, const Integer &y)
 axmy res = ax - y.
static giv_all_inlined Integeraxmy (Integer &res, const Integer &a, const unsigned long x, const Integer &y)
 axpy res = ax+y.
static giv_all_inlined Integeraxmyin (Integer &res, const Integer &a, const Integer &x)
 axmyin (in place) res = ax - res.
static giv_all_inlined Integeraxmyin (Integer &res, const Integer &a, const unsigned long x)
 axpy res = ax+y.
rounding function

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

Parameters:
resthe result
nthe numerator
dthe demominator
static giv_all_inlined Integerceil (Integer &res, const Integer &n, const Integer &d)
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)
static giv_all_inlined Integer floor (const Integer &n, const Integer &d)
static giv_all_inlined Integer trunc (const Integer &n, const Integer &d)
Random numbers functions
static void seeding (unsigned long int s)
 returns a random integer r in the intervall [[0, m-1]]
static void seeding (Integer s)
 returns a random integer r in the intervall [[0, m-1]]
static void seeding ()
 returns a random integer r in the intervall [[0, m-1]]
static bool RandBool ()
 returns a random integer r in the intervall [[0, m-1]]
template<bool U>
static Integerrandom_lessthan (Integer &r, const Integer &m)
 returns a random integer r in the intervall [[0, m-1]]
static Integerrandom_lessthan (Integer &r, const Integer &m)
 returns a random integer r in the intervall [[0, m-1]]
template<bool U>
static Integerrandom_lessthan_2exp (Integer &r, const unsigned long &m)
 returns a random integer r of at most m bits
static Integerrandom_lessthan_2exp (Integer &r, const unsigned long &m)
 returns a random integer r in the intervall [[0, m-1]]
template<bool U>
static Integer random_lessthan_2exp (const unsigned long &m)
 returns a random integer r in the intervall [[0, m-1]]
static Integer random_lessthan_2exp (const unsigned long &m)
 returns a random integer r in the intervall [[0, m-1]]
template<bool U>
static Integerrandom_lessthan (Integer &r, const unsigned long &m)
 returns a random integer r in the intervall [[0, m-1]]
static Integerrandom_lessthan (Integer &r, const unsigned long &m)
 returns a random integer r in the intervall [[0, m-1]]
template<bool U, class T >
static Integer random_lessthan (const T &m)
 returns a random integer r in the intervall [[0, m-1]]
template<class T >
static Integer random_lessthan (const T &m)
 returns a random integer r in the intervall [[0, m-1]]
template<bool U>
static Integerrandom_exact_2exp (Integer &r, const unsigned long int &m)
 returns a reference to a random number r of the size m bits, exactly.
static Integerrandom_exact_2exp (Integer &r, const unsigned long int &m)
 returns a random integer r in the intervall [[0, m-1]]
template<bool U>
static Integerrandom_exact (Integer &r, const Integer &s)
 returns a reference to a random number r of the size of s, exactly.
static Integerrandom_exact (Integer &r, const Integer &s)
 returns a random integer r in the intervall [[0, m-1]]
template<bool U>
static Integerrandom_exact (Integer &r, const unsigned long int &m)
 returns a random integer r in the intervall [[0, m-1]]
static Integerrandom_exact (Integer &r, const unsigned long int &m)
 returns a random integer r in the intervall [[0, m-1]]
template<bool U, class T >
static Integerrandom_exact (Integer &r, const T &m)
 returns a random integer r in the intervall [[0, m-1]]
template<class T >
static Integerrandom_exact (Integer &r, const T &m)
 returns a random integer r in the intervall [[0, m-1]]
template<bool U, class T >
static Integer random_exact (const T &s)
 returns a random integer r in the intervall [[0, m-1]]
template<class T >
static Integer random_exact (const T &s)
 returns a random integer r in the intervall [[0, m-1]]
static Integerrandom_between (Integer &r, const Integer &m, const Integer &M)
 returns a random integer r in the intervall [[0, m-1]]
static Integer random_between (const Integer &m, const Integer &M)
 returns a random integer r in the intervall [[0, m-1]]
static Integerrandom_between_2exp (Integer &r, const unsigned long int &m, const unsigned long int &M)
 returns a random integer r in the intervall [[0, m-1]]
static Integerrandom_between (Integer &r, const unsigned long int &m, const unsigned long int &M)
 returns a random integer r in the intervall [[0, m-1]]
static Integer random_between_2exp (const unsigned long int &m, const unsigned long int &M)
 returns a random integer r in the intervall [[0, m-1]]
static Integer random_between (const unsigned long int &m, const unsigned long int &M)
 returns a random integer r in the intervall [[0, m-1]]
template<class R >
static Integer random_between (const R &m, const R &M)
 returns a random integer r in the intervall [[0, m-1]]
template<class R >
static Integerrandom_between (Integer &r, const R &m, const R &M)
 returns a random integer r in the intervall [[0, m-1]]
template<bool U, class T >
static Integerrandom (Integer &r, const T &m)
 returns a random integer less than...
template<class T >
static Integerrandom (Integer &r, const T &m)
 returns a random integer r in the intervall [[0, m-1]]
template<bool U, class T >
static Integer random (const T &sz)
 returns a random integer less than...
template<class T >
static Integer random (const T &sz)
 returns a random integer r in the intervall [[0, m-1]]
template<bool U>
static Integer random ()
 returns a random integer r in the intervall [[0, m-1]]
static Integer random ()
 returns a random integer r in the intervall [[0, m-1]]
template<bool U, class T >
static Integer nonzerorandom (const T &sz)
 returns a random integer r in the intervall [[0, m-1]]
template<bool U, class T >
static Integernonzerorandom (Integer &r, const T &size)
 returns a random integer r in the intervall [[0, m-1]]
template<class T >
static Integer nonzerorandom (const T &sz)
 returns a random integer r in the intervall [[0, m-1]]
template<class T >
static Integernonzerorandom (Integer &r, const T &size)
 returns a random integer r in the intervall [[0, m-1]]
static Integer nonzerorandom ()
 returns a random integer r in the intervall [[0, m-1]]

Static Public Attributes

static const Integer zero
 zero
static const Integer one
 one

Friends

Arithmetic functions
giv_all_inlined Integer gcd (const Integer &a, const Integer &b)
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)
giv_all_inlined Integerinvin (Integer &u, const Integer &b)
giv_all_inlined Integer pp (const Integer &P, const Integer &Q)
giv_all_inlined Integerlcm (Integer &g, const Integer &a, const Integer &b)
giv_all_inlined Integer lcm (const Integer &a, const Integer &b)
giv_all_inlined Integerpow (Integer &Res, const Integer &n, const long l)
giv_all_inlined Integerpow (Integer &Res, const unsigned long n, const unsigned long l)
giv_all_inlined Integerpow (Integer &Res, const Integer &n, const unsigned long l)
giv_all_inlined Integerpow (Integer &Res, const Integer &n, const int l)
giv_all_inlined Integerpow (Integer &Res, const Integer &n, const unsigned int l)
giv_all_inlined Integer pow (const Integer &n, const long l)
giv_all_inlined Integer pow (const Integer &n, const unsigned long l)
giv_all_inlined Integer pow (const Integer &n, const int l)
giv_all_inlined Integer pow (const Integer &n, const unsigned int l)
giv_all_inlined Integerpowmod (Integer &Res, const Integer &n, const unsigned long e, const Integer &m)
giv_all_inlined Integerpowmod (Integer &Res, const Integer &n, const long e, const Integer &m)
giv_all_inlined Integerpowmod (Integer &Res, const Integer &n, const unsigned int e, const Integer &m)
giv_all_inlined Integerpowmod (Integer &Res, const Integer &n, const int 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 unsigned long e, const Integer &m)
giv_all_inlined Integer powmod (const Integer &n, const long e, const Integer &m)
giv_all_inlined Integer powmod (const Integer &n, const unsigned int e, const Integer &m)
giv_all_inlined Integer powmod (const Integer &n, const int e, const Integer &m)
giv_all_inlined Integer powmod (const Integer &n, const Integer &e, const Integer &m)
giv_all_inlined Integer fact (unsigned long l)
giv_all_inlined Integer sqrt (const Integer &p)
giv_all_inlined Integer sqrtrem (const Integer &p, Integer &rem)
giv_all_inlined Integersqrt (Integer &r, const Integer &p)
giv_all_inlined Integersqrtrem (Integer &r, const Integer &p, Integer &rem)
giv_all_inlined bool root (Integer &q, const Integer &, unsigned int n)
giv_all_inlined long logp (const Integer &a, const Integer &p)
giv_all_inlined double logtwo (const Integer &a)
giv_all_inlined double naturallog (const Integer &a)

(in)equality

giv_all_inlined int operator>= (const Integer &l) const
 operator != (not equal)
giv_all_inlined int operator>= (const int l) const
 operator != (not equal)
giv_all_inlined int operator>= (const long l) const
 operator != (not equal)
giv_all_inlined int operator>= (const unsigned long l) const
 operator != (not equal)
giv_all_inlined int operator>= (const unsigned l) const
 operator != (not equal)
giv_all_inlined int operator>= (const double l) const
 operator != (not equal)
giv_all_inlined int operator>= (const float l) const
 operator != (not equal)
giv_all_inlined int operator<= (const Integer &l) const
 operator != (not equal)
giv_all_inlined int operator<= (const int l) const
 operator != (not equal)
giv_all_inlined int operator<= (const long l) const
 operator != (not equal)
giv_all_inlined int operator<= (const unsigned long l) const
 operator != (not equal)
giv_all_inlined int operator<= (const unsigned l) const
 operator != (not equal)
giv_all_inlined int operator<= (const double l) const
 operator != (not equal)
giv_all_inlined int operator<= (const float l) const
 operator != (not equal)
giv_all_inlined int operator!= (const Integer &l) const
 operator != (not equal)
giv_all_inlined int operator!= (const int l) const
 operator != (not equal)
giv_all_inlined int operator!= (const long l) const
 operator != (not equal)
giv_all_inlined int operator!= (const unsigned long l) const
 operator != (not equal)
giv_all_inlined int operator!= (const unsigned l) const
 operator != (not equal)
giv_all_inlined int operator!= (const double l) const
 operator != (not equal)
giv_all_inlined int operator!= (const float l) const
 operator != (not equal)
giv_all_inlined int operator== (const Integer &l) const
 operator != (not equal)
giv_all_inlined int operator== (const int l) const
 operator != (not equal)
giv_all_inlined int operator== (const long l) const
 operator != (not equal)
giv_all_inlined int operator== (const unsigned long l) const
 operator != (not equal)
giv_all_inlined int operator== (const unsigned l) const
 operator != (not equal)
giv_all_inlined int operator== (const double l) const
 operator != (not equal)
giv_all_inlined int operator== (const float l) const
 operator != (not equal)
giv_all_inlined int operator> (const Integer &l) const
 operator != (not equal)
giv_all_inlined int operator> (const int l) const
 operator != (not equal)
giv_all_inlined int operator> (const long l) const
 operator != (not equal)
giv_all_inlined int operator> (const unsigned long l) const
 operator != (not equal)
giv_all_inlined int operator> (const unsigned l) const
 operator != (not equal)
giv_all_inlined int operator> (const double l) const
 operator != (not equal)
giv_all_inlined int operator> (const float l) const
 operator != (not equal)
giv_all_inlined int operator< (const Integer &l) const
 operator != (not equal)
giv_all_inlined int operator< (const int l) const
 operator != (not equal)
giv_all_inlined int operator< (const long l) const
 operator != (not equal)
giv_all_inlined int operator< (const unsigned long l) const
 operator != (not equal)
giv_all_inlined int operator< (const unsigned l) const
 operator != (not equal)
giv_all_inlined int operator< (const double l) const
 operator != (not equal)
giv_all_inlined int operator< (const float l) const
 operator != (not equal)
giv_all_inlined friend int compare (const Integer &a, const Integer &b)
 Compares two integers.
giv_all_inlined friend int absCompare (const Integer &a, const Integer &b)
 Compare the norm of two integers.
giv_all_inlined friend int absCompare (const Integer &a, const double d)
 operator != (not equal)
giv_all_inlined friend int absCompare (const Integer &a, const float d)
 operator != (not equal)
giv_all_inlined friend int absCompare (const Integer &a, const unsigned long u)
 operator != (not equal)
giv_all_inlined friend int absCompare (const Integer &a, const unsigned u)
 operator != (not equal)
giv_all_inlined friend int absCompare (const Integer &a, const long int u)
 operator != (not equal)
giv_all_inlined friend int absCompare (const Integer &a, const int u)
 operator != (not equal)
template<class T >
giv_all_inlined friend int absCompare (const T a, const Integer &b)
 operator != (not equal)
giv_all_inlined friend int operator>= (float l, const Integer &n)
 operator != (not equal)
giv_all_inlined friend int operator>= (double l, const Integer &n)
 operator != (not equal)
giv_all_inlined friend int operator>= (int l, const Integer &n)
 operator != (not equal)
giv_all_inlined friend int operator>= (long l, const Integer &n)
 operator != (not equal)
giv_all_inlined friend int operator>= (unsigned l, const Integer &n)
 operator != (not equal)
giv_all_inlined friend int operator>= (unsigned long l, const Integer &n)
 operator != (not equal)
giv_all_inlined friend int operator<= (float l, const Integer &n)
 operator != (not equal)
giv_all_inlined friend int operator<= (double l, const Integer &n)
 operator != (not equal)
giv_all_inlined friend int operator<= (int l, const Integer &n)
 operator != (not equal)
giv_all_inlined friend int operator<= (long l, const Integer &n)
 operator != (not equal)
giv_all_inlined friend int operator<= (unsigned l, const Integer &n)
 operator != (not equal)
giv_all_inlined friend int operator<= (unsigned long l, const Integer &n)
 operator != (not equal)
giv_all_inlined friend int operator!= (float l, const Integer &n)
 operator != (not equal)
giv_all_inlined friend int operator!= (double l, const Integer &n)
 operator != (not equal)
giv_all_inlined friend int operator!= (int l, const Integer &n)
 operator != (not equal)
giv_all_inlined friend int operator!= (long l, const Integer &n)
 operator != (not equal)
giv_all_inlined friend int operator!= (unsigned l, const Integer &n)
 operator != (not equal)
giv_all_inlined friend int operator!= (unsigned long l, const Integer &n)
 operator != (not equal)
giv_all_inlined friend int operator== (float l, const Integer &n)
 operator != (not equal)
giv_all_inlined friend int operator== (double l, const Integer &n)
 operator != (not equal)
giv_all_inlined friend int operator== (int l, const Integer &n)
 operator != (not equal)
giv_all_inlined friend int operator== (long l, const Integer &n)
 operator != (not equal)
giv_all_inlined friend int operator== (unsigned l, const Integer &n)
 operator != (not equal)
giv_all_inlined friend int operator== (unsigned long l, const Integer &n)
 operator != (not equal)
giv_all_inlined friend int operator> (float l, const Integer &n)
 operator != (not equal)
giv_all_inlined friend int operator> (double l, const Integer &n)
 operator != (not equal)
giv_all_inlined friend int operator> (int l, const Integer &n)
 operator != (not equal)
giv_all_inlined friend int operator> (long l, const Integer &n)
 operator != (not equal)
giv_all_inlined friend int operator> (unsigned l, const Integer &n)
 operator != (not equal)
giv_all_inlined friend int operator> (unsigned long l, const Integer &n)
 operator != (not equal)
giv_all_inlined friend int operator< (float l, const Integer &n)
 operator != (not equal)
giv_all_inlined friend int operator< (double l, const Integer &n)
 operator != (not equal)
giv_all_inlined friend int operator< (int l, const Integer &n)
 operator != (not equal)
giv_all_inlined friend int operator< (long l, const Integer &n)
 operator != (not equal)
giv_all_inlined friend int operator< (unsigned l, const Integer &n)
 operator != (not equal)
giv_all_inlined friend int operator< (unsigned long l, const Integer &n)
 operator != (not equal)

Addition, substraction, multiplication

giv_all_inlined Integer operator+ (const Integer &n) const
 operator +.
giv_all_inlined Integer operator+ (const unsigned long n) const
 operator +.
giv_all_inlined Integer operator+ (const long n) const
 operator +.
giv_all_inlined Integeroperator+= (const Integer &n)
 operator += .
giv_all_inlined Integeroperator+= (const unsigned long n)
 operator +.
giv_all_inlined Integeroperator+= (const long n)
 operator +.
template<class XXX >
Integeroperator+= (const XXX &n)
 operator +.
giv_all_inlined Integer operator- (const Integer &n) const
 operator -.
giv_all_inlined Integer operator- (const unsigned long n) const
 operator +.
giv_all_inlined Integer operator- (const long n) const
 operator +.
giv_all_inlined Integeroperator-= (const Integer &n)
 operator -= .
giv_all_inlined Integeroperator-= (const unsigned long n)
 operator +.
giv_all_inlined Integeroperator-= (const long n)
 operator +.
template<class XXX >
Integeroperator-= (const XXX &n)
 operator +.
giv_all_inlined Integer operator- () const
 Opposite.
giv_all_inlined Integer operator* (const Integer &n) const
 operator *.
giv_all_inlined Integer operator* (const unsigned long n) const
 operator +.
giv_all_inlined Integer operator* (const long n) const
 operator +.
giv_all_inlined Integeroperator*= (const Integer &n)
 operator *= .
giv_all_inlined Integeroperator*= (const unsigned long n)
 operator +.
giv_all_inlined Integeroperator*= (const long n)
 operator +.
template<class XXX >
Integeroperator*= (const XXX &n)
 operator +.
giv_all_inlined Integer operator+ (const int l, const Integer &n)
 operator +.
giv_all_inlined Integer operator+ (const unsigned int l, const Integer &n)
 operator +.
giv_all_inlined Integer operator+ (const long l, const Integer &n)
 operator +.
giv_all_inlined Integer operator+ (const unsigned long l, const Integer &n)
 operator +.
giv_all_inlined Integer operator+ (const Integer &n, const int l)
 operator +.
giv_all_inlined Integer operator+ (const Integer &n, const unsigned int l)
 operator +.
giv_all_inlined Integeroperator+= (Integer &n, const int l)
 operator +.
giv_all_inlined Integeroperator+= (Integer &n, const unsigned int l)
 operator +.
giv_all_inlined Integer operator- (const int l, const Integer &n)
 operator +.
giv_all_inlined Integer operator- (const unsigned int l, const Integer &n)
 operator +.
giv_all_inlined Integer operator- (const long l, const Integer &n)
 operator +.
giv_all_inlined Integer operator- (const unsigned long l, const Integer &n)
 operator +.
giv_all_inlined Integer operator- (const Integer &n, const int l)
 operator +.
giv_all_inlined Integer operator- (const Integer &n, const unsigned int l)
 operator +.
giv_all_inlined Integeroperator-= (Integer &n, const int l)
 operator +.
giv_all_inlined Integeroperator-= (Integer &n, const unsigned int l)
 operator +.
giv_all_inlined Integer operator* (const int l, const Integer &n)
 operator +.
giv_all_inlined Integer operator* (const unsigned int l, const Integer &n)
 operator +.
giv_all_inlined Integer operator* (const long l, const Integer &n)
 operator +.
giv_all_inlined Integer operator* (const unsigned long l, const Integer &n)
 operator +.
giv_all_inlined Integer operator* (const Integer &n, const int l)
 operator +.
giv_all_inlined Integer operator* (const Integer &n, const unsigned int l)
 operator +.
giv_all_inlined Integeroperator*= (Integer &n, const int l)
 operator +.
giv_all_inlined Integeroperator*= (Integer &n, const unsigned int l)
 operator +.
static giv_all_inlined Integeraddin (Integer &res, const Integer &n)
 Addition (inplace) res+=n.
static giv_all_inlined Integeraddin (Integer &res, const long n)
 operator +.
static giv_all_inlined Integeraddin (Integer &res, const unsigned long n)
 operator +.
static giv_all_inlined Integeradd (Integer &res, const Integer &n1, const Integer &n2)
 Addition res=n1+n2.
static giv_all_inlined Integeradd (Integer &res, const Integer &n1, const long n2)
 operator +.
static giv_all_inlined Integeradd (Integer &res, const Integer &n1, const unsigned long n2)
 operator +.
static giv_all_inlined Integersubin (Integer &res, const Integer &n)
 Substraction (inplace) res-=n.
static giv_all_inlined Integersubin (Integer &res, const long n)
 operator +.
static giv_all_inlined Integersubin (Integer &res, const unsigned long n)
 operator +.
static giv_all_inlined Integersub (Integer &res, const Integer &n1, const Integer &n2)
 Substraction res=n1-n2.
static giv_all_inlined Integersub (Integer &res, const Integer &n1, const long n2)
 operator +.
static giv_all_inlined Integersub (Integer &res, const Integer &n1, const unsigned long n2)
 operator +.
static giv_all_inlined Integernegin (Integer &res)
 Negation (inplace) res=-res.
static giv_all_inlined Integerneg (Integer &res, const Integer &n)
 Negation res=-n.
static giv_all_inlined Integermulin (Integer &res, const Integer &n)
 Multiplication (inplace) res*=n.
static giv_all_inlined Integermulin (Integer &res, const long n)
 operator +.
static giv_all_inlined Integermulin (Integer &res, const unsigned long n)
 operator +.
static giv_all_inlined Integermul (Integer &res, const Integer &n1, const Integer &n2)
 Multiplication res=n1*n2.
static giv_all_inlined Integermul (Integer &res, const Integer &n1, const long n2)
 operator +.
static giv_all_inlined Integermul (Integer &res, const Integer &n1, const unsigned long n2)
 operator +.

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.
giv_all_inlined Integer operator/ (const unsigned long d) const
 Division operator.
giv_all_inlined Integer operator/ (const long d) const
 Division operator.
giv_all_inlined Integeroperator/= (const Integer &d)
 Division operator (inplace).
giv_all_inlined Integeroperator/= (const unsigned long d)
 Division operator.
giv_all_inlined Integeroperator/= (const long d)
 Division operator.
template<class XXX >
Integeroperator/= (const XXX &d)
 Division operator.
giv_all_inlined Integer operator/ (const int l, const Integer &n)
 Division operator.
giv_all_inlined Integer operator/ (const long l, const Integer &n)
 Division operator.
giv_all_inlined Integer operator/ (const Integer &n, const int l)
 Division operator.
giv_all_inlined Integer operator/ (const Integer &n, const unsigned int l)
 Division operator.
giv_all_inlined Integeroperator/= (Integer &n, const int l)
 Division operator.
giv_all_inlined Integeroperator/= (Integer &n, const long l)
 Division operator.
giv_all_inlined Integeroperator/= (Integer &n, const unsigned int l)
 Division operator.
static giv_all_inlined Integerdivin (Integer &q, const Integer &d)
 Division q/=d.
static giv_all_inlined Integerdivin (Integer &q, const long d)
 Division operator.
static giv_all_inlined Integerdivin (Integer &q, const unsigned long d)
 Division operator.
static giv_all_inlined Integerdiv (Integer &q, const Integer &n, const Integer &d)
 Division q=n/d.
static giv_all_inlined Integerdiv (Integer &q, const Integer &n, const long d)
 Division operator.
static giv_all_inlined Integerdiv (Integer &q, const Integer &n, const int d)
 Division operator.
static giv_all_inlined Integerdiv (Integer &q, const Integer &n, const unsigned long d)
 Division operator.
static giv_all_inlined Integerdivexact (Integer &q, const Integer &n, const Integer &d)
 Division when d divides n.
static giv_all_inlined Integer divexact (const Integer &n, const Integer &d)
 Division when d divides n.
static giv_all_inlined Integermodin (Integer &r, const Integer &n)
 Function mod (inplace).
static giv_all_inlined Integermodin (Integer &r, const long n)
 Division operator.
static giv_all_inlined Integermodin (Integer &r, const unsigned long n)
 Division operator.
static giv_all_inlined Integermod (Integer &r, const Integer &n, const Integer &d)
 Function mod.
static giv_all_inlined Integermod (Integer &r, const Integer &n, const long d)
 Division operator.
static giv_all_inlined Integermod (Integer &r, const Integer &n, const unsigned long d)
 Division operator.
static giv_all_inlined Integerdivmod (Integer &q, Integer &r, const Integer &n, const Integer &d)
 Euclidean division.
static giv_all_inlined Integerdivmod (Integer &q, long &r, const Integer &n, const long d)
 Division operator.
static giv_all_inlined Integerdivmod (Integer &q, unsigned long &r, const Integer &n, const unsigned long d)
 Division operator.

Miscellaneous.

Integeroperator++ ()
Integer operator++ (int)
Integeroperator-- ()
Integer operator-- (int)
giv_all_inlined size_t size () const
giv_all_inlined size_t size_in_base (int B) const
giv_all_inlined size_t bitsize () const
giv_all_inlined unsigned long operator[] (size_t i) const
 operator bool () const
 operator short () const
 operator unsigned short () const
 operator unsigned char () const
giv_all_inlined operator unsigned int () const
giv_all_inlined operator int () const
 operator signed char () const
giv_all_inlined operator unsigned long () const
giv_all_inlined operator long () const
giv_all_inlined operator unsigned long long () const
giv_all_inlined operator long long () 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
giv_all_inlined void swap (Integer &, Integer &)
int sign (const Integer &a)
giv_all_inlined int isOne (const Integer &a)
giv_all_inlined int isZero (const Integer &a)
giv_all_inlined int nonZero (const Integer &a)
giv_all_inlined int isZero (const short int a)
giv_all_inlined int isZero (const int a)
giv_all_inlined int isZero (const long a)
giv_all_inlined int isZero (const unsigned short int a)
giv_all_inlined int isZero (const unsigned int a)
giv_all_inlined int isZero (const unsigned long a)
giv_all_inlined int isperfectpower (const Integer &)
giv_all_inlined Integer abs (const Integer &n)
giv_all_inlined Integerprevprime (Integer &, const Integer &p)
giv_all_inlined Integernextprime (Integer &, const Integer &p)
giv_all_inlined int probab_prime (const Integer &p)
giv_all_inlined int probab_prime (const Integer &p, int r)
giv_all_inlined int jacobi (const Integer &u, const Integer &v)
giv_all_inlined int legendre (const Integer &u, const Integer &v)
giv_all_inlined unsigned long length (const Integer &a)

I/O

giv_all_inlined std::ostream & print (std::ostream &o) const
giv_all_inlined std::istream & operator>> (std::istream &i, Integer &n)
giv_all_inlined std::ostream & operator<< (std::ostream &o, const Integer &n)
giv_all_inlined std::ostream & absOutput (std::ostream &o, const Integer &n)
giv_all_inlined void importWords (Integer &, size_t, int, int, int, size_t, const void *)

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 ( const std::vector< mp_limb_t > &  vect_t)

Creates a new Integer.

Parameters:
szsize
darray
Integer ( int  n = 0)

Creates a new Integer.

Parameters:
szsize
darray
Integer ( long  n)

Creates a new Integer.

Parameters:
szsize
darray
Integer ( unsigned char  n)

Creates a new Integer.

Parameters:
szsize
darray
Integer ( unsigned int  n)

Creates a new Integer.

Parameters:
szsize
darray
Integer ( unsigned long  n)

Creates a new Integer.

Parameters:
szsize
darray
giv_all_inlined Integer ( unsigned long *  d,
long  sz 
)

Creates a new Integer.

Parameters:
szsize
darray
Integer ( double  d)

Creates a new Integer.

Parameters:
szsize
darray
Integer ( const char *  s)

Creates a new Integer.

Parameters:
szsize
darray
Integer ( const Integer n)

Creates a new Integer.

Parameters:
szsize
darray
~Integer ( )

Creates a new Integer.

Parameters:
szsize
darray

Member Function Documentation

int operator>= ( const Integer l) const

operator != (not equal)

Parameters:
linteger
Returns:
1 iff l == this
int operator>= ( const int  l) const

operator != (not equal)

Parameters:
linteger
Returns:
1 iff l == this
int operator>= ( const long  l) const

operator != (not equal)

Parameters:
linteger
Returns:
1 iff l == this
int operator>= ( const unsigned long  l) const

operator != (not equal)

Parameters:
linteger
Returns:
1 iff l == this
int operator>= ( const unsigned  l) const

operator != (not equal)

Parameters:
linteger
Returns:
1 iff l == this
int operator>= ( const double  l) const

operator != (not equal)

Parameters:
linteger
Returns:
1 iff l == this
int operator>= ( const float  l) const

operator != (not equal)

Parameters:
linteger
Returns:
1 iff l == this
int operator<= ( const Integer l) const

operator != (not equal)

Parameters:
linteger
Returns:
1 iff l == this
int operator<= ( const int  l) const

operator != (not equal)

Parameters:
linteger
Returns:
1 iff l == this
int operator<= ( const long  l) const

operator != (not equal)

Parameters:
linteger
Returns:
1 iff l == this
int operator<= ( const unsigned long  l) const

operator != (not equal)

Parameters:
linteger
Returns:
1 iff l == this
int operator<= ( const unsigned  l) const

operator != (not equal)

Parameters:
linteger
Returns:
1 iff l == this
int operator<= ( const double  l) const

operator != (not equal)

Parameters:
linteger
Returns:
1 iff l == this
int operator<= ( const float  l) const

operator != (not equal)

Parameters:
linteger
Returns:
1 iff l == this
int operator!= ( const Integer l) const

operator != (not equal)

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

operator != (not equal)

Parameters:
linteger
Returns:
1 iff l == this
int operator!= ( const long  l) const

operator != (not equal)

Parameters:
linteger
Returns:
1 iff l == this
int operator!= ( const unsigned long  l) const

operator != (not equal)

Parameters:
linteger
Returns:
1 iff l == this
int operator!= ( const unsigned  l) const

operator != (not equal)

Parameters:
linteger
Returns:
1 iff l == this
int operator!= ( const double  l) const

operator != (not equal)

Parameters:
linteger
Returns:
1 iff l == this
int operator!= ( const float  l) const

operator != (not equal)

Parameters:
linteger
Returns:
1 iff l == this
int operator== ( const Integer l) const

operator != (not equal)

Parameters:
linteger
Returns:
1 iff l == this
int operator== ( const int  l) const

operator != (not equal)

Parameters:
linteger
Returns:
1 iff l == this
int operator== ( const long  l) const

operator != (not equal)

Parameters:
linteger
Returns:
1 iff l == this
int operator== ( const unsigned long  l) const

operator != (not equal)

Parameters:
linteger
Returns:
1 iff l == this
int operator== ( const unsigned  l) const

operator != (not equal)

Parameters:
linteger
Returns:
1 iff l == this
int operator== ( const double  l) const

operator != (not equal)

Parameters:
linteger
Returns:
1 iff l == this
int operator== ( const float  l) const

operator != (not equal)

Parameters:
linteger
Returns:
1 iff l == this
int operator> ( const Integer l) const

operator != (not equal)

Parameters:
linteger
Returns:
1 iff l == this
int operator> ( const int  l) const

operator != (not equal)

Parameters:
linteger
Returns:
1 iff l == this
int operator> ( const long  l) const

operator != (not equal)

Parameters:
linteger
Returns:
1 iff l == this
int operator> ( const unsigned long  l) const

operator != (not equal)

Parameters:
linteger
Returns:
1 iff l == this
int operator> ( const unsigned  l) const

operator != (not equal)

Parameters:
linteger
Returns:
1 iff l == this
int operator> ( const double  l) const

operator != (not equal)

Parameters:
linteger
Returns:
1 iff l == this
int operator> ( const float  l) const

operator != (not equal)

Parameters:
linteger
Returns:
1 iff l == this
int operator< ( const Integer l) const

operator != (not equal)

Parameters:
linteger
Returns:
1 iff l == this
int operator< ( const int  l) const

operator != (not equal)

Parameters:
linteger
Returns:
1 iff l == this
int operator< ( const long  l) const

operator != (not equal)

Parameters:
linteger
Returns:
1 iff l == this
int operator< ( const unsigned long  l) const

operator != (not equal)

Parameters:
linteger
Returns:
1 iff l == this
int operator< ( const unsigned  l) const

operator != (not equal)

Parameters:
linteger
Returns:
1 iff l == this
int operator< ( const double  l) const

operator != (not equal)

Parameters:
linteger
Returns:
1 iff l == this
int operator< ( const float  l) const

operator != (not equal)

Parameters:
linteger
Returns:
1 iff l == this
Integer & addin ( Integer res,
const Integer n 
) [static]

Addition (inplace) res+=n.

Parameters:
resas in the formula
nas in the formula
Integer & addin ( Integer res,
const long  n 
) [static]

operator +.

Returns:
(*this)+n
Parameters:
nas in the formula.
Integer & addin ( Integer res,
const unsigned long  n 
) [static]

operator +.

Returns:
(*this)+n
Parameters:
nas in the formula.
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 long  n2 
) [static]

operator +.

Returns:
(*this)+n
Parameters:
nas in the formula.
Integer & add ( Integer res,
const Integer n1,
const unsigned long  n2 
) [static]

operator +.

Returns:
(*this)+n
Parameters:
nas in the formula.
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 long  n 
) [static]

operator +.

Returns:
(*this)+n
Parameters:
nas in the formula.
Integer & subin ( Integer res,
const unsigned long  n 
) [static]

operator +.

Returns:
(*this)+n
Parameters:
nas in the formula.
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
Integer & sub ( Integer res,
const Integer n1,
const long  n2 
) [static]

operator +.

Returns:
(*this)+n
Parameters:
nas in the formula.
Integer & sub ( Integer res,
const Integer n1,
const unsigned long  n2 
) [static]

operator +.

Returns:
(*this)+n
Parameters:
nas in the formula.
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 long  n 
) [static]

operator +.

Returns:
(*this)+n
Parameters:
nas in the formula.
Integer & mulin ( Integer res,
const unsigned long  n 
) [static]

operator +.

Returns:
(*this)+n
Parameters:
nas in the formula.
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/ilcm.C.
Integer & mul ( Integer res,
const Integer n1,
const long  n2 
) [static]

operator +.

Returns:
(*this)+n
Parameters:
nas in the formula.
Integer & mul ( Integer res,
const Integer n1,
const unsigned long  n2 
) [static]

operator +.

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

operator +.

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

operator +.

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

operator +.

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

operator += .

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

operator +.

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

operator +.

Returns:
(*this)+n
Parameters:
nas in the formula.
Integer& operator+= ( const XXX &  n) [inline]

operator +.

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

operator -.

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

operator +.

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

operator +.

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

operator -= .

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

operator +.

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

operator +.

Returns:
(*this)+n
Parameters:
nas in the formula.
Integer& operator-= ( const XXX &  n) [inline]

operator +.

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

Opposite.

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

operator *.

Returns:
(*this)*n
Parameters:
nas in the formula.
Integer operator* ( const unsigned long  n) const

operator +.

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

operator +.

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

operator *= .

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

operator +.

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

operator +.

Returns:
(*this)+n
Parameters:
nas in the formula.
Integer& operator*= ( const XXX &  n) [inline]

operator +.

Returns:
(*this)+n
Parameters:
nas in the formula.
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
static giv_all_inlined Integer& axpy ( Integer res,
const Integer a,
const unsigned long  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 & 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.
static giv_all_inlined Integer& axpyin ( Integer res,
const Integer a,
const unsigned long  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
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.
static giv_all_inlined Integer& maxpy ( Integer res,
const Integer a,
const unsigned long  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 & 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.
yIntegers as in the formula.
Integer & maxpyin ( Integer res,
const Integer a,
const unsigned long  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
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.
static giv_all_inlined Integer& axmy ( Integer res,
const Integer a,
const unsigned long  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 & 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 unsigned long  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
Integer & divin ( Integer q,
const Integer d 
) [static]

Division q/=d.

Parameters:
qquotient
ddivisor.
Returns:
q
Examples:
examples/Integer/ilcm.C.
Integer & divin ( Integer q,
const long  d 
) [static]

Division operator.

Parameters:
ddivisor
Integer & divin ( Integer q,
const unsigned long  d 
) [static]

Division operator.

Parameters:
ddivisor
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 long  d 
) [static]

Division operator.

Parameters:
ddivisor
Integer & div ( Integer q,
const Integer n,
const int  d 
) [static]

Division operator.

Parameters:
ddivisor
Integer & div ( Integer q,
const Integer n,
const unsigned long  d 
) [static]

Division operator.

Parameters:
ddivisor
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 ( 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 operator/ ( const Integer d) const

Division operator.

Parameters:
ddivisor
Integer operator/ ( const unsigned long  d) const

Division operator.

Parameters:
ddivisor
Integer operator/ ( const long  d) const

Division operator.

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

Division operator (inplace).

Parameters:
ddivisor
Integer & operator/= ( const unsigned long  d)

Division operator.

Parameters:
ddivisor
Integer & operator/= ( const long  d)

Division operator.

Parameters:
ddivisor
Integer& operator/= ( const XXX &  d) [inline]

Division operator.

Parameters:
ddivisor
Integer & modin ( Integer r,
const Integer n 
) [static]

Function mod (inplace).

$ r \gets r \mod n$

Parameters:
rremainder
nmodulus
Integer & modin ( Integer r,
const long  n 
) [static]

Division operator.

Parameters:
ddivisor
Integer & modin ( Integer r,
const unsigned long  n 
) [static]

Division operator.

Parameters:
ddivisor
Integer & mod ( Integer r,
const Integer n,
const Integer d 
) [static]

Function mod.

$ r \gets n \mod d$

Parameters:
rremainder
ninteger
dmodulus
Integer & mod ( Integer r,
const Integer n,
const long  d 
) [static]

Division operator.

Parameters:
ddivisor
Integer & mod ( Integer r,
const Integer n,
const unsigned long  d 
) [static]

Division operator.

Parameters:
ddivisor
Integer & divmod ( Integer q,
Integer r,
const Integer n,
const Integer d 
) [static]

Euclidean division.

n = d q + r .

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,
long &  r,
const Integer n,
const long  d 
) [static]

Division operator.

Parameters:
ddivisor
Integer & divmod ( Integer q,
unsigned long &  r,
const Integer n,
const unsigned long  d 
) [static]

Division operator.

Parameters:
ddivisor
Integer operator% ( const Integer n) const

Modulo operator.

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

Modulo operator (inplace).

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

Friends And Related Function Documentation

giv_all_inlined friend int 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 int 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 int absCompare ( const Integer a,
const double  d 
) [friend]

operator != (not equal)

Parameters:
linteger
Returns:
1 iff l == this
giv_all_inlined friend int absCompare ( const Integer a,
const float  d 
) [friend]

operator != (not equal)

Parameters:
linteger
Returns:
1 iff l == this
giv_all_inlined friend int absCompare ( const Integer a,
const unsigned long  u 
) [friend]

operator != (not equal)

Parameters:
linteger
Returns:
1 iff l == this
giv_all_inlined friend int absCompare ( const Integer a,
const unsigned  u 
) [friend]

operator != (not equal)

Parameters:
linteger
Returns:
1 iff l == this
giv_all_inlined friend int absCompare ( const Integer a,
const long int  u 
) [friend]

operator != (not equal)

Parameters:
linteger
Returns:
1 iff l == this
giv_all_inlined friend int absCompare ( const Integer a,
const int  u 
) [friend]

operator != (not equal)

Parameters:
linteger
Returns:
1 iff l == this
giv_all_inlined friend int absCompare ( const T  a,
const Integer b 
) [friend]

operator != (not equal)

Parameters:
linteger
Returns:
1 iff l == this
giv_all_inlined friend int operator>= ( float  l,
const Integer n 
) [friend]

operator != (not equal)

Parameters:
linteger
Returns:
1 iff l == this
giv_all_inlined friend int operator>= ( double  l,
const Integer n 
) [friend]

operator != (not equal)

Parameters:
linteger
Returns:
1 iff l == this
giv_all_inlined friend int operator>= ( int  l,
const Integer n 
) [friend]

operator != (not equal)

Parameters:
linteger
Returns:
1 iff l == this
giv_all_inlined friend int operator>= ( long  l,
const Integer n 
) [friend]

operator != (not equal)

Parameters:
linteger
Returns:
1 iff l == this
giv_all_inlined friend int operator>= ( unsigned  l,
const Integer n 
) [friend]

operator != (not equal)

Parameters:
linteger
Returns:
1 iff l == this
giv_all_inlined friend int operator>= ( unsigned long  l,
const Integer n 
) [friend]

operator != (not equal)

Parameters:
linteger
Returns:
1 iff l == this
giv_all_inlined friend int operator<= ( float  l,
const Integer n 
) [friend]

operator != (not equal)

Parameters:
linteger
Returns:
1 iff l == this
giv_all_inlined friend int operator<= ( double  l,
const Integer n 
) [friend]

operator != (not equal)

Parameters:
linteger
Returns:
1 iff l == this
giv_all_inlined friend int operator<= ( int  l,
const Integer n 
) [friend]

operator != (not equal)

Parameters:
linteger
Returns:
1 iff l == this
giv_all_inlined friend int operator<= ( long  l,
const Integer n 
) [friend]

operator != (not equal)

Parameters:
linteger
Returns:
1 iff l == this
giv_all_inlined friend int operator<= ( unsigned  l,
const Integer n 
) [friend]

operator != (not equal)

Parameters:
linteger
Returns:
1 iff l == this
giv_all_inlined friend int operator<= ( unsigned long  l,
const Integer n 
) [friend]

operator != (not equal)

Parameters:
linteger
Returns:
1 iff l == this
giv_all_inlined friend int operator!= ( float  l,
const Integer n 
) [friend]

operator != (not equal)

Parameters:
linteger
Returns:
1 iff l == this
giv_all_inlined friend int operator!= ( double  l,
const Integer n 
) [friend]

operator != (not equal)

Parameters:
linteger
Returns:
1 iff l == this
giv_all_inlined friend int operator!= ( int  l,
const Integer n 
) [friend]

operator != (not equal)

Parameters:
linteger
Returns:
1 iff l == this
giv_all_inlined friend int operator!= ( long  l,
const Integer n 
) [friend]

operator != (not equal)

Parameters:
linteger
Returns:
1 iff l == this
giv_all_inlined friend int operator!= ( unsigned  l,
const Integer n 
) [friend]

operator != (not equal)

Parameters:
linteger
Returns:
1 iff l == this
giv_all_inlined friend int operator!= ( unsigned long  l,
const Integer n 
) [friend]

operator != (not equal)

Parameters:
linteger
Returns:
1 iff l == this
giv_all_inlined friend int operator== ( float  l,
const Integer n 
) [friend]

operator != (not equal)

Parameters:
linteger
Returns:
1 iff l == this
giv_all_inlined friend int operator== ( double  l,
const Integer n 
) [friend]

operator != (not equal)

Parameters:
linteger
Returns:
1 iff l == this
giv_all_inlined friend int operator== ( int  l,
const Integer n 
) [friend]

operator != (not equal)

Parameters:
linteger
Returns:
1 iff l == this
giv_all_inlined friend int operator== ( long  l,
const Integer n 
) [friend]

operator != (not equal)

Parameters:
linteger
Returns:
1 iff l == this
giv_all_inlined friend int operator== ( unsigned  l,
const Integer n 
) [friend]

operator != (not equal)

Parameters:
linteger
Returns:
1 iff l == this
giv_all_inlined friend int operator== ( unsigned long  l,
const Integer n 
) [friend]

operator != (not equal)

Parameters:
linteger
Returns:
1 iff l == this
giv_all_inlined friend int operator> ( float  l,
const Integer n 
) [friend]

operator != (not equal)

Parameters:
linteger
Returns:
1 iff l == this
giv_all_inlined friend int operator> ( double  l,
const Integer n 
) [friend]

operator != (not equal)

Parameters:
linteger
Returns:
1 iff l == this
giv_all_inlined friend int operator> ( int  l,
const Integer n 
) [friend]

operator != (not equal)

Parameters:
linteger
Returns:
1 iff l == this
giv_all_inlined friend int operator> ( long  l,
const Integer n 
) [friend]

operator != (not equal)

Parameters:
linteger
Returns:
1 iff l == this
giv_all_inlined friend int operator> ( unsigned  l,
const Integer n 
) [friend]

operator != (not equal)

Parameters:
linteger
Returns:
1 iff l == this
giv_all_inlined friend int operator> ( unsigned long  l,
const Integer n 
) [friend]

operator != (not equal)

Parameters:
linteger
Returns:
1 iff l == this
giv_all_inlined friend int operator< ( float  l,
const Integer n 
) [friend]

operator != (not equal)

Parameters:
linteger
Returns:
1 iff l == this
giv_all_inlined friend int operator< ( double  l,
const Integer n 
) [friend]

operator != (not equal)

Parameters:
linteger
Returns:
1 iff l == this
giv_all_inlined friend int operator< ( int  l,
const Integer n 
) [friend]

operator != (not equal)

Parameters:
linteger
Returns:
1 iff l == this
giv_all_inlined friend int operator< ( long  l,
const Integer n 
) [friend]

operator != (not equal)

Parameters:
linteger
Returns:
1 iff l == this
giv_all_inlined friend int operator< ( unsigned  l,
const Integer n 
) [friend]

operator != (not equal)

Parameters:
linteger
Returns:
1 iff l == this
giv_all_inlined friend int operator< ( unsigned long  l,
const Integer n 
) [friend]

operator != (not equal)

Parameters:
linteger
Returns:
1 iff l == this
giv_all_inlined Integer operator+ ( const int  l,
const Integer n 
) [friend]

operator +.

Returns:
(*this)+n
Parameters:
nas in the formula.
giv_all_inlined Integer operator+ ( const unsigned int  l,
const Integer n 
) [friend]

operator +.

Returns:
(*this)+n
Parameters:
nas in the formula.
giv_all_inlined Integer operator+ ( const long  l,
const Integer n 
) [friend]

operator +.

Returns:
(*this)+n
Parameters:
nas in the formula.
giv_all_inlined Integer operator+ ( const unsigned long  l,
const Integer n 
) [friend]

operator +.

Returns:
(*this)+n
Parameters:
nas in the formula.
giv_all_inlined Integer operator+ ( const Integer n,
const int  l 
) [friend]

operator +.

Returns:
(*this)+n
Parameters:
nas in the formula.
giv_all_inlined Integer operator+ ( const Integer n,
const unsigned int  l 
) [friend]

operator +.

Returns:
(*this)+n
Parameters:
nas in the formula.
giv_all_inlined Integer& operator+= ( Integer n,
const int  l 
) [friend]

operator +.

Returns:
(*this)+n
Parameters:
nas in the formula.
giv_all_inlined Integer& operator+= ( Integer n,
const unsigned int  l 
) [friend]

operator +.

Returns:
(*this)+n
Parameters:
nas in the formula.
giv_all_inlined Integer operator- ( const int  l,
const Integer n 
) [friend]

operator +.

Returns:
(*this)+n
Parameters:
nas in the formula.
giv_all_inlined Integer operator- ( const unsigned int  l,
const Integer n 
) [friend]

operator +.

Returns:
(*this)+n
Parameters:
nas in the formula.
giv_all_inlined Integer operator- ( const long  l,
const Integer n 
) [friend]

operator +.

Returns:
(*this)+n
Parameters:
nas in the formula.
giv_all_inlined Integer operator- ( const unsigned long  l,
const Integer n 
) [friend]

operator +.

Returns:
(*this)+n
Parameters:
nas in the formula.
giv_all_inlined Integer operator- ( const Integer n,
const int  l 
) [friend]

operator +.

Returns:
(*this)+n
Parameters:
nas in the formula.
giv_all_inlined Integer operator- ( const Integer n,
const unsigned int  l 
) [friend]

operator +.

Returns:
(*this)+n
Parameters:
nas in the formula.
giv_all_inlined Integer& operator-= ( Integer n,
const int  l 
) [friend]

operator +.

Returns:
(*this)+n
Parameters:
nas in the formula.
giv_all_inlined Integer& operator-= ( Integer n,
const unsigned int  l 
) [friend]

operator +.

Returns:
(*this)+n
Parameters:
nas in the formula.
giv_all_inlined Integer operator* ( const int  l,
const Integer n 
) [friend]

operator +.

Returns:
(*this)+n
Parameters:
nas in the formula.
giv_all_inlined Integer operator* ( const unsigned int  l,
const Integer n 
) [friend]

operator +.

Returns:
(*this)+n
Parameters:
nas in the formula.
giv_all_inlined Integer operator* ( const long  l,
const Integer n 
) [friend]

operator +.

Returns:
(*this)+n
Parameters:
nas in the formula.
giv_all_inlined Integer operator* ( const unsigned long  l,
const Integer n 
) [friend]

operator +.

Returns:
(*this)+n
Parameters:
nas in the formula.
giv_all_inlined Integer operator* ( const Integer n,
const int  l 
) [friend]

operator +.

Returns:
(*this)+n
Parameters:
nas in the formula.
giv_all_inlined Integer operator* ( const Integer n,
const unsigned int  l 
) [friend]

operator +.

Returns:
(*this)+n
Parameters:
nas in the formula.
giv_all_inlined Integer& operator*= ( Integer n,
const int  l 
) [friend]

operator +.

Returns:
(*this)+n
Parameters:
nas in the formula.
giv_all_inlined Integer& operator*= ( Integer n,
const unsigned int  l 
) [friend]

operator +.

Returns:
(*this)+n
Parameters:
nas in the formula.
giv_all_inlined Integer operator/ ( const int  l,
const Integer n 
) [friend]

Division operator.

Parameters:
ddivisor
giv_all_inlined Integer operator/ ( const long  l,
const Integer n 
) [friend]

Division operator.

Parameters:
ddivisor
giv_all_inlined Integer operator/ ( const Integer n,
const int  l 
) [friend]

Division operator.

Parameters:
ddivisor
giv_all_inlined Integer operator/ ( const Integer n,
const unsigned int  l 
) [friend]

Division operator.

Parameters:
ddivisor
giv_all_inlined Integer& operator/= ( Integer n,
const int  l 
) [friend]

Division operator.

Parameters:
ddivisor
giv_all_inlined Integer& operator/= ( Integer n,
const long  l 
) [friend]

Division operator.

Parameters:
ddivisor
giv_all_inlined Integer& operator/= ( Integer n,
const unsigned int  l 
) [friend]

Division operator.

Parameters:
ddivisor

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