Polly 22.0.0git
gmp_compat.h File Reference
#include "imath.h"
#include "imrat.h"
#include <stddef.h>

Go to the source code of this file.

Macros

#define GMPZAPI(fun)
#define GMPQAPI(fun)

Functions

void GMPQAPI clear (mp_rat x)
int GMPQAPI cmp (mp_rat op1, mp_rat op2)
void GMPQAPI init (mp_rat x)
void GMPQAPI mul (mp_rat product, mp_rat multiplier, mp_rat multiplicand)
void GMPQAPI set (mp_rat rop, mp_rat op)
void GMPZAPI abs (mp_int rop, mp_int op)
void GMPZAPI add (mp_int rop, mp_int op1, mp_int op2)
void GMPZAPI clear (mp_int x)
int GMPZAPI cmp_si (mp_int op1, long op2)
int GMPZAPI cmpabs (mp_int op1, mp_int op2)
int GMPZAPI cmp (mp_int op1, mp_int op2)
void GMPZAPI init (mp_int x)
void GMPZAPI mul (mp_int rop, mp_int op1, mp_int op2)
void GMPZAPI neg (mp_int rop, mp_int op)
void GMPZAPI set_si (mp_int rop, long op)
void GMPZAPI set (mp_int rop, mp_int op)
void GMPZAPI sub (mp_int rop, mp_int op1, mp_int op2)
void GMPZAPI swap (mp_int rop1, mp_int rop2)
int GMPQAPI sgn (mp_rat op)
int GMPZAPI sgn (mp_int op)
void GMPQAPI set_ui (mp_rat rop, unsigned long op1, unsigned long op2)
void GMPZAPI set_ui (mp_int rop, unsigned long op)
mp_int GMPQAPI denref (mp_rat op)
mp_int GMPQAPI numref (mp_rat op)
void GMPQAPI canonicalize (mp_rat op)
void GMPZAPI addmul (mp_int rop, mp_int op1, mp_int op2)
void GMPZAPI divexact (mp_int q, mp_int n, mp_int d)
int GMPZAPI divisible_p (mp_int n, mp_int d)
void GMPZAPI submul (mp_int rop, mp_int op1, mp_int op2)
void GMPZAPI add_ui (mp_int rop, mp_int op1, unsigned long op2)
void GMPZAPI divexact_ui (mp_int q, mp_int n, unsigned long d)
void GMPZAPI mul_ui (mp_int rop, mp_int op1, unsigned long op2)
void GMPZAPI pow_ui (mp_int rop, mp_int base, unsigned long exp)
void GMPZAPI sub_ui (mp_int rop, mp_int op1, unsigned long op2)
unsigned long GMPZAPI fdiv_q_ui (mp_int q, mp_int n, unsigned long d)
size_t GMPZAPI sizeinbase (mp_int op, int base)
void GMPZAPI gcd (mp_int rop, mp_int op1, mp_int op2)
char *GMPZAPI get_str (char *str, int radix, mp_int op)
char *GMPQAPI get_str (char *str, int radix, mp_rat op)
int GMPZAPI set_str (mp_int rop, char *str, int base)
int GMPQAPI set_str (mp_rat rop, char *str, int base)
unsigned long GMPZAPI get_ui (mp_int op)
long GMPZAPI get_si (mp_int op)
void GMPZAPI lcm (mp_int rop, mp_int op1, mp_int op2)
void GMPZAPI mul_2exp (mp_int rop, mp_int op1, unsigned long op2)
void GMPZAPI cdiv_q (mp_int q, mp_int n, mp_int d)
void GMPZAPI fdiv_q (mp_int q, mp_int n, mp_int d)
void GMPZAPI fdiv_r (mp_int r, mp_int n, mp_int d)
void GMPZAPI tdiv_q (mp_int q, mp_int n, mp_int d)
void *GMPZAPI export (void *rop, size_t *countp, int order, size_t size, int endian, size_t nails, mp_int op)
void GMPZAPI import (mp_int rop, size_t count, int order, size_t size, int endian, size_t nails, const void *op)

Macro Definition Documentation

◆ GMPQAPI

#define GMPQAPI ( fun)
Value:
impq_ ## fun

Definition at line 34 of file imath/gmp_compat.h.

◆ GMPZAPI

#define GMPZAPI ( fun)
Value:
impz_ ## fun

Definition at line 33 of file imath/gmp_compat.h.

Referenced by fdiv_q_ui(), fdiv_r(), and get_str().

Function Documentation

◆ abs()

void GMPZAPI abs ( mp_int rop,
mp_int op )

Definition at line 75 of file imath/gmp_compat.c.

References abs(), CHECK, mp_int_abs, and op.

Referenced by abs(), error_string(), isl_sioimath_lcm(), main(), parse_int_values(), and parse_rat_values().

◆ add()

void GMPZAPI add ( mp_int rop,
mp_int op1,
mp_int op2 )

◆ add_ui()

void GMPZAPI add_ui ( mp_int rop,
mp_int op1,
unsigned long op2 )

Definition at line 207 of file imath/gmp_compat.c.

References add_ui(), CHECK, mp_int_add, mp_int_clear, and mp_int_init_uvalue.

Referenced by add_ui().

◆ addmul()

void GMPZAPI addmul ( mp_int rop,
mp_int op1,
mp_int op2 )

Definition at line 154 of file imath/gmp_compat.c.

References addmul(), CHECK, mp_int_add, mp_int_clear, mp_int_init, and mp_int_mul.

Referenced by addmul().

◆ canonicalize()

void GMPQAPI canonicalize ( mp_rat op)

Definition at line 146 of file imath/gmp_compat.c.

References canonicalize, CHECK, mp_rat_reduce, and op.

◆ cdiv_q()

void GMPZAPI cdiv_q ( mp_int q,
mp_int n,
mp_int d )

◆ clear() [1/2]

void GMPZAPI clear ( mp_int x)

Definition at line 83 of file imath/gmp_compat.c.

References clear(), and mp_int_clear.

◆ clear() [2/2]

void GMPQAPI clear ( mp_rat x)

Definition at line 58 of file imath/gmp_compat.c.

References clear(), and mp_rat_clear.

Referenced by clear(), and clear().

◆ cmp() [1/2]

int GMPZAPI cmp ( mp_int op1,
mp_int op2 )

Definition at line 96 of file imath/gmp_compat.c.

References cmp(), and mp_int_compare.

◆ cmp() [2/2]

◆ cmp_si()

int GMPZAPI cmp_si ( mp_int op1,
long op2 )

Definition at line 86 of file imath/gmp_compat.c.

References cmp_si(), and mp_int_compare_value.

Referenced by cmp_si().

◆ cmpabs()

int GMPZAPI cmpabs ( mp_int op1,
mp_int op2 )

Definition at line 91 of file imath/gmp_compat.c.

References cmpabs(), and mp_int_compare_unsigned.

Referenced by cmpabs().

◆ denref()

mp_int GMPQAPI denref ( mp_rat op)

Definition at line 140 of file imath/gmp_compat.c.

References denref(), mp_rat_denom_ref, and op.

Referenced by denref().

◆ divexact()

void GMPZAPI divexact ( mp_int q,
mp_int n,
mp_int d )

Definition at line 166 of file imath/gmp_compat.c.

References CHECK, divexact(), mp_int_div, and n.

Referenced by divexact().

◆ divexact_ui()

void GMPZAPI divexact_ui ( mp_int q,
mp_int n,
unsigned long d )

Definition at line 219 of file imath/gmp_compat.c.

References CHECK, divexact_ui(), mp_int_clear, mp_int_div, mp_int_init_uvalue, and n.

Referenced by divexact_ui().

◆ divisible_p()

int GMPZAPI divisible_p ( mp_int n,
mp_int d )

Definition at line 173 of file imath/gmp_compat.c.

References CHECK, divisible_p(), mp_int_clear, mp_int_compare_zero, mp_int_div, mp_int_init, and n.

Referenced by divisible_p().

◆ export()

void *GMPZAPI export ( void * rop,
size_t * countp,
int order,
size_t size,
int endian,
size_t nails,
mp_int op )

◆ fdiv_q()

void GMPZAPI fdiv_q ( mp_int q,
mp_int n,
mp_int d )

◆ fdiv_q_ui()

unsigned long GMPZAPI fdiv_q_ui ( mp_int q,
mp_int n,
unsigned long d )

◆ fdiv_r()

void GMPZAPI fdiv_r ( mp_int r,
mp_int n,
mp_int d )

Definition at line 593 of file imath/gmp_compat.c.

References CHECK, fdiv_q(), fdiv_r(), GMPZAPI, mp_int_clear, mp_int_init, mp_int_init_copy, mp_int_mul, mp_int_sub, and n.

Referenced by fdiv_q_ui(), and fdiv_r().

◆ gcd()

◆ get_si()

long GMPZAPI get_si ( mp_int op)

Definition at line 435 of file imath/gmp_compat.c.

References CHECK, get_long_bits(), get_si(), mp_int_to_int, MP_NEG, MP_OK, MP_RANGE, MP_SIGN(), op, and res.

Referenced by get_si().

◆ get_str() [1/2]

char *GMPZAPI get_str ( char * str,
int radix,
mp_int op )

Definition at line 289 of file imath/gmp_compat.c.

References CHECK, get_str(), mp_int_string_len, mp_int_to_string, op, and str.

Referenced by get_str(), and get_str().

◆ get_str() [2/2]

char *GMPQAPI get_str ( char * str,
int radix,
mp_rat op )

◆ get_ui()

unsigned long GMPZAPI get_ui ( mp_int op)

Definition at line 419 of file imath/gmp_compat.c.

References CHECK, get_long_bits(), get_ui(), mp_int_to_uint, MP_OK, MP_RANGE, op, and res.

Referenced by get_ui().

◆ import()

void GMPZAPI import ( mp_int rop,
size_t count,
int order,
size_t size,
int endian,
size_t nails,
const void * op )

◆ init() [1/2]

void GMPZAPI init ( mp_int x)

Definition at line 99 of file imath/gmp_compat.c.

References CHECK, init(), and mp_int_init.

◆ init() [2/2]

◆ lcm()

void GMPZAPI lcm ( mp_int rop,
mp_int op1,
mp_int op2 )

Definition at line 466 of file imath/gmp_compat.c.

References CHECK, lcm(), mp_int_abs, mp_int_compare_zero, mp_int_lcm, and mp_int_zero.

Referenced by add_vertex(), isl_seq_lcm(), isl_vec_lcm(), and lcm().

◆ mul() [1/2]

void GMPZAPI mul ( mp_int rop,
mp_int op1,
mp_int op2 )

Definition at line 102 of file imath/gmp_compat.c.

References CHECK, mp_int_mul, and mul().

◆ mul() [2/2]

void GMPQAPI mul ( mp_rat product,
mp_rat multiplier,
mp_rat multiplicand )

Definition at line 67 of file imath/gmp_compat.c.

References CHECK, mp_rat_mul, and mul().

Referenced by arctan(), mul(), and mul().

◆ mul_2exp()

void GMPZAPI mul_2exp ( mp_int rop,
mp_int op1,
unsigned long op2 )

Definition at line 481 of file imath/gmp_compat.c.

References CHECK, mp_int_compare_zero, mp_int_mul_pow2, mp_int_zero, and mul_2exp().

Referenced by mul_2exp().

◆ mul_ui()

void GMPZAPI mul_ui ( mp_int rop,
mp_int op1,
unsigned long op2 )

Definition at line 230 of file imath/gmp_compat.c.

References CHECK, mp_int_clear, mp_int_init_uvalue, mp_int_mul, and mul_ui().

Referenced by mul_ui().

◆ neg()

◆ numref()

mp_int GMPQAPI numref ( mp_rat op)

Definition at line 143 of file imath/gmp_compat.c.

References mp_rat_numer_ref, numref(), and op.

Referenced by numref().

◆ pow_ui()

void GMPZAPI pow_ui ( mp_int rop,
mp_int base,
unsigned long exp )

◆ set() [1/2]

void GMPZAPI set ( mp_int rop,
mp_int op )

Definition at line 113 of file imath/gmp_compat.c.

References CHECK, mp_int_copy, op, and set.

◆ set() [2/2]

void GMPQAPI set ( mp_rat rop,
mp_rat op )

Definition at line 72 of file imath/gmp_compat.c.

References CHECK, mp_rat_copy, op, and set.

◆ set_si()

void GMPZAPI set_si ( mp_int rop,
long op )

Definition at line 110 of file imath/gmp_compat.c.

References CHECK, mp_int_set_value, op, and set_si().

Referenced by set_si().

◆ set_str() [1/2]

int GMPZAPI set_str ( mp_int rop,
char * str,
int base )

Definition at line 350 of file imath/gmp_compat.c.

References mp_int_read_string, MP_OK, res, set_str(), and str.

Referenced by set_str(), and set_str().

◆ set_str() [2/2]

int GMPQAPI set_str ( mp_rat rop,
char * str,
int base )

◆ set_ui() [1/2]

void GMPZAPI set_ui ( mp_int rop,
unsigned long op )

Definition at line 135 of file imath/gmp_compat.c.

References CHECK, mp_int_set_uvalue, op, and set_ui().

◆ set_ui() [2/2]

void GMPQAPI set_ui ( mp_rat rop,
unsigned long op1,
unsigned long op2 )

Definition at line 130 of file imath/gmp_compat.c.

References CHECK, mp_rat_set_uvalue, and set_ui().

Referenced by set_ui(), and set_ui().

◆ sgn() [1/2]

int GMPZAPI sgn ( mp_int op)

Definition at line 127 of file imath/gmp_compat.c.

References mp_int_compare_zero, op, and sgn().

◆ sgn() [2/2]

◆ sizeinbase()

size_t GMPZAPI sizeinbase ( mp_int op,
int base )

Definition at line 802 of file imath/gmp_compat.c.

References CHECK, mp_int_compare_zero, mp_int_string_len, MP_OK, op, res, size, and sizeinbase().

Referenced by sizeinbase().

◆ sub()

◆ sub_ui()

void GMPZAPI sub_ui ( mp_int rop,
mp_int op1,
unsigned long op2 )

Definition at line 259 of file imath/gmp_compat.c.

References CHECK, mp_int_clear, mp_int_init_uvalue, mp_int_sub, and sub_ui().

Referenced by sub_ui().

◆ submul()

void GMPZAPI submul ( mp_int rop,
mp_int op1,
mp_int op2 )

Definition at line 195 of file imath/gmp_compat.c.

References CHECK, mp_int_clear, mp_int_init, mp_int_mul, mp_int_sub, and submul().

Referenced by submul().

◆ swap()

void GMPZAPI swap ( mp_int rop1,
mp_int rop2 )

Definition at line 121 of file imath/gmp_compat.c.

References mp_int_swap, and swap().

Referenced by isl_basic_map_gauss5(), isl_basic_map_has_single_reference(), and swap().

◆ tdiv_q()

void GMPZAPI tdiv_q ( mp_int q,
mp_int n,
mp_int d )

Definition at line 623 of file imath/gmp_compat.c.

References CHECK, mp_int_div, n, and tdiv_q().

Referenced by tdiv_q().