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 Integer & | operator%= (const Integer &n) |
| Modulo operator (inplace).
|
|
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.
|
|
giv_all_inlined Integer & | operator= (const Integer &n) |
giv_all_inlined Integer & | logcpy (const Integer &n) |
giv_all_inlined Integer & | copy (const Integer &n) |
|
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 Integer & | operator^= (const Integer &) |
giv_all_inlined Integer & | operator|= (const Integer &) |
giv_all_inlined Integer & | operator&= (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 Integer & | operator<<= (int l) |
giv_all_inlined Integer & | operator>>= (int l) |
giv_all_inlined Integer & | operator<<= (long l) |
giv_all_inlined Integer & | operator>>= (long l) |
giv_all_inlined Integer & | operator<<= (unsigned int l) |
giv_all_inlined Integer & | operator>>= (unsigned int l) |
giv_all_inlined Integer & | operator<<= (unsigned long l) |
giv_all_inlined Integer & | operator>>= (unsigned long l) |
Static Public Member Functions |
|
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 Integer & | axpy (Integer &res, const Integer &a, const Integer &x, const Integer &y) |
| axpy res = ax+y .
|
static giv_all_inlined Integer & | axpy (Integer &res, const Integer &a, const unsigned long x, const Integer &y) |
| axpy res = ax+y .
|
static giv_all_inlined Integer & | axpyin (Integer &res, const Integer &a, const Integer &x) |
| axpyin (inplace) res += ax .
|
static giv_all_inlined Integer & | axpyin (Integer &res, const Integer &a, const unsigned long x) |
| axpy res = ax+y .
|
static giv_all_inlined Integer & | maxpy (Integer &res, const Integer &a, const Integer &x, const Integer &y) |
| maxpy res = y - ax .
|
static giv_all_inlined Integer & | maxpy (Integer &res, const Integer &a, const unsigned long x, const Integer &y) |
| axpy res = ax+y .
|
static giv_all_inlined Integer & | maxpyin (Integer &res, const Integer &a, const Integer &x) |
| maxpyin res -= ax .
|
static giv_all_inlined Integer & | maxpyin (Integer &res, const Integer &a, const unsigned long x) |
| axpy res = ax+y .
|
static giv_all_inlined Integer & | axmy (Integer &res, const Integer &a, const Integer &x, const Integer &y) |
| axmy res = ax - y .
|
static giv_all_inlined Integer & | axmy (Integer &res, const Integer &a, const unsigned long x, const Integer &y) |
| axpy res = ax+y .
|
static giv_all_inlined Integer & | axmyin (Integer &res, const Integer &a, const Integer &x) |
| axmyin (in place) res = ax - res .
|
static giv_all_inlined Integer & | axmyin (Integer &res, const Integer &a, const unsigned long x) |
| axpy res = ax+y .
|
|
these are the same as the STL ones, except for the signature.
- Parameters:
-
res | the result |
n | the numerator |
d | the demominator |
|
static giv_all_inlined Integer & | ceil (Integer &res, const Integer &n, const Integer &d) |
static giv_all_inlined Integer & | floor (Integer &res, const Integer &n, const Integer &d) |
static giv_all_inlined Integer & | trunc (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) |
|
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 Integer & | random_lessthan (Integer &r, const Integer &m) |
| returns a random integer r in the intervall [[0, m-1]]
|
static Integer & | random_lessthan (Integer &r, const Integer &m) |
| returns a random integer r in the intervall [[0, m-1]]
|
template<bool U> |
static Integer & | random_lessthan_2exp (Integer &r, const unsigned long &m) |
| returns a random integer r of at most m bits
|
static Integer & | random_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 Integer & | random_lessthan (Integer &r, const unsigned long &m) |
| returns a random integer r in the intervall [[0, m-1]]
|
static Integer & | random_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 Integer & | random_exact_2exp (Integer &r, const unsigned long int &m) |
| returns a reference to a random number r of the size m bits, exactly.
|
static Integer & | random_exact_2exp (Integer &r, const unsigned long int &m) |
| returns a random integer r in the intervall [[0, m-1]]
|
template<bool U> |
static Integer & | random_exact (Integer &r, const Integer &s) |
| returns a reference to a random number r of the size of s , exactly.
|
static Integer & | random_exact (Integer &r, const Integer &s) |
| returns a random integer r in the intervall [[0, m-1]]
|
template<bool U> |
static Integer & | random_exact (Integer &r, const unsigned long int &m) |
| returns a random integer r in the intervall [[0, m-1]]
|
static Integer & | random_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 Integer & | random_exact (Integer &r, const T &m) |
| returns a random integer r in the intervall [[0, m-1]]
|
template<class T > |
static Integer & | random_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 Integer & | random_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 Integer & | random_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 Integer & | random_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 Integer & | random_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 Integer & | random (Integer &r, const T &m) |
| returns a random integer less than...
|
template<class T > |
static Integer & | random (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 Integer & | nonzerorandom (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 Integer & | nonzerorandom (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 |
|
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 Integer & | gcd (Integer &g, const Integer &a, const Integer &b) |
giv_all_inlined Integer & | gcd (Integer &g, Integer &u, Integer &v, const Integer &a, const Integer &b) |
giv_all_inlined Integer & | inv (Integer &u, const Integer &a, const Integer &b) |
giv_all_inlined Integer & | invin (Integer &u, const Integer &b) |
giv_all_inlined Integer | pp (const Integer &P, const Integer &Q) |
giv_all_inlined Integer & | lcm (Integer &g, const Integer &a, const Integer &b) |
giv_all_inlined Integer | lcm (const Integer &a, const Integer &b) |
giv_all_inlined Integer & | pow (Integer &Res, const Integer &n, const long l) |
giv_all_inlined Integer & | pow (Integer &Res, const unsigned long n, const unsigned long l) |
giv_all_inlined Integer & | pow (Integer &Res, const Integer &n, const unsigned long l) |
giv_all_inlined Integer & | pow (Integer &Res, const Integer &n, const int l) |
giv_all_inlined Integer & | pow (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 Integer & | powmod (Integer &Res, const Integer &n, const unsigned long e, const Integer &m) |
giv_all_inlined Integer & | powmod (Integer &Res, const Integer &n, const long e, const Integer &m) |
giv_all_inlined Integer & | powmod (Integer &Res, const Integer &n, const unsigned int e, const Integer &m) |
giv_all_inlined Integer & | powmod (Integer &Res, const Integer &n, const int e, const Integer &m) |
giv_all_inlined Integer & | powmod (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 Integer & | sqrt (Integer &r, const Integer &p) |
giv_all_inlined Integer & | sqrtrem (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 Integer & | operator+= (const Integer &n) |
| operator += .
|
giv_all_inlined Integer & | operator+= (const unsigned long n) |
| operator + .
|
giv_all_inlined Integer & | operator+= (const long n) |
| operator + .
|
template<class XXX > |
Integer & | operator+= (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 Integer & | operator-= (const Integer &n) |
| operator -= .
|
giv_all_inlined Integer & | operator-= (const unsigned long n) |
| operator + .
|
giv_all_inlined Integer & | operator-= (const long n) |
| operator + .
|
template<class XXX > |
Integer & | operator-= (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 Integer & | operator*= (const Integer &n) |
| operator *= .
|
giv_all_inlined Integer & | operator*= (const unsigned long n) |
| operator + .
|
giv_all_inlined Integer & | operator*= (const long n) |
| operator + .
|
template<class XXX > |
Integer & | operator*= (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 Integer & | operator+= (Integer &n, const int l) |
| operator + .
|
giv_all_inlined Integer & | operator+= (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 Integer & | operator-= (Integer &n, const int l) |
| operator + .
|
giv_all_inlined Integer & | operator-= (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 Integer & | operator*= (Integer &n, const int l) |
| operator + .
|
giv_all_inlined Integer & | operator*= (Integer &n, const unsigned int l) |
| operator + .
|
static giv_all_inlined Integer & | addin (Integer &res, const Integer &n) |
| Addition (inplace) res+=n .
|
static giv_all_inlined Integer & | addin (Integer &res, const long n) |
| operator + .
|
static giv_all_inlined Integer & | addin (Integer &res, const unsigned long n) |
| operator + .
|
static giv_all_inlined Integer & | add (Integer &res, const Integer &n1, const Integer &n2) |
| Addition res=n1+n2 .
|
static giv_all_inlined Integer & | add (Integer &res, const Integer &n1, const long n2) |
| operator + .
|
static giv_all_inlined Integer & | add (Integer &res, const Integer &n1, const unsigned long n2) |
| operator + .
|
static giv_all_inlined Integer & | subin (Integer &res, const Integer &n) |
| Substraction (inplace) res-=n .
|
static giv_all_inlined Integer & | subin (Integer &res, const long n) |
| operator + .
|
static giv_all_inlined Integer & | subin (Integer &res, const unsigned long n) |
| operator + .
|
static giv_all_inlined Integer & | sub (Integer &res, const Integer &n1, const Integer &n2) |
| Substraction res=n1-n2 .
|
static giv_all_inlined Integer & | sub (Integer &res, const Integer &n1, const long n2) |
| operator + .
|
static giv_all_inlined Integer & | sub (Integer &res, const Integer &n1, const unsigned long n2) |
| operator + .
|
static giv_all_inlined Integer & | negin (Integer &res) |
| Negation (inplace) res=-res .
|
static giv_all_inlined Integer & | neg (Integer &res, const Integer &n) |
| Negation res=-n .
|
static giv_all_inlined Integer & | mulin (Integer &res, const Integer &n) |
| Multiplication (inplace) res*=n .
|
static giv_all_inlined Integer & | mulin (Integer &res, const long n) |
| operator + .
|
static giv_all_inlined Integer & | mulin (Integer &res, const unsigned long n) |
| operator + .
|
static giv_all_inlined Integer & | mul (Integer &res, const Integer &n1, const Integer &n2) |
| Multiplication res=n1*n2 .
|
static giv_all_inlined Integer & | mul (Integer &res, const Integer &n1, const long n2) |
| operator + .
|
static giv_all_inlined Integer & | mul (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 :
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 :
- 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 Integer & | operator/= (const Integer &d) |
| Division operator (inplace).
|
giv_all_inlined Integer & | operator/= (const unsigned long d) |
| Division operator.
|
giv_all_inlined Integer & | operator/= (const long d) |
| Division operator.
|
template<class XXX > |
Integer & | operator/= (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 Integer & | operator/= (Integer &n, const int l) |
| Division operator.
|
giv_all_inlined Integer & | operator/= (Integer &n, const long l) |
| Division operator.
|
giv_all_inlined Integer & | operator/= (Integer &n, const unsigned int l) |
| Division operator.
|
static giv_all_inlined Integer & | divin (Integer &q, const Integer &d) |
| Division q/=d .
|
static giv_all_inlined Integer & | divin (Integer &q, const long d) |
| Division operator.
|
static giv_all_inlined Integer & | divin (Integer &q, const unsigned long d) |
| Division operator.
|
static giv_all_inlined Integer & | div (Integer &q, const Integer &n, const Integer &d) |
| Division q=n/d .
|
static giv_all_inlined Integer & | div (Integer &q, const Integer &n, const long d) |
| Division operator.
|
static giv_all_inlined Integer & | div (Integer &q, const Integer &n, const int d) |
| Division operator.
|
static giv_all_inlined Integer & | div (Integer &q, const Integer &n, const unsigned long d) |
| Division operator.
|
static giv_all_inlined Integer & | divexact (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 Integer & | modin (Integer &r, const Integer &n) |
| Function mod (inplace).
|
static giv_all_inlined Integer & | modin (Integer &r, const long n) |
| Division operator.
|
static giv_all_inlined Integer & | modin (Integer &r, const unsigned long n) |
| Division operator.
|
static giv_all_inlined Integer & | mod (Integer &r, const Integer &n, const Integer &d) |
| Function mod .
|
static giv_all_inlined Integer & | mod (Integer &r, const Integer &n, const long d) |
| Division operator.
|
static giv_all_inlined Integer & | mod (Integer &r, const Integer &n, const unsigned long d) |
| Division operator.
|
static giv_all_inlined Integer & | divmod (Integer &q, Integer &r, const Integer &n, const Integer &d) |
| Euclidean division.
|
static giv_all_inlined Integer & | divmod (Integer &q, long &r, const Integer &n, const long d) |
| Division operator.
|
static giv_all_inlined Integer & | divmod (Integer &q, unsigned long &r, const Integer &n, const unsigned long d) |
| Division operator.
|
Miscellaneous. |
Integer & | operator++ () |
Integer | operator++ (int) |
Integer & | operator-- () |
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 Integer & | prevprime (Integer &, const Integer &p) |
giv_all_inlined Integer & | nextprime (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 *) |