netfilter
firewalling, NAT, and packet mangling for linux
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
mini-gmp.c File Reference
#include <assert.h>
#include <ctype.h>
#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "mini-gmp.h"
Include dependency graph for mini-gmp.c:

Data Structures

struct  gmp_div_inverse
 
struct  mpn_base_info
 

Macros

#define GMP_LIMB_BITS   (sizeof(mp_limb_t) * CHAR_BIT)
 
#define GMP_LIMB_MAX   (~ (mp_limb_t) 0)
 
#define GMP_LIMB_HIGHBIT   ((mp_limb_t) 1 << (GMP_LIMB_BITS - 1))
 
#define GMP_HLIMB_BIT   ((mp_limb_t) 1 << (GMP_LIMB_BITS / 2))
 
#define GMP_LLIMB_MASK   (GMP_HLIMB_BIT - 1)
 
#define GMP_ULONG_BITS   (sizeof(unsigned long) * CHAR_BIT)
 
#define GMP_ULONG_HIGHBIT   ((unsigned long) 1 << (GMP_ULONG_BITS - 1))
 
#define GMP_ABS(x)   ((x) >= 0 ? (x) : -(x))
 
#define GMP_NEG_CAST(T, x)   (-((T)((x) + 1) - 1))
 
#define GMP_MIN(a, b)   ((a) < (b) ? (a) : (b))
 
#define GMP_MAX(a, b)   ((a) > (b) ? (a) : (b))
 
#define gmp_assert_nocarry(x)
 
#define gmp_clz(count, x)
 
#define gmp_ctz(count, x)
 
#define gmp_add_ssaaaa(sh, sl, ah, al, bh, bl)
 
#define gmp_sub_ddmmss(sh, sl, ah, al, bh, bl)
 
#define gmp_umul_ppmm(w1, w0, u, v)
 
#define gmp_udiv_qrnnd_preinv(q, r, nh, nl, d, di)
 
#define gmp_udiv_qr_3by2(q, r1, r0, n2, n1, n0, d1, d0, dinv)
 
#define MP_LIMB_T_SWAP(x, y)
 
#define MP_SIZE_T_SWAP(x, y)
 
#define MP_BITCNT_T_SWAP(x, y)
 
#define MP_PTR_SWAP(x, y)
 
#define MP_SRCPTR_SWAP(x, y)
 
#define MPN_PTR_SWAP(xp, xs, yp, ys)
 
#define MPN_SRCPTR_SWAP(xp, xs, yp, ys)
 
#define MPZ_PTR_SWAP(x, y)
 
#define MPZ_SRCPTR_SWAP(x, y)
 
#define gmp_xalloc(size)   ((*gmp_allocate_func)((size)))
 
#define gmp_free(p)   ((*gmp_free_func) ((p), 0))
 
#define mpn_zero_p(xp, n)   (mpn_normalized_size ((xp), (n)) == 0)
 
#define MPZ_REALLOC(z, n)
 
#define GMP_PRIME_PRODUCT   (3UL*5UL*7UL*11UL*13UL*17UL*19UL*23UL*29UL)
 
#define GMP_PRIME_MASK   0xc96996dcUL
 

Enumerations

enum  mpz_div_round_mode {
  GMP_DIV_FLOOR,
  GMP_DIV_CEIL,
  GMP_DIV_TRUNC
}
 

Functions

void mp_get_memory_functions (void *(**alloc_func)(size_t), void *(**realloc_func)(void *, size_t, size_t), void(**free_func)(void *, size_t))
 
void mp_set_memory_functions (void *(*alloc_func)(size_t), void *(*realloc_func)(void *, size_t, size_t), void(*free_func)(void *, size_t))
 
void mpn_copyi (mp_ptr d, mp_srcptr s, mp_size_t n)
 
void mpn_copyd (mp_ptr d, mp_srcptr s, mp_size_t n)
 
int mpn_cmp (mp_srcptr ap, mp_srcptr bp, mp_size_t n)
 
void mpn_zero (mp_ptr rp, mp_size_t n)
 
mp_limb_t mpn_add_1 (mp_ptr rp, mp_srcptr ap, mp_size_t n, mp_limb_t b)
 
mp_limb_t mpn_add_n (mp_ptr rp, mp_srcptr ap, mp_srcptr bp, mp_size_t n)
 
mp_limb_t mpn_add (mp_ptr rp, mp_srcptr ap, mp_size_t an, mp_srcptr bp, mp_size_t bn)
 
mp_limb_t mpn_sub_1 (mp_ptr rp, mp_srcptr ap, mp_size_t n, mp_limb_t b)
 
mp_limb_t mpn_sub_n (mp_ptr rp, mp_srcptr ap, mp_srcptr bp, mp_size_t n)
 
mp_limb_t mpn_sub (mp_ptr rp, mp_srcptr ap, mp_size_t an, mp_srcptr bp, mp_size_t bn)
 
mp_limb_t mpn_mul_1 (mp_ptr rp, mp_srcptr up, mp_size_t n, mp_limb_t vl)
 
mp_limb_t mpn_addmul_1 (mp_ptr rp, mp_srcptr up, mp_size_t n, mp_limb_t vl)
 
mp_limb_t mpn_submul_1 (mp_ptr rp, mp_srcptr up, mp_size_t n, mp_limb_t vl)
 
mp_limb_t mpn_mul (mp_ptr rp, mp_srcptr up, mp_size_t un, mp_srcptr vp, mp_size_t vn)
 
void mpn_mul_n (mp_ptr rp, mp_srcptr ap, mp_srcptr bp, mp_size_t n)
 
void mpn_sqr (mp_ptr rp, mp_srcptr ap, mp_size_t n)
 
mp_limb_t mpn_lshift (mp_ptr rp, mp_srcptr up, mp_size_t n, unsigned int cnt)
 
mp_limb_t mpn_rshift (mp_ptr rp, mp_srcptr up, mp_size_t n, unsigned int cnt)
 
mp_bitcnt_t mpn_scan1 (mp_srcptr ptr, mp_bitcnt_t bit)
 
mp_bitcnt_t mpn_scan0 (mp_srcptr ptr, mp_bitcnt_t bit)
 
mp_limb_t mpn_invert_3by2 (mp_limb_t u1, mp_limb_t u0)
 
size_t mpn_get_str (unsigned char *sp, int base, mp_ptr up, mp_size_t un)
 
mp_size_t mpn_set_str (mp_ptr rp, const unsigned char *sp, size_t sn, int base)
 
void mpz_init (mpz_t r)
 
void mpz_init2 (mpz_t r, mp_bitcnt_t bits)
 
void mpz_clear (mpz_t r)
 
void mpz_set_si (mpz_t r, signed long int x)
 
void mpz_set_ui (mpz_t r, unsigned long int x)
 
void mpz_set (mpz_t r, const mpz_t x)
 
void mpz_init_set_si (mpz_t r, signed long int x)
 
void mpz_init_set_ui (mpz_t r, unsigned long int x)
 
void mpz_init_set (mpz_t r, const mpz_t x)
 
int mpz_fits_slong_p (const mpz_t u)
 
int mpz_fits_ulong_p (const mpz_t u)
 
long int mpz_get_si (const mpz_t u)
 
unsigned long int mpz_get_ui (const mpz_t u)
 
size_t mpz_size (const mpz_t u)
 
mp_limb_t mpz_getlimbn (const mpz_t u, mp_size_t n)
 
void mpz_realloc2 (mpz_t x, mp_bitcnt_t n)
 
mp_srcptr mpz_limbs_read (mpz_srcptr x)
 
mp_ptr mpz_limbs_modify (mpz_t x, mp_size_t n)
 
mp_ptr mpz_limbs_write (mpz_t x, mp_size_t n)
 
void mpz_limbs_finish (mpz_t x, mp_size_t xs)
 
mpz_srcptr mpz_roinit_n (mpz_t x, mp_srcptr xp, mp_size_t xs)
 
void mpz_set_d (mpz_t r, double x)
 
void mpz_init_set_d (mpz_t r, double x)
 
double mpz_get_d (const mpz_t u)
 
int mpz_cmpabs_d (const mpz_t x, double d)
 
int mpz_cmp_d (const mpz_t x, double d)
 
int mpz_sgn (const mpz_t u)
 
int mpz_cmp_si (const mpz_t u, long v)
 
int mpz_cmp_ui (const mpz_t u, unsigned long v)
 
int mpz_cmp (const mpz_t a, const mpz_t b)
 
int mpz_cmpabs_ui (const mpz_t u, unsigned long v)
 
int mpz_cmpabs (const mpz_t u, const mpz_t v)
 
void mpz_abs (mpz_t r, const mpz_t u)
 
void mpz_neg (mpz_t r, const mpz_t u)
 
void mpz_swap (mpz_t u, mpz_t v)
 
void mpz_add_ui (mpz_t r, const mpz_t a, unsigned long b)
 
void mpz_sub_ui (mpz_t r, const mpz_t a, unsigned long b)
 
void mpz_ui_sub (mpz_t r, unsigned long a, const mpz_t b)
 
void mpz_add (mpz_t r, const mpz_t a, const mpz_t b)
 
void mpz_sub (mpz_t r, const mpz_t a, const mpz_t b)
 
void mpz_mul_si (mpz_t r, const mpz_t u, long int v)
 
void mpz_mul_ui (mpz_t r, const mpz_t u, unsigned long int v)
 
void mpz_mul (mpz_t r, const mpz_t u, const mpz_t v)
 
void mpz_mul_2exp (mpz_t r, const mpz_t u, mp_bitcnt_t bits)
 
void mpz_addmul_ui (mpz_t r, const mpz_t u, unsigned long int v)
 
void mpz_submul_ui (mpz_t r, const mpz_t u, unsigned long int v)
 
void mpz_addmul (mpz_t r, const mpz_t u, const mpz_t v)
 
void mpz_submul (mpz_t r, const mpz_t u, const mpz_t v)
 
void mpz_cdiv_qr (mpz_t q, mpz_t r, const mpz_t n, const mpz_t d)
 
void mpz_fdiv_qr (mpz_t q, mpz_t r, const mpz_t n, const mpz_t d)
 
void mpz_tdiv_qr (mpz_t q, mpz_t r, const mpz_t n, const mpz_t d)
 
void mpz_cdiv_q (mpz_t q, const mpz_t n, const mpz_t d)
 
void mpz_fdiv_q (mpz_t q, const mpz_t n, const mpz_t d)
 
void mpz_tdiv_q (mpz_t q, const mpz_t n, const mpz_t d)
 
void mpz_cdiv_r (mpz_t r, const mpz_t n, const mpz_t d)
 
void mpz_fdiv_r (mpz_t r, const mpz_t n, const mpz_t d)
 
void mpz_tdiv_r (mpz_t r, const mpz_t n, const mpz_t d)
 
void mpz_mod (mpz_t r, const mpz_t n, const mpz_t d)
 
void mpz_cdiv_q_2exp (mpz_t r, const mpz_t u, mp_bitcnt_t cnt)
 
void mpz_fdiv_q_2exp (mpz_t r, const mpz_t u, mp_bitcnt_t cnt)
 
void mpz_tdiv_q_2exp (mpz_t r, const mpz_t u, mp_bitcnt_t cnt)
 
void mpz_cdiv_r_2exp (mpz_t r, const mpz_t u, mp_bitcnt_t cnt)
 
void mpz_fdiv_r_2exp (mpz_t r, const mpz_t u, mp_bitcnt_t cnt)
 
void mpz_tdiv_r_2exp (mpz_t r, const mpz_t u, mp_bitcnt_t cnt)
 
void mpz_divexact (mpz_t q, const mpz_t n, const mpz_t d)
 
int mpz_divisible_p (const mpz_t n, const mpz_t d)
 
int mpz_congruent_p (const mpz_t a, const mpz_t b, const mpz_t m)
 
unsigned long mpz_cdiv_qr_ui (mpz_t q, mpz_t r, const mpz_t n, unsigned long d)
 
unsigned long mpz_fdiv_qr_ui (mpz_t q, mpz_t r, const mpz_t n, unsigned long d)
 
unsigned long mpz_tdiv_qr_ui (mpz_t q, mpz_t r, const mpz_t n, unsigned long d)
 
unsigned long mpz_cdiv_q_ui (mpz_t q, const mpz_t n, unsigned long d)
 
unsigned long mpz_fdiv_q_ui (mpz_t q, const mpz_t n, unsigned long d)
 
unsigned long mpz_tdiv_q_ui (mpz_t q, const mpz_t n, unsigned long d)
 
unsigned long mpz_cdiv_r_ui (mpz_t r, const mpz_t n, unsigned long d)
 
unsigned long mpz_fdiv_r_ui (mpz_t r, const mpz_t n, unsigned long d)
 
unsigned long mpz_tdiv_r_ui (mpz_t r, const mpz_t n, unsigned long d)
 
unsigned long mpz_cdiv_ui (const mpz_t n, unsigned long d)
 
unsigned long mpz_fdiv_ui (const mpz_t n, unsigned long d)
 
unsigned long mpz_tdiv_ui (const mpz_t n, unsigned long d)
 
unsigned long mpz_mod_ui (mpz_t r, const mpz_t n, unsigned long d)
 
void mpz_divexact_ui (mpz_t q, const mpz_t n, unsigned long d)
 
int mpz_divisible_ui_p (const mpz_t n, unsigned long d)
 
unsigned long mpz_gcd_ui (mpz_t g, const mpz_t u, unsigned long v)
 
void mpz_gcd (mpz_t g, const mpz_t u, const mpz_t v)
 
void mpz_gcdext (mpz_t g, mpz_t s, mpz_t t, const mpz_t u, const mpz_t v)
 
void mpz_lcm (mpz_t r, const mpz_t u, const mpz_t v)
 
void mpz_lcm_ui (mpz_t r, const mpz_t u, unsigned long v)
 
int mpz_invert (mpz_t r, const mpz_t u, const mpz_t m)
 
void mpz_pow_ui (mpz_t r, const mpz_t b, unsigned long e)
 
void mpz_ui_pow_ui (mpz_t r, unsigned long blimb, unsigned long e)
 
void mpz_powm (mpz_t r, const mpz_t b, const mpz_t e, const mpz_t m)
 
void mpz_powm_ui (mpz_t r, const mpz_t b, unsigned long elimb, const mpz_t m)
 
void mpz_rootrem (mpz_t x, mpz_t r, const mpz_t y, unsigned long z)
 
int mpz_root (mpz_t x, const mpz_t y, unsigned long z)
 
void mpz_sqrtrem (mpz_t s, mpz_t r, const mpz_t u)
 
void mpz_sqrt (mpz_t s, const mpz_t u)
 
int mpz_perfect_square_p (const mpz_t u)
 
int mpn_perfect_square_p (mp_srcptr p, mp_size_t n)
 
mp_size_t mpn_sqrtrem (mp_ptr sp, mp_ptr rp, mp_srcptr p, mp_size_t n)
 
void mpz_fac_ui (mpz_t x, unsigned long n)
 
void mpz_bin_uiui (mpz_t r, unsigned long n, unsigned long k)
 
int mpz_probab_prime_p (const mpz_t n, int reps)
 
int mpz_tstbit (const mpz_t d, mp_bitcnt_t bit_index)
 
void mpz_setbit (mpz_t d, mp_bitcnt_t bit_index)
 
void mpz_clrbit (mpz_t d, mp_bitcnt_t bit_index)
 
void mpz_combit (mpz_t d, mp_bitcnt_t bit_index)
 
void mpz_com (mpz_t r, const mpz_t u)
 
void mpz_and (mpz_t r, const mpz_t u, const mpz_t v)
 
void mpz_ior (mpz_t r, const mpz_t u, const mpz_t v)
 
void mpz_xor (mpz_t r, const mpz_t u, const mpz_t v)
 
mp_bitcnt_t mpn_popcount (mp_srcptr p, mp_size_t n)
 
mp_bitcnt_t mpz_popcount (const mpz_t u)
 
mp_bitcnt_t mpz_hamdist (const mpz_t u, const mpz_t v)
 
mp_bitcnt_t mpz_scan1 (const mpz_t u, mp_bitcnt_t starting_bit)
 
mp_bitcnt_t mpz_scan0 (const mpz_t u, mp_bitcnt_t starting_bit)
 
size_t mpz_sizeinbase (const mpz_t u, int base)
 
char * mpz_get_str (char *sp, int base, const mpz_t u)
 
int mpz_set_str (mpz_t r, const char *sp, int base)
 
int mpz_init_set_str (mpz_t r, const char *sp, int base)
 
size_t mpz_out_str (FILE *stream, int base, const mpz_t x)
 
void mpz_import (mpz_t r, size_t count, int order, size_t size, int endian, size_t nails, const void *src)
 
void * mpz_export (void *r, size_t *countp, int order, size_t size, int endian, size_t nails, const mpz_t u)
 

Variables

const int mp_bits_per_limb = GMP_LIMB_BITS
 

Macro Definition Documentation

#define gmp_add_ssaaaa (   sh,
  sl,
  ah,
  al,
  bh,
  bl 
)
Value:
do { \
mp_limb_t __x; \
__x = (al) + (bl); \
(sh) = (ah) + (bh) + (__x < (al)); \
(sl) = __x; \
} while (0)
unsigned long mp_limb_t
Definition: mini-gmp.h:56
#define gmp_assert_nocarry (   x)
Value:
do { \
mp_limb_t __cy = x; \
assert (__cy == 0); \
} while (0)
unsigned long mp_limb_t
Definition: mini-gmp.h:56

Referenced by mpz_divexact(), mpz_divexact_ui(), and mpz_powm().

#define gmp_clz (   count,
 
)
Value:
do { \
mp_limb_t __clz_x = (x); \
unsigned __clz_c; \
for (__clz_c = 0; \
(__clz_x & ((mp_limb_t) 0xff << (GMP_LIMB_BITS - 8))) == 0; \
__clz_c += 8) \
__clz_x <<= 8; \
for (; (__clz_x & GMP_LIMB_HIGHBIT) == 0; __clz_c++) \
__clz_x <<= 1; \
(count) = __clz_c; \
} while (0)
#define GMP_LIMB_HIGHBIT
Definition: mini-gmp.c:58
#define GMP_LIMB_BITS
Definition: mini-gmp.c:55
unsigned long mp_limb_t
Definition: mini-gmp.h:56
#define gmp_ctz (   count,
 
)
Value:
do { \
mp_limb_t __ctz_x = (x); \
unsigned __ctz_c = 0; \
gmp_clz (__ctz_c, __ctz_x & - __ctz_x); \
(count) = GMP_LIMB_BITS - 1 - __ctz_c; \
} while (0)
#define gmp_clz(count, x)
Definition: mini-gmp.c:77
#define GMP_LIMB_BITS
Definition: mini-gmp.c:55
unsigned long mp_limb_t
Definition: mini-gmp.h:56
#define gmp_free (   p)    ((*gmp_free_func) ((p), 0))
#define GMP_HLIMB_BIT   ((mp_limb_t) 1 << (GMP_LIMB_BITS / 2))
#define GMP_LIMB_HIGHBIT   ((mp_limb_t) 1 << (GMP_LIMB_BITS - 1))
#define GMP_LIMB_MAX   (~ (mp_limb_t) 0)
#define GMP_LLIMB_MASK   (GMP_HLIMB_BIT - 1)

Referenced by mpn_invert_3by2().

#define GMP_MAX (   a,
 
)    ((a) > (b) ? (a) : (b))
#define GMP_MIN (   a,
 
)    ((a) < (b) ? (a) : (b))

Referenced by mpz_gcd(), and mpz_gcdext().

#define GMP_NEG_CAST (   T,
 
)    (-((T)((x) + 1) - 1))

Referenced by mpz_cmp_si(), mpz_mul_si(), and mpz_set_si().

#define GMP_PRIME_MASK   0xc96996dcUL

Referenced by mpz_probab_prime_p().

#define GMP_PRIME_PRODUCT   (3UL*5UL*7UL*11UL*13UL*17UL*19UL*23UL*29UL)

Referenced by mpz_probab_prime_p().

#define gmp_sub_ddmmss (   sh,
  sl,
  ah,
  al,
  bh,
  bl 
)
Value:
do { \
mp_limb_t __x; \
__x = (al) - (bl); \
(sh) = (ah) - (bh) - ((al) < (bl)); \
(sl) = __x; \
} while (0)
unsigned long mp_limb_t
Definition: mini-gmp.h:56
#define gmp_udiv_qr_3by2 (   q,
  r1,
  r0,
  n2,
  n1,
  n0,
  d1,
  d0,
  dinv 
)
Value:
do { \
mp_limb_t _q0, _t1, _t0, _mask; \
gmp_umul_ppmm ((q), _q0, (n2), (dinv)); \
gmp_add_ssaaaa ((q), _q0, (q), _q0, (n2), (n1)); \
\
/* Compute the two most significant limbs of n - q'd */ \
(r1) = (n1) - (d1) * (q); \
gmp_sub_ddmmss ((r1), (r0), (r1), (n0), (d1), (d0)); \
gmp_umul_ppmm (_t1, _t0, (d0), (q)); \
gmp_sub_ddmmss ((r1), (r0), (r1), (r0), _t1, _t0); \
(q)++; \
\
/* Conditionally adjust q and the remainders */ \
_mask = - (mp_limb_t) ((r1) >= _q0); \
(q) += _mask; \
gmp_add_ssaaaa ((r1), (r0), (r1), (r0), _mask & (d1), _mask & (d0)); \
if ((r1) >= (d1)) \
{ \
if ((r1) > (d1) || (r0) >= (d0)) \
{ \
(q)++; \
gmp_sub_ddmmss ((r1), (r0), (r1), (r0), (d1), (d0)); \
} \
} \
} while (0)
#define gmp_add_ssaaaa(sh, sl, ah, al, bh, bl)
Definition: mini-gmp.c:96
#define gmp_sub_ddmmss(sh, sl, ah, al, bh, bl)
Definition: mini-gmp.c:104
#define gmp_umul_ppmm(w1, w0, u, v)
Definition: mini-gmp.c:112
unsigned long mp_limb_t
Definition: mini-gmp.h:56
#define gmp_udiv_qrnnd_preinv (   q,
  r,
  nh,
  nl,
  d,
  di 
)
Value:
do { \
mp_limb_t _qh, _ql, _r, _mask; \
gmp_umul_ppmm (_qh, _ql, (nh), (di)); \
gmp_add_ssaaaa (_qh, _ql, _qh, _ql, (nh) + 1, (nl)); \
_r = (nl) - _qh * (d); \
_mask = -(mp_limb_t) (_r > _ql); /* both > and >= are OK */ \
_qh += _mask; \
_r += _mask & (d); \
if (_r >= (d)) \
{ \
_r -= (d); \
_qh++; \
} \
\
(r) = _r; \
(q) = _qh; \
} while (0)
#define gmp_add_ssaaaa(sh, sl, ah, al, bh, bl)
Definition: mini-gmp.c:96
#define gmp_umul_ppmm(w1, w0, u, v)
Definition: mini-gmp.c:112
unsigned long mp_limb_t
Definition: mini-gmp.h:56
#define GMP_ULONG_BITS   (sizeof(unsigned long) * CHAR_BIT)
#define GMP_ULONG_HIGHBIT   ((unsigned long) 1 << (GMP_ULONG_BITS - 1))

Referenced by mpz_pow_ui().

#define gmp_umul_ppmm (   w1,
  w0,
  u,
 
)
Value:
do { \
mp_limb_t __x0, __x1, __x2, __x3; \
unsigned __ul, __vl, __uh, __vh; \
mp_limb_t __u = (u), __v = (v); \
\
__ul = __u & GMP_LLIMB_MASK; \
__uh = __u >> (GMP_LIMB_BITS / 2); \
__vl = __v & GMP_LLIMB_MASK; \
__vh = __v >> (GMP_LIMB_BITS / 2); \
\
__x0 = (mp_limb_t) __ul * __vl; \
__x1 = (mp_limb_t) __ul * __vh; \
__x2 = (mp_limb_t) __uh * __vl; \
__x3 = (mp_limb_t) __uh * __vh; \
\
__x1 += __x0 >> (GMP_LIMB_BITS / 2);/* this can't give carry */ \
__x1 += __x2; /* but this indeed can */ \
if (__x1 < __x2) /* did we get it? */ \
__x3 += GMP_HLIMB_BIT; /* yes, add it in the proper pos. */ \
\
(w1) = __x3 + (__x1 >> (GMP_LIMB_BITS / 2)); \
(w0) = (__x1 << (GMP_LIMB_BITS / 2)) + (__x0 & GMP_LLIMB_MASK); \
} while (0)
#define GMP_LIMB_BITS
Definition: mini-gmp.c:55
#define GMP_HLIMB_BIT
Definition: mini-gmp.c:60
unsigned long mp_limb_t
Definition: mini-gmp.h:56
#define GMP_LLIMB_MASK
Definition: mini-gmp.c:61

Referenced by mpn_addmul_1(), mpn_invert_3by2(), mpn_mul_1(), and mpn_submul_1().

#define gmp_xalloc (   size)    ((*gmp_allocate_func)((size)))
#define MP_BITCNT_T_SWAP (   x,
 
)
Value:
do { \
mp_bitcnt_t __mp_bitcnt_t_swap__tmp = (x); \
(x) = (y); \
(y) = __mp_bitcnt_t_swap__tmp; \
} while (0)
unsigned long mp_bitcnt_t
Definition: mini-gmp.h:58

Referenced by mpz_gcdext().

#define MP_LIMB_T_SWAP (   x,
 
)
Value:
do { \
mp_limb_t __mp_limb_t_swap__tmp = (x); \
(x) = (y); \
(y) = __mp_limb_t_swap__tmp; \
} while (0)
unsigned long mp_limb_t
Definition: mini-gmp.h:56
#define MP_PTR_SWAP (   x,
 
)
Value:
do { \
mp_ptr __mp_ptr_swap__tmp = (x); \
(x) = (y); \
(y) = __mp_ptr_swap__tmp; \
} while (0)
mp_limb_t * mp_ptr
Definition: mini-gmp.h:60

Referenced by mpz_swap().

#define MP_SIZE_T_SWAP (   x,
 
)
Value:
do { \
mp_size_t __mp_size_t_swap__tmp = (x); \
(x) = (y); \
(y) = __mp_size_t_swap__tmp; \
} while (0)
long mp_size_t
Definition: mini-gmp.h:57

Referenced by mpz_and(), mpz_ior(), mpz_swap(), and mpz_xor().

#define MP_SRCPTR_SWAP (   x,
 
)
Value:
do { \
mp_srcptr __mp_srcptr_swap__tmp = (x); \
(x) = (y); \
(y) = __mp_srcptr_swap__tmp; \
} while (0)
const mp_limb_t * mp_srcptr
Definition: mini-gmp.h:61
#define MPN_PTR_SWAP (   xp,
  xs,
  yp,
  ys 
)
Value:
do { \
MP_PTR_SWAP (xp, yp); \
MP_SIZE_T_SWAP (xs, ys); \
} while(0)
#define MP_SIZE_T_SWAP(x, y)
Definition: mini-gmp.c:190
#define MP_PTR_SWAP(x, y)
Definition: mini-gmp.c:202
#define MPN_SRCPTR_SWAP (   xp,
  xs,
  yp,
  ys 
)
Value:
do { \
MP_SRCPTR_SWAP (xp, yp); \
MP_SIZE_T_SWAP (xs, ys); \
} while(0)
#define MP_SIZE_T_SWAP(x, y)
Definition: mini-gmp.c:190
#define MP_SRCPTR_SWAP(x, y)
Definition: mini-gmp.c:208

Referenced by mpz_hamdist().

#define mpn_zero_p (   xp,
 
)    (mpn_normalized_size ((xp), (n)) == 0)

Referenced by mpz_scan0(), and mpz_scan1().

#define MPZ_PTR_SWAP (   x,
 
)
Value:
do { \
mpz_ptr __mpz_ptr_swap__tmp = (x); \
(x) = (y); \
(y) = __mpz_ptr_swap__tmp; \
} while (0)
__mpz_struct * mpz_ptr
Definition: mini-gmp.h:75

Referenced by mpz_gcdext().

#define MPZ_REALLOC (   z,
 
)
Value:
((n) > (z)->_mp_alloc \
? mpz_realloc(z,n) \
: (z)->_mp_d)

Referenced by mpz_and(), mpz_import(), mpz_ior(), mpz_limbs_modify(), mpz_mul_2exp(), mpz_mul_ui(), mpz_powm(), mpz_set(), mpz_set_d(), mpz_set_str(), and mpz_xor().

#define MPZ_SRCPTR_SWAP (   x,
 
)
Value:
do { \
mpz_srcptr __mpz_srcptr_swap__tmp = (x); \
(x) = (y); \
(y) = __mpz_srcptr_swap__tmp; \
} while (0)
const __mpz_struct * mpz_srcptr
Definition: mini-gmp.h:76

Referenced by mpz_and(), mpz_gcdext(), mpz_ior(), and mpz_xor().

Enumeration Type Documentation

Enumerator
GMP_DIV_FLOOR 
GMP_DIV_CEIL 
GMP_DIV_TRUNC 

Function Documentation

void mp_get_memory_functions ( void *(**)(size_t)  alloc_func,
void *(**)(void *, size_t, size_t)  realloc_func,
void(**)(void *, size_t)  free_func 
)
void mp_set_memory_functions ( void *(*)(size_t)  alloc_func,
void *(*)(void *, size_t, size_t)  realloc_func,
void(*)(void *, size_t)  free_func 
)
mp_limb_t mpn_add ( mp_ptr  rp,
mp_srcptr  ap,
mp_size_t  an,
mp_srcptr  bp,
mp_size_t  bn 
)

References mpn_add_1(), and mpn_add_n().

Here is the call graph for this function:

mp_limb_t mpn_add_1 ( mp_ptr  rp,
mp_srcptr  ap,
mp_size_t  n,
mp_limb_t  b 
)

Referenced by mpn_add().

Here is the caller graph for this function:

mp_limb_t mpn_add_n ( mp_ptr  rp,
mp_srcptr  ap,
mp_srcptr  bp,
mp_size_t  n 
)

Referenced by mpn_add().

Here is the caller graph for this function:

mp_limb_t mpn_addmul_1 ( mp_ptr  rp,
mp_srcptr  up,
mp_size_t  n,
mp_limb_t  vl 
)

References gmp_umul_ppmm.

Referenced by mpn_mul().

Here is the caller graph for this function:

int mpn_cmp ( mp_srcptr  ap,
mp_srcptr  bp,
mp_size_t  n 
)

Referenced by mpz_cmp().

Here is the caller graph for this function:

void mpn_copyd ( mp_ptr  d,
mp_srcptr  s,
mp_size_t  n 
)

Referenced by mpn_sqrtrem(), and mpz_mul_2exp().

Here is the caller graph for this function:

void mpn_copyi ( mp_ptr  d,
mp_srcptr  s,
mp_size_t  n 
)

Referenced by mpz_get_str(), mpz_set(), and mpz_sizeinbase().

Here is the caller graph for this function:

size_t mpn_get_str ( unsigned char *  sp,
int  base,
mp_ptr  up,
mp_size_t  un 
)
mp_limb_t mpn_invert_3by2 ( mp_limb_t  u1,
mp_limb_t  u0 
)
mp_limb_t mpn_lshift ( mp_ptr  rp,
mp_srcptr  up,
mp_size_t  n,
unsigned int  cnt 
)

References GMP_LIMB_BITS.

Referenced by mpz_mul_2exp(), and mpz_powm().

Here is the caller graph for this function:

mp_limb_t mpn_mul ( mp_ptr  rp,
mp_srcptr  up,
mp_size_t  un,
mp_srcptr  vp,
mp_size_t  vn 
)

References mpn_addmul_1(), and mpn_mul_1().

Referenced by mpn_mul_n(), mpn_sqr(), and mpz_mul().

Here is the call graph for this function:

Here is the caller graph for this function:

mp_limb_t mpn_mul_1 ( mp_ptr  rp,
mp_srcptr  up,
mp_size_t  n,
mp_limb_t  vl 
)

References gmp_umul_ppmm.

Referenced by mpn_mul(), and mpz_mul_ui().

Here is the caller graph for this function:

void mpn_mul_n ( mp_ptr  rp,
mp_srcptr  ap,
mp_srcptr  bp,
mp_size_t  n 
)

References mpn_mul().

Here is the call graph for this function:

int mpn_perfect_square_p ( mp_srcptr  p,
mp_size_t  n 
)

References mpz_roinit_n(), mpz_root(), and NULL.

Here is the call graph for this function:

mp_bitcnt_t mpn_popcount ( mp_srcptr  p,
mp_size_t  n 
)

Referenced by mpz_popcount().

Here is the caller graph for this function:

mp_limb_t mpn_rshift ( mp_ptr  rp,
mp_srcptr  up,
mp_size_t  n,
unsigned int  cnt 
)

References GMP_LIMB_BITS.

mp_bitcnt_t mpn_scan0 ( mp_srcptr  ptr,
mp_bitcnt_t  bit 
)

References GMP_LIMB_BITS, and GMP_LIMB_MAX.

mp_bitcnt_t mpn_scan1 ( mp_srcptr  ptr,
mp_bitcnt_t  bit 
)

References GMP_LIMB_BITS, and GMP_LIMB_MAX.

mp_size_t mpn_set_str ( mp_ptr  rp,
const unsigned char *  sp,
size_t  sn,
int  base 
)
void mpn_sqr ( mp_ptr  rp,
mp_srcptr  ap,
mp_size_t  n 
)

References mpn_mul().

Here is the call graph for this function:

mp_size_t mpn_sqrtrem ( mp_ptr  sp,
mp_ptr  rp,
mp_srcptr  p,
mp_size_t  n 
)

References mpn_copyd(), mpz_clear(), mpz_init(), mpz_roinit_n(), mpz_rootrem(), and s.

Here is the call graph for this function:

mp_limb_t mpn_sub ( mp_ptr  rp,
mp_srcptr  ap,
mp_size_t  an,
mp_srcptr  bp,
mp_size_t  bn 
)

References mpn_sub_1(), and mpn_sub_n().

Referenced by mpz_powm().

Here is the call graph for this function:

Here is the caller graph for this function:

mp_limb_t mpn_sub_1 ( mp_ptr  rp,
mp_srcptr  ap,
mp_size_t  n,
mp_limb_t  b 
)

Referenced by mpn_sub().

Here is the caller graph for this function:

mp_limb_t mpn_sub_n ( mp_ptr  rp,
mp_srcptr  ap,
mp_srcptr  bp,
mp_size_t  n 
)

Referenced by mpn_sub().

Here is the caller graph for this function:

mp_limb_t mpn_submul_1 ( mp_ptr  rp,
mp_srcptr  up,
mp_size_t  n,
mp_limb_t  vl 
)

References gmp_umul_ppmm.

void mpn_zero ( mp_ptr  rp,
mp_size_t  n 
)
void mpz_abs ( mpz_t  r,
const mpz_t  u 
)

References GMP_ABS, and mpz_set().

Referenced by mpz_gcd(), mpz_gcd_ui(), mpz_gcdext(), mpz_lcm(), mpz_lcm_ui(), and mpz_powm().

Here is the call graph for this function:

Here is the caller graph for this function:

void mpz_add ( mpz_t  r,
const mpz_t  a,
const mpz_t  b 
)

Referenced by interval_map_decompose(), mpz_addmul(), mpz_addmul_ui(), mpz_gcdext(), mpz_invert(), mpz_rootrem(), and range_expr_value_high().

Here is the caller graph for this function:

void mpz_add_ui ( mpz_t  r,
const mpz_t  a,
unsigned long  b 
)
void mpz_addmul ( mpz_t  r,
const mpz_t  u,
const mpz_t  v 
)

References mpz_add(), mpz_clear(), mpz_init(), and mpz_mul().

Here is the call graph for this function:

void mpz_addmul_ui ( mpz_t  r,
const mpz_t  u,
unsigned long int  v 
)

References mpz_add(), mpz_clear(), mpz_init(), and mpz_mul_ui().

Here is the call graph for this function:

void mpz_and ( mpz_t  r,
const mpz_t  u,
const mpz_t  v 
)

References GMP_ABS, MP_SIZE_T_SWAP, MPZ_REALLOC, MPZ_SRCPTR_SWAP, and rx().

Referenced by constant_expr_splice(), and interval_map_decompose().

Here is the call graph for this function:

Here is the caller graph for this function:

void mpz_bin_uiui ( mpz_t  r,
unsigned long  n,
unsigned long  k 
)

References mpz_clear(), mpz_divexact(), mpz_fac_ui(), mpz_init(), mpz_mul_ui(), and mpz_set_ui().

Here is the call graph for this function:

void mpz_cdiv_q ( mpz_t  q,
const mpz_t  n,
const mpz_t  d 
)

References GMP_DIV_CEIL, and NULL.

void mpz_cdiv_q_2exp ( mpz_t  r,
const mpz_t  u,
mp_bitcnt_t  cnt 
)

References GMP_DIV_CEIL.

unsigned long mpz_cdiv_q_ui ( mpz_t  q,
const mpz_t  n,
unsigned long  d 
)

References GMP_DIV_CEIL, and NULL.

void mpz_cdiv_qr ( mpz_t  q,
mpz_t  r,
const mpz_t  n,
const mpz_t  d 
)

References GMP_DIV_CEIL.

unsigned long mpz_cdiv_qr_ui ( mpz_t  q,
mpz_t  r,
const mpz_t  n,
unsigned long  d 
)

References GMP_DIV_CEIL.

void mpz_cdiv_r ( mpz_t  r,
const mpz_t  n,
const mpz_t  d 
)

References GMP_DIV_CEIL, and NULL.

void mpz_cdiv_r_2exp ( mpz_t  r,
const mpz_t  u,
mp_bitcnt_t  cnt 
)

References GMP_DIV_CEIL.

unsigned long mpz_cdiv_r_ui ( mpz_t  r,
const mpz_t  n,
unsigned long  d 
)

References GMP_DIV_CEIL, and NULL.

unsigned long mpz_cdiv_ui ( const mpz_t  n,
unsigned long  d 
)

References GMP_DIV_CEIL, and NULL.

void mpz_clrbit ( mpz_t  d,
mp_bitcnt_t  bit_index 
)

References mpz_tstbit().

Here is the call graph for this function:

int mpz_cmp ( const mpz_t  a,
const mpz_t  b 
)

References mpn_cmp().

Referenced by mpz_congruent_p(), mpz_gcd(), mpz_gcdext(), and mpz_probab_prime_p().

Here is the call graph for this function:

Here is the caller graph for this function:

int mpz_cmp_d ( const mpz_t  x,
double  d 
)

References mpz_cmpabs_d().

Here is the call graph for this function:

int mpz_cmp_si ( const mpz_t  u,
long  v 
)

References GMP_NEG_CAST, and mpz_cmp_ui().

Here is the call graph for this function:

int mpz_cmp_ui ( const mpz_t  u,
unsigned long  v 
)

Referenced by interval_map_decompose(), mpz_cmp_si(), and mpz_invert().

Here is the caller graph for this function:

int mpz_cmpabs ( const mpz_t  u,
const mpz_t  v 
)

References GMP_ABS.

Referenced by mpz_gcdext(), and mpz_rootrem().

Here is the caller graph for this function:

int mpz_cmpabs_d ( const mpz_t  x,
double  d 
)

References GMP_ABS, and GMP_LIMB_HIGHBIT.

Referenced by mpz_cmp_d().

Here is the caller graph for this function:

int mpz_cmpabs_ui ( const mpz_t  u,
unsigned long  v 
)

References GMP_ABS.

Referenced by mpz_invert(), mpz_probab_prime_p(), and mpz_rootrem().

Here is the caller graph for this function:

void mpz_com ( mpz_t  r,
const mpz_t  u 
)

References mpz_neg(), and mpz_sub_ui().

Here is the call graph for this function:

void mpz_combit ( mpz_t  d,
mp_bitcnt_t  bit_index 
)

References mpz_tstbit().

Here is the call graph for this function:

int mpz_congruent_p ( const mpz_t  a,
const mpz_t  b,
const mpz_t  m 
)

References mpz_clear(), mpz_cmp(), mpz_divisible_p(), mpz_init(), mpz_sgn(), and mpz_sub().

Here is the call graph for this function:

void mpz_divexact ( mpz_t  q,
const mpz_t  n,
const mpz_t  d 
)

References gmp_assert_nocarry, GMP_DIV_TRUNC, and NULL.

Referenced by mpz_bin_uiui(), mpz_gcdext(), and mpz_lcm().

Here is the caller graph for this function:

void mpz_divexact_ui ( mpz_t  q,
const mpz_t  n,
unsigned long  d 
)

References gmp_assert_nocarry, GMP_DIV_TRUNC, and NULL.

Referenced by mpz_gcdext().

Here is the caller graph for this function:

int mpz_divisible_p ( const mpz_t  n,
const mpz_t  d 
)

References GMP_DIV_TRUNC, and NULL.

Referenced by mpz_congruent_p().

Here is the caller graph for this function:

int mpz_divisible_ui_p ( const mpz_t  n,
unsigned long  d 
)

References GMP_DIV_TRUNC, and NULL.

void* mpz_export ( void *  r,
size_t *  countp,
int  order,
size_t  size,
int  endian,
size_t  nails,
const mpz_t  u 
)

References bytes, GMP_ABS, gmp_xalloc, and size.

Referenced by mpz_export_data().

Here is the caller graph for this function:

void mpz_fac_ui ( mpz_t  x,
unsigned long  n 
)

References mpz_mul_ui(), and mpz_set_ui().

Referenced by mpz_bin_uiui().

Here is the call graph for this function:

Here is the caller graph for this function:

void mpz_fdiv_q ( mpz_t  q,
const mpz_t  n,
const mpz_t  d 
)

References GMP_DIV_FLOOR, and NULL.

void mpz_fdiv_q_2exp ( mpz_t  r,
const mpz_t  u,
mp_bitcnt_t  cnt 
)
unsigned long mpz_fdiv_q_ui ( mpz_t  q,
const mpz_t  n,
unsigned long  d 
)

References NULL.

void mpz_fdiv_qr ( mpz_t  q,
mpz_t  r,
const mpz_t  n,
const mpz_t  d 
)

References GMP_DIV_FLOOR.

unsigned long mpz_fdiv_qr_ui ( mpz_t  q,
mpz_t  r,
const mpz_t  n,
unsigned long  d 
)
void mpz_fdiv_r ( mpz_t  r,
const mpz_t  n,
const mpz_t  d 
)

References GMP_DIV_FLOOR, and NULL.

void mpz_fdiv_r_2exp ( mpz_t  r,
const mpz_t  u,
mp_bitcnt_t  cnt 
)
unsigned long mpz_fdiv_r_ui ( mpz_t  r,
const mpz_t  n,
unsigned long  d 
)

References NULL.

unsigned long mpz_fdiv_ui ( const mpz_t  n,
unsigned long  d 
)

References NULL.

int mpz_fits_slong_p ( const mpz_t  u)

References GMP_LIMB_HIGHBIT.

int mpz_fits_ulong_p ( const mpz_t  u)
void mpz_gcd ( mpz_t  g,
const mpz_t  u,
const mpz_t  v 
)

References GMP_MIN, mpz_abs(), mpz_clear(), mpz_cmp(), mpz_init(), mpz_mul_2exp(), mpz_set_ui(), mpz_sub(), mpz_swap(), mpz_tdiv_r(), and mpz_tdiv_ui().

Referenced by mpz_lcm().

Here is the call graph for this function:

Here is the caller graph for this function:

unsigned long mpz_gcd_ui ( mpz_t  g,
const mpz_t  u,
unsigned long  v 
)

References GMP_ABS, mpz_abs(), mpz_set_ui(), and NULL.

Referenced by mpz_lcm_ui(), and mpz_probab_prime_p().

Here is the call graph for this function:

Here is the caller graph for this function:

void mpz_gcdext ( mpz_t  g,
mpz_t  s,
mpz_t  t,
const mpz_t  u,
const mpz_t  v 
)
double mpz_get_d ( const mpz_t  u)

References GMP_ABS, and GMP_LIMB_HIGHBIT.

long int mpz_get_si ( const mpz_t  u)

References GMP_LIMB_HIGHBIT.

char* mpz_get_str ( char *  sp,
int  base,
const mpz_t  u 
)

References GMP_ABS, gmp_free, gmp_xalloc, mpn_copyi(), mpz_sizeinbase(), and NULL.

Referenced by mpz_out_str(), and mpz_printf().

Here is the call graph for this function:

Here is the caller graph for this function:

unsigned long int mpz_get_ui ( const mpz_t  u)
mp_limb_t mpz_getlimbn ( const mpz_t  u,
mp_size_t  n 
)

References GMP_ABS.

mp_bitcnt_t mpz_hamdist ( const mpz_t  u,
const mpz_t  v 
)

References MPN_SRCPTR_SWAP.

void mpz_import ( mpz_t  r,
size_t  count,
int  order,
size_t  size,
int  endian,
size_t  nails,
const void *  src 
)

References bytes, MPZ_REALLOC, and size.

Referenced by mpz_import_data().

Here is the caller graph for this function:

void mpz_init2 ( mpz_t  r,
mp_bitcnt_t  bits 
)

References GMP_LIMB_BITS.

Referenced by constant_expr_alloc(), constant_expr_splice(), mpz_init_bitmask(), mpz_mul(), and mpz_rootrem().

Here is the caller graph for this function:

void mpz_init_set ( mpz_t  r,
const mpz_t  x 
)

References mpz_init(), and mpz_set().

Here is the call graph for this function:

void mpz_init_set_d ( mpz_t  r,
double  x 
)

References mpz_init(), and mpz_set_d().

Here is the call graph for this function:

void mpz_init_set_si ( mpz_t  r,
signed long int  x 
)

References mpz_init(), and mpz_set_si().

Here is the call graph for this function:

int mpz_init_set_str ( mpz_t  r,
const char *  sp,
int  base 
)

References mpz_init(), and mpz_set_str().

Here is the call graph for this function:

void mpz_init_set_ui ( mpz_t  r,
unsigned long int  x 
)

References mpz_init(), and mpz_set_ui().

Referenced by mpz_pow_ui(), mpz_powm(), mpz_powm_ui(), and mpz_ui_pow_ui().

Here is the call graph for this function:

Here is the caller graph for this function:

int mpz_invert ( mpz_t  r,
const mpz_t  u,
const mpz_t  m 
)

References mpz_add(), mpz_clear(), mpz_cmp_ui(), mpz_cmpabs_ui(), mpz_gcdext(), mpz_init(), mpz_sub(), mpz_swap(), and NULL.

Referenced by mpz_powm().

Here is the call graph for this function:

Here is the caller graph for this function:

void mpz_ior ( mpz_t  r,
const mpz_t  u,
const mpz_t  v 
)

References GMP_ABS, MP_SIZE_T_SWAP, MPZ_REALLOC, mpz_set(), MPZ_SRCPTR_SWAP, and rx().

Here is the call graph for this function:

void mpz_lcm ( mpz_t  r,
const mpz_t  u,
const mpz_t  v 
)

References __mpz_struct::_mp_size, mpz_abs(), mpz_clear(), mpz_divexact(), mpz_gcd(), mpz_init(), and mpz_mul().

Here is the call graph for this function:

void mpz_lcm_ui ( mpz_t  r,
const mpz_t  u,
unsigned long  v 
)

References mpz_abs(), mpz_gcd_ui(), mpz_mul_ui(), and NULL.

Here is the call graph for this function:

void mpz_limbs_finish ( mpz_t  x,
mp_size_t  xs 
)

References GMP_ABS.

Referenced by mpz_roinit_n().

Here is the caller graph for this function:

mp_ptr mpz_limbs_modify ( mpz_t  x,
mp_size_t  n 
)

References MPZ_REALLOC.

Referenced by mpz_limbs_write().

Here is the caller graph for this function:

mp_srcptr mpz_limbs_read ( mpz_srcptr  x)

References __mpz_struct::_mp_d.

mp_ptr mpz_limbs_write ( mpz_t  x,
mp_size_t  n 
)

References mpz_limbs_modify().

Here is the call graph for this function:

void mpz_mod ( mpz_t  r,
const mpz_t  n,
const mpz_t  d 
)

References GMP_DIV_CEIL, GMP_DIV_FLOOR, and NULL.

unsigned long mpz_mod_ui ( mpz_t  r,
const mpz_t  n,
unsigned long  d 
)

References NULL.

void mpz_mul ( mpz_t  r,
const mpz_t  u,
const mpz_t  v 
)

References __mpz_struct::_mp_size, GMP_ABS, GMP_LIMB_BITS, mpn_mul(), mpz_clear(), mpz_init2(), and mpz_swap().

Referenced by mpz_addmul(), mpz_lcm(), mpz_pow_ui(), mpz_powm(), and mpz_submul().

Here is the call graph for this function:

Here is the caller graph for this function:

void mpz_mul_2exp ( mpz_t  r,
const mpz_t  u,
mp_bitcnt_t  bits 
)

References GMP_ABS, GMP_LIMB_BITS, mpn_copyd(), mpn_lshift(), and MPZ_REALLOC.

Referenced by mpz_gcd(), mpz_gcdext(), and mpz_lshift_ui().

Here is the call graph for this function:

Here is the caller graph for this function:

void mpz_mul_si ( mpz_t  r,
const mpz_t  u,
long int  v 
)

References GMP_NEG_CAST, mpz_mul_ui(), and mpz_neg().

Here is the call graph for this function:

void mpz_mul_ui ( mpz_t  r,
const mpz_t  u,
unsigned long int  v 
)

References GMP_ABS, mpn_mul_1(), and MPZ_REALLOC.

Referenced by mpz_addmul_ui(), mpz_bin_uiui(), mpz_fac_ui(), mpz_lcm_ui(), mpz_mul_si(), mpz_rootrem(), and mpz_submul_ui().

Here is the call graph for this function:

Here is the caller graph for this function:

void mpz_neg ( mpz_t  r,
const mpz_t  u 
)

References mpz_set().

Referenced by mpz_com(), mpz_gcdext(), mpz_mul_si(), and mpz_rootrem().

Here is the call graph for this function:

Here is the caller graph for this function:

size_t mpz_out_str ( FILE *  stream,
int  base,
const mpz_t  x 
)

References gmp_free, len, mpz_get_str(), and NULL.

Here is the call graph for this function:

int mpz_perfect_square_p ( const mpz_t  u)

References mpz_root(), and NULL.

Here is the call graph for this function:

mp_bitcnt_t mpz_popcount ( const mpz_t  u)

References mpn_popcount().

Referenced by bitmask_expr_to_binops().

Here is the call graph for this function:

Here is the caller graph for this function:

void mpz_pow_ui ( mpz_t  r,
const mpz_t  b,
unsigned long  e 
)

References GMP_ULONG_HIGHBIT, mpz_clear(), mpz_init_set_ui(), mpz_mul(), and mpz_swap().

Referenced by mpz_rootrem(), and mpz_ui_pow_ui().

Here is the call graph for this function:

Here is the caller graph for this function:

void mpz_powm ( mpz_t  r,
const mpz_t  b,
const mpz_t  e,
const mpz_t  m 
)

References GMP_ABS, gmp_assert_nocarry, gmp_free, GMP_LIMB_HIGHBIT, mpn_lshift(), mpn_sub(), mpz_abs(), mpz_clear(), mpz_init(), mpz_init_set_ui(), mpz_invert(), mpz_mul(), MPZ_REALLOC, mpz_set_ui(), mpz_swap(), NULL, and gmp_div_inverse::shift.

Referenced by mpz_powm_ui().

Here is the call graph for this function:

Here is the caller graph for this function:

void mpz_powm_ui ( mpz_t  r,
const mpz_t  b,
unsigned long  elimb,
const mpz_t  m 
)

References mpz_clear(), mpz_init_set_ui(), and mpz_powm().

Here is the call graph for this function:

int mpz_probab_prime_p ( const mpz_t  n,
int  reps 
)
void mpz_realloc2 ( mpz_t  x,
mp_bitcnt_t  n 
)

References GMP_LIMB_BITS.

mpz_srcptr mpz_roinit_n ( mpz_t  x,
mp_srcptr  xp,
mp_size_t  xs 
)

References __mpz_struct::_mp_alloc, and mpz_limbs_finish().

Referenced by mpn_perfect_square_p(), and mpn_sqrtrem().

Here is the call graph for this function:

Here is the caller graph for this function:

int mpz_root ( mpz_t  x,
const mpz_t  y,
unsigned long  z 
)

References mpz_clear(), mpz_init(), and mpz_rootrem().

Referenced by mpn_perfect_square_p(), and mpz_perfect_square_p().

Here is the call graph for this function:

Here is the caller graph for this function:

void mpz_rootrem ( mpz_t  x,
mpz_t  r,
const mpz_t  y,
unsigned long  z 
)
mp_bitcnt_t mpz_scan0 ( const mpz_t  u,
mp_bitcnt_t  starting_bit 
)

References GMP_ABS, GMP_LIMB_BITS, GMP_LIMB_MAX, and mpn_zero_p.

Referenced by interval_map_decompose().

Here is the caller graph for this function:

mp_bitcnt_t mpz_scan1 ( const mpz_t  u,
mp_bitcnt_t  starting_bit 
)

References GMP_ABS, GMP_LIMB_BITS, GMP_LIMB_MAX, and mpn_zero_p.

Referenced by bitmask_expr_to_binops(), and mpz_probab_prime_p().

Here is the caller graph for this function:

void mpz_set ( mpz_t  r,
const mpz_t  x 
)

References GMP_ABS, mpn_copyi(), and MPZ_REALLOC.

Referenced by constant_expr_splice(), interval_map_decompose(), mpz_abs(), mpz_init_set(), mpz_ior(), mpz_neg(), mpz_rootrem(), mpz_xor(), range_expr_value_high(), and range_expr_value_low().

Here is the call graph for this function:

Here is the caller graph for this function:

void mpz_set_d ( mpz_t  r,
double  x 
)

References GMP_LIMB_HIGHBIT, and MPZ_REALLOC.

Referenced by mpz_init_set_d().

Here is the caller graph for this function:

void mpz_set_si ( mpz_t  r,
signed long int  x 
)

References GMP_NEG_CAST, and mpz_set_ui().

Referenced by mpz_gcdext(), and mpz_init_set_si().

Here is the call graph for this function:

Here is the caller graph for this function:

int mpz_set_str ( mpz_t  r,
const char *  sp,
int  base 
)

References dp, mpn_base_info::exp, gmp_free, gmp_xalloc, and MPZ_REALLOC.

Referenced by mpz_init_set_str().

Here is the caller graph for this function:

void mpz_set_ui ( mpz_t  r,
unsigned long int  x 
)
void mpz_setbit ( mpz_t  d,
mp_bitcnt_t  bit_index 
)

References mpz_tstbit().

Referenced by mpz_bitmask(), mpz_gcdext(), and mpz_rootrem().

Here is the call graph for this function:

Here is the caller graph for this function:

int mpz_sgn ( const mpz_t  u)

Referenced by mpz_congruent_p(), and mpz_gcdext().

Here is the caller graph for this function:

size_t mpz_size ( const mpz_t  u)

References GMP_ABS.

size_t mpz_sizeinbase ( const mpz_t  u,
int  base 
)

References GMP_ABS, gmp_free, and mpn_copyi().

Referenced by mpz_get_str(), mpz_printf(), and mpz_rootrem().

Here is the call graph for this function:

Here is the caller graph for this function:

void mpz_sqrt ( mpz_t  s,
const mpz_t  u 
)

References mpz_rootrem(), and NULL.

Here is the call graph for this function:

void mpz_sqrtrem ( mpz_t  s,
mpz_t  r,
const mpz_t  u 
)

References mpz_rootrem().

Here is the call graph for this function:

void mpz_sub ( mpz_t  r,
const mpz_t  a,
const mpz_t  b 
)

Referenced by interval_map_decompose(), mpz_congruent_p(), mpz_gcd(), mpz_gcdext(), mpz_invert(), mpz_rootrem(), mpz_submul(), and mpz_submul_ui().

Here is the caller graph for this function:

void mpz_sub_ui ( mpz_t  r,
const mpz_t  a,
unsigned long  b 
)

Referenced by interval_map_decompose(), mpz_bitmask(), and mpz_com().

Here is the caller graph for this function:

void mpz_submul ( mpz_t  r,
const mpz_t  u,
const mpz_t  v 
)

References mpz_clear(), mpz_init(), mpz_mul(), and mpz_sub().

Here is the call graph for this function:

void mpz_submul_ui ( mpz_t  r,
const mpz_t  u,
unsigned long int  v 
)

References mpz_clear(), mpz_init(), mpz_mul_ui(), and mpz_sub().

Here is the call graph for this function:

void mpz_swap ( mpz_t  u,
mpz_t  v 
)

References MP_PTR_SWAP, and MP_SIZE_T_SWAP.

Referenced by mpz_gcd(), mpz_gcdext(), mpz_invert(), mpz_mul(), mpz_pow_ui(), mpz_powm(), and mpz_rootrem().

Here is the caller graph for this function:

void mpz_tdiv_q ( mpz_t  q,
const mpz_t  n,
const mpz_t  d 
)

References GMP_DIV_TRUNC, and NULL.

Referenced by mpz_rootrem().

Here is the caller graph for this function:

void mpz_tdiv_q_2exp ( mpz_t  r,
const mpz_t  u,
mp_bitcnt_t  cnt 
)

References GMP_DIV_TRUNC.

Referenced by mpz_probab_prime_p(), mpz_rootrem(), and mpz_rshift_ui().

Here is the caller graph for this function:

unsigned long mpz_tdiv_q_ui ( mpz_t  q,
const mpz_t  n,
unsigned long  d 
)

References GMP_DIV_TRUNC, and NULL.

Referenced by mpz_rootrem().

Here is the caller graph for this function:

void mpz_tdiv_qr ( mpz_t  q,
mpz_t  r,
const mpz_t  n,
const mpz_t  d 
)

References GMP_DIV_TRUNC.

Referenced by mpz_gcdext().

Here is the caller graph for this function:

unsigned long mpz_tdiv_qr_ui ( mpz_t  q,
mpz_t  r,
const mpz_t  n,
unsigned long  d 
)

References GMP_DIV_TRUNC.

void mpz_tdiv_r ( mpz_t  r,
const mpz_t  n,
const mpz_t  d 
)

References GMP_DIV_TRUNC, and NULL.

Referenced by mpz_gcd().

Here is the caller graph for this function:

void mpz_tdiv_r_2exp ( mpz_t  r,
const mpz_t  u,
mp_bitcnt_t  cnt 
)

References GMP_DIV_TRUNC.

unsigned long mpz_tdiv_r_ui ( mpz_t  r,
const mpz_t  n,
unsigned long  d 
)

References GMP_DIV_TRUNC, and NULL.

unsigned long mpz_tdiv_ui ( const mpz_t  n,
unsigned long  d 
)

References GMP_DIV_TRUNC, and NULL.

Referenced by mpz_gcd().

Here is the caller graph for this function:

int mpz_tstbit ( const mpz_t  d,
mp_bitcnt_t  bit_index 
)

References GMP_ABS, GMP_LIMB_BITS, and gmp_div_inverse::shift.

Referenced by mpz_clrbit(), mpz_combit(), and mpz_setbit().

Here is the caller graph for this function:

void mpz_ui_pow_ui ( mpz_t  r,
unsigned long  blimb,
unsigned long  e 
)

References mpz_clear(), mpz_init_set_ui(), and mpz_pow_ui().

Here is the call graph for this function:

void mpz_ui_sub ( mpz_t  r,
unsigned long  a,
const mpz_t  b 
)
void mpz_xor ( mpz_t  r,
const mpz_t  u,
const mpz_t  v 
)

References GMP_ABS, MP_SIZE_T_SWAP, MPZ_REALLOC, mpz_set(), MPZ_SRCPTR_SWAP, and rx().

Here is the call graph for this function:

Variable Documentation

const int mp_bits_per_limb = GMP_LIMB_BITS