OpenScop
0.9.0
|
Go to the source code of this file.
Functions | |
int | osl_int_is_precision_supported (int precision) |
void | osl_int_dump_precision (FILE *file, int precision) |
void | osl_int_init (int precision, osl_int_const_p variable) |
Initialize the osl int. More... | |
osl_int_p | osl_int_malloc (int precision) |
Initialize the osl int. More... | |
void | osl_int_assign (int precision, osl_int_const_p variable, osl_const_int_t value) |
variable = value More... | |
void | osl_int_set_si (int precision, osl_int_const_p variable, int i) |
variable = i More... | |
int | osl_int_get_si (int precision, osl_const_int_t value) |
Get the value in a int. More... | |
double | osl_int_get_d (int precision, osl_const_int_t i) |
Get the value in a double. More... | |
void | osl_int_init_set (int precision, osl_int_const_p variable, osl_const_int_t i) |
variable = i // including initialization for GMP More... | |
void | osl_int_init_set_si (int precision, osl_int_const_p variable, int i) |
variable = i // including initialization for GMP More... | |
void | osl_int_swap (int precision, osl_int_const_p var1, osl_int_const_p var2) |
Swap the osl ints. More... | |
void | osl_int_clear (int precision, osl_int_const_p variable) |
variable = 0 // including cleaning for GMP More... | |
void | osl_int_free (int precision, osl_int_const_p variable) |
Free thr osl int. More... | |
void | osl_int_print (FILE *file, int precision, osl_const_int_t value) |
void | osl_int_sprint (char *string, int precision, osl_const_int_t value) |
void | osl_int_sprint_txt (char *string, int precision, osl_const_int_t value) |
int | osl_int_sscanf (char *string, int precision, osl_int_const_p i) |
sscanf for osl int More... | |
void | osl_int_sread (char **string, int precision, osl_int_const_p i) |
sread for osl int More... | |
void | osl_int_increment (int precision, osl_int_const_p variable, osl_const_int_t value) |
variable = value + 1 More... | |
void | osl_int_decrement (int precision, osl_int_const_p variable, osl_const_int_t value) |
variable = value - 1 More... | |
void | osl_int_add (int precision, osl_int_const_p variable, osl_const_int_t val1, osl_const_int_t val2) |
variable = val1 + val2 More... | |
void | osl_int_add_si (int precision, osl_int_const_p variable, osl_const_int_t value, int i) |
variable = val1 + i More... | |
void | osl_int_sub (int precision, osl_int_const_p variable, osl_const_int_t val1, osl_const_int_t val2) |
variable = val1 - val2 More... | |
void | osl_int_mul (int precision, osl_int_const_p variable, osl_const_int_t val1, osl_const_int_t val2) |
variable = val1 * val2 More... | |
void | osl_int_mul_si (int precision, osl_int_const_p variable, osl_const_int_t value, int i) |
variable = val1 * i More... | |
void | osl_int_div_exact (int const precision, osl_int_const_p q, osl_const_int_t a, osl_const_int_t b) |
q = a / b More... | |
void | osl_int_floor_div_q (int const precision, osl_int_const_p q, osl_const_int_t a, osl_const_int_t b) |
q = floor(a / b) More... | |
void | osl_int_floor_div_r (int const precision, osl_int_const_p r, osl_const_int_t a, osl_const_int_t b) |
r = a - b * (a / b) More... | |
void | osl_int_floor_div_q_r (int const precision, osl_int_const_p q, osl_int_const_p r, osl_const_int_t a, osl_const_int_t b) |
Compute (q, r) such that a = b * q + r. More... | |
void | osl_int_mod (int const precision, osl_int_const_p mod, osl_const_int_t a, osl_const_int_t b) |
mod = a % b More... | |
static long long int | llgcd (long long int const a, long long int const b) |
void | osl_int_gcd (int const precision, osl_int_const_p gcd, osl_const_int_t a, osl_const_int_t b) |
Compute the gcd (greatest common divisor) of a and b. More... | |
void | osl_int_oppose (int precision, osl_int_const_p variable, osl_const_int_t value) |
variable = - value More... | |
void | osl_int_abs (int precision, osl_int_const_p variable, osl_const_int_t value) |
variable = | value | More... | |
static size_t | lllog2 (long long int x) |
size_t | osl_int_size_in_base_2 (int const precision, osl_const_int_t const value) |
Get the size in base 2. More... | |
static size_t | lllog10 (long long int x) |
size_t | osl_int_size_in_base_10 (int const precision, osl_const_int_t const value) |
Get the size in base 10. More... | |
int | osl_int_eq (int precision, osl_const_int_t val1, osl_const_int_t val2) |
val1 == val2 More... | |
int | osl_int_ne (int precision, osl_const_int_t val1, osl_const_int_t val2) |
val1 != val2 More... | |
int | osl_int_pos (int precision, osl_const_int_t value) |
value > 0 More... | |
int | osl_int_neg (int precision, osl_const_int_t value) |
value < 0 More... | |
int | osl_int_zero (int precision, osl_const_int_t value) |
value == 0 More... | |
int | osl_int_one (int precision, osl_const_int_t value) |
value == 1 More... | |
int | osl_int_mone (int precision, osl_const_int_t value) |
value == -1 More... | |
int | osl_int_divisible (int precision, osl_const_int_t val1, osl_const_int_t val2) |
(val1 % val2) == 0 More... | |
void | osl_int_set_precision (int const precision, int const new_precision, osl_int_p i) |
Change the precision of the osl_int. More... | |
|
static |
Definition at line 948 of file int.c.
Referenced by osl_int_gcd().
|
static |
Definition at line 1067 of file int.c.
Referenced by osl_int_size_in_base_10().
|
static |
Definition at line 1034 of file int.c.
Referenced by osl_int_size_in_base_2().
void osl_int_abs | ( | int | precision, |
osl_int_const_p | variable, | ||
osl_const_int_t | value | ||
) |
void osl_int_add | ( | int | precision, |
osl_int_const_p | variable, | ||
osl_const_int_t | val1, | ||
osl_const_int_t | val2 | ||
) |
variable = val1 + val2
[in] | precision | Precision of the osl int |
[in] | variable | A osl int to save the result |
[in] | val1 | Value of first osl int |
[in] | val2 | Value of second osl int |
Definition at line 581 of file int.c.
References osl_int_neg(), and osl_int_pos().
Referenced by osl_int_sub(), osl_relation_add_vector(), and osl_vector_add().
void osl_int_add_si | ( | int | precision, |
osl_int_const_p | variable, | ||
osl_const_int_t | value, | ||
int | i | ||
) |
variable = val1 + i
[in] | precision | Precision of the osl int |
[in] | variable | A osl int to save the result |
[in] | value | Value of first int in a osl int |
[in] | i | Value of second int in a int |
Definition at line 631 of file int.c.
References osl_int_neg(), and osl_int_pos().
Referenced by osl_int_decrement(), osl_int_increment(), and osl_vector_add_scalar().
void osl_int_assign | ( | int | precision, |
osl_int_const_p | variable, | ||
osl_const_int_t | value | ||
) |
variable = value
[in] | precision | Precision of the osl int |
[in] | variable | A osl int to assign |
[in] | value | Value in a osl int |
Definition at line 179 of file int.c.
Referenced by osl_int_init_set(), osl_relation_add_vector(), osl_relation_clone_nconstraints(), osl_relation_extend_output(), osl_relation_insert_blank_column(), osl_relation_insert_columns(), osl_relation_insert_constraints(), osl_relation_nclone(), osl_relation_remove_column(), osl_relation_remove_row(), osl_relation_replace_constraints(), osl_relation_replace_vector(), osl_relation_sub_vector(), and osl_vector_add_scalar().
void osl_int_clear | ( | int | precision, |
osl_int_const_p | variable | ||
) |
variable = 0 // including cleaning for GMP
[in] | precision | Precision of the osl int |
[in] | variable | A osl int to clear |
Definition at line 382 of file int.c.
Referenced by osl_int_free(), osl_int_set_precision(), osl_relation_free_inside(), and osl_vector_free().
void osl_int_decrement | ( | int | precision, |
osl_int_const_p | variable, | ||
osl_const_int_t | value | ||
) |
variable = value - 1
[in] | precision | Precision of the osl int |
[in] | variable | A osl int to save the result |
[in] | value | Value in a osl int |
Definition at line 568 of file int.c.
References osl_int_add_si().
void osl_int_div_exact | ( | int const | precision, |
osl_int_const_p | q, | ||
osl_const_int_t | a, | ||
osl_const_int_t | b | ||
) |
int osl_int_divisible | ( | int | precision, |
osl_const_int_t | val1, | ||
osl_const_int_t | val2 | ||
) |
(val1 % val2) == 0
[in] | precision | Precision of the osl int |
[in] | val1 | Value of first osl int |
[in] | val2 | Value of second osl int |
Definition at line 1275 of file int.c.
Referenced by osl_relation_get_array_id().
void osl_int_dump_precision | ( | FILE * | file, |
int | precision | ||
) |
osl_int_dump_precision function: this function prints in a human readable fashion the precision corresponding to the "precision" parameter.
[in] | file | The file where to print the precision. |
[in] | precision | The precision to print. |
Definition at line 113 of file int.c.
Referenced by osl_relation_idump(), and osl_vector_idump().
int osl_int_eq | ( | int | precision, |
osl_const_int_t | val1, | ||
osl_const_int_t | val2 | ||
) |
val1 == val2
[in] | precision | Precision of the osl int |
[in] | val1 | Value of first osl int |
[in] | val2 | Value of second osl int |
Definition at line 1112 of file int.c.
Referenced by osl_int_ne().
void osl_int_floor_div_q | ( | int const | precision, |
osl_int_const_p | q, | ||
osl_const_int_t | a, | ||
osl_const_int_t | b | ||
) |
q = floor(a / b)
[in] | precision | Precision of the osl int |
[in] | q | Quotient in a osl int |
[in] | a | Value of first osl int |
[in] | b | Value of second osl int |
Definition at line 821 of file int.c.
References osl_int_neg(), and osl_int_pos().
Referenced by osl_int_floor_div_q_r(), and osl_int_floor_div_r().
void osl_int_floor_div_q_r | ( | int const | precision, |
osl_int_const_p | q, | ||
osl_int_const_p | r, | ||
osl_const_int_t | a, | ||
osl_const_int_t | b | ||
) |
Compute (q, r) such that a = b * q + r.
[in] | precision | Precision of the osl int |
[in] | q | Quotient in a osl int |
[in] | r | Remainder in a osl int |
[in] | a | Value of first osl int |
[in] | b | Value of second osl int |
Definition at line 894 of file int.c.
References osl_int_floor_div_q().
void osl_int_floor_div_r | ( | int const | precision, |
osl_int_const_p | r, | ||
osl_const_int_t | a, | ||
osl_const_int_t | b | ||
) |
r = a - b * (a / b)
[in] | precision | Precision of the osl int |
[in] | r | Remainder in a osl int |
[in] | a | Value of first osl int |
[in] | b | Value of second osl int |
Definition at line 863 of file int.c.
References osl_int_floor_div_q().
void osl_int_free | ( | int | precision, |
osl_int_const_p | variable | ||
) |
Free thr osl int.
[in] | precision | Precision of the osl int |
[in] | variable | A osl int to free |
Definition at line 410 of file int.c.
References osl_int_clear().
void osl_int_gcd | ( | int const | precision, |
osl_int_const_p | gcd, | ||
osl_const_int_t | a, | ||
osl_const_int_t | b | ||
) |
double osl_int_get_d | ( | int | precision, |
osl_const_int_t | i | ||
) |
int osl_int_get_si | ( | int | precision, |
osl_const_int_t | value | ||
) |
Get the value in a int.
[in] | precision | Precision of the osl int |
[in] | value | Value in a osl int |
Definition at line 236 of file int.c.
Referenced by osl_int_set_precision(), osl_relation_add_vector(), osl_relation_get_array_id(), and osl_relation_sub_vector().
void osl_int_increment | ( | int | precision, |
osl_int_const_p | variable, | ||
osl_const_int_t | value | ||
) |
variable = value + 1
[in] | precision | Precision of the osl int |
[in] | variable | A osl int to save the result |
[in] | value | Value in a osl int |
Definition at line 556 of file int.c.
References osl_int_add_si().
void osl_int_init | ( | int | precision, |
osl_int_const_p | variable | ||
) |
Initialize the osl int.
[in] | precision | Precision of the osl int |
[in] | variable | A osl int to initialize |
Definition at line 137 of file int.c.
Referenced by osl_int_init_set(), osl_int_malloc(), and osl_int_sub().
void osl_int_init_set | ( | int | precision, |
osl_int_const_p | variable, | ||
osl_const_int_t | i | ||
) |
variable = i // including initialization for GMP
[in] | precision | Precision of the osl int |
[in] | variable | A osl int to initialize |
[in] | i | Value in a osl int |
Definition at line 302 of file int.c.
References osl_int_assign(), and osl_int_init().
void osl_int_init_set_si | ( | int | precision, |
osl_int_const_p | variable, | ||
int | i | ||
) |
variable = i // including initialization for GMP
[in] | precision | Precision of the osl int |
[in] | variable | A osl int to initialize |
[in] | i | Value in a osl int |
Definition at line 314 of file int.c.
Referenced by osl_int_set_precision(), osl_relation_pmalloc(), and osl_vector_pmalloc().
int osl_int_is_precision_supported | ( | int | precision | ) |
osl_int_is_precision_supported function: this function returns 1 if the precision provided as parameter is supported by the library and 0 otherwise. Possible values for the precision parameter are OSL_PRECISION_SP for 32 bits (single) precision, OSL_PRECISION_DP for 64 bits (double) precision and OSL_PRECISION_MP for multiple precision.
[in] | precision | The precision to check for. |
osl_int_p osl_int_malloc | ( | int | precision | ) |
Initialize the osl int.
[in] | precision | Precision of the osl int |
Definition at line 164 of file int.c.
References osl_int_init().
void osl_int_mod | ( | int const | precision, |
osl_int_const_p | mod, | ||
osl_const_int_t | a, | ||
osl_const_int_t | b | ||
) |
int osl_int_mone | ( | int | precision, |
osl_const_int_t | value | ||
) |
value == -1
[in] | precision | Precision of the osl int |
[in] | value | Value in a osl int |
Definition at line 1249 of file int.c.
Referenced by osl_relation_expression_element(), osl_relation_is_simple_output(), and osl_scop_check_compatible_scoplib().
void osl_int_mul | ( | int | precision, |
osl_int_const_p | variable, | ||
osl_const_int_t | val1, | ||
osl_const_int_t | val2 | ||
) |
variable = val1 * val2
[in] | precision | Precision of the osl int |
[in] | variable | A osl int to save the result |
[in] | val1 | Value of first osl int |
[in] | val2 | Value of second osl int |
Definition at line 708 of file int.c.
References osl_int_zero().
void osl_int_mul_si | ( | int | precision, |
osl_int_const_p | variable, | ||
osl_const_int_t | value, | ||
int | i | ||
) |
variable = val1 * i
[in] | precision | Precision of the osl int |
[in] | variable | A osl int to save the result |
[in] | value | Value of first int in a osl int |
[in] | i | Value of second int in a int |
Definition at line 752 of file int.c.
References osl_int_zero().
Referenced by osl_vector_mul_scalar().
int osl_int_ne | ( | int | precision, |
osl_const_int_t | val1, | ||
osl_const_int_t | val2 | ||
) |
val1 != val2
[in] | precision | Precision of the osl int |
[in] | val1 | Value of first osl int |
[in] | val2 | Value of second osl int |
Definition at line 1138 of file int.c.
References osl_int_eq().
Referenced by osl_relation_part_equal(), and osl_vector_equal().
int osl_int_neg | ( | int | precision, |
osl_const_int_t | value | ||
) |
value < 0
[in] | precision | Precision of the osl int |
[in] | value | Value in a osl int |
Definition at line 1174 of file int.c.
Referenced by osl_int_add(), osl_int_add_si(), osl_int_floor_div_q(), and osl_relation_expression_element().
int osl_int_one | ( | int | precision, |
osl_const_int_t | value | ||
) |
value == 1
[in] | precision | Precision of the osl int |
[in] | value | Value in a osl int |
Definition at line 1224 of file int.c.
Referenced by osl_relation_expression_element(), osl_relation_integrity_check(), and osl_relation_is_simple_output().
void osl_int_oppose | ( | int | precision, |
osl_int_const_p | variable, | ||
osl_const_int_t | value | ||
) |
variable = - value
[in] | precision | Precision of the osl int |
[in] | variable | A osl int to get the oppose |
[in] | value | Value in a osl int |
Definition at line 981 of file int.c.
Referenced by osl_int_sub(), and osl_relation_subexpression().
int osl_int_pos | ( | int | precision, |
osl_const_int_t | value | ||
) |
value > 0
[in] | precision | Precision of the osl int |
[in] | value | Value in a osl int |
Definition at line 1149 of file int.c.
Referenced by osl_int_add(), osl_int_add_si(), osl_int_floor_div_q(), and osl_relation_expression_element().
void osl_int_print | ( | FILE * | file, |
int | precision, | ||
osl_const_int_t | value | ||
) |
osl_int_print function: this function displays an integer value into a file (file, possibly stdout).
file | The file where the integer has to be printed. |
precision | The precision of the integer. |
value | The integer element to print. |
Definition at line 423 of file int.c.
References osl_int_sprint().
Referenced by osl_relation_idump(), and osl_vector_idump().
void osl_int_set_precision | ( | int const | precision, |
int const | new_precision, | ||
osl_int_p | i | ||
) |
Change the precision of the osl_int.
[in] | precision | Precision of the osl int |
[in] | new_precision | Precision wanted for the osl int |
[in,out] | i | A osl int to change the precision |
Definition at line 1306 of file int.c.
References osl_int_clear(), osl_int_get_si(), and osl_int_init_set_si().
Referenced by osl_relation_set_precision().
void osl_int_set_si | ( | int | precision, |
osl_int_const_p | variable, | ||
int | i | ||
) |
variable = i
[in] | precision | Precision of the osl int |
[in] | variable | A osl int to assign |
[in] | i | Value in a int |
Definition at line 208 of file int.c.
Referenced by osl_relation_extend_output(), osl_vector_tag_equality(), and osl_vector_tag_inequality().
size_t osl_int_size_in_base_10 | ( | int const | precision, |
osl_const_int_t const | value | ||
) |
size_t osl_int_size_in_base_2 | ( | int const | precision, |
osl_const_int_t const | value | ||
) |
void osl_int_sprint | ( | char * | string, |
int | precision, | ||
osl_const_int_t | value | ||
) |
osl_int_sprint function: this function prints an integer value into a string, it uses the OpenScop Library formats OSL_FMT_* to format the printing.
string | The string where the integer has to be printed. |
precision | The precision of the integer. |
value | The integer element to print. |
Definition at line 439 of file int.c.
Referenced by osl_int_print(), osl_relation_spprint_polylib(), and osl_relation_spprint_polylib_scoplib().
void osl_int_sprint_txt | ( | char * | string, |
int | precision, | ||
osl_const_int_t | value | ||
) |
osl_int_sprint_txt function: this function is similar to osl_int_sprintf but it prints the value using OSL_TMT_TXT_* formats.
Definition at line 471 of file int.c.
Referenced by osl_relation_expression_element().
void osl_int_sread | ( | char ** | string, |
int | precision, | ||
osl_int_const_p | i | ||
) |
sread for osl int
[in] | string | Integer in a char** |
[in] | precision | Precision of the osl int |
[in] | i | A osl int to save integer |
Definition at line 539 of file int.c.
References osl_int_sscanf().
Referenced by osl_relation_pread(), and osl_relation_psread_polylib().
int osl_int_sscanf | ( | char * | string, |
int | precision, | ||
osl_int_const_p | i | ||
) |
sscanf for osl int
[in] | string | Integer in a char* |
[in] | precision | Precision of the osl int |
[in] | i | A osl int to save integer |
Definition at line 504 of file int.c.
Referenced by osl_int_sread().
void osl_int_sub | ( | int | precision, |
osl_int_const_p | variable, | ||
osl_const_int_t | val1, | ||
osl_const_int_t | val2 | ||
) |
variable = val1 - val2
[in] | precision | Precision of the osl int |
[in] | variable | A osl int to save the result |
[in] | val1 | Value of first osl int |
[in] | val2 | Value of second osl int |
Definition at line 685 of file int.c.
References osl_int_add(), osl_int_init(), and osl_int_oppose().
Referenced by osl_relation_sub_vector(), and osl_vector_sub().
void osl_int_swap | ( | int | precision, |
osl_int_const_p | var1, | ||
osl_int_const_p | var2 | ||
) |
Swap the osl ints.
[in] | precision | Precision of the osl ints |
[in] | var1 | First osl int to swap |
[in] | var2 | Second osl int to swap |
Definition at line 343 of file int.c.
Referenced by osl_relation_swap_constraints().
int osl_int_zero | ( | int | precision, |
osl_const_int_t | value | ||
) |
value == 0
[in] | precision | Precision of the osl int |
[in] | value | Value in a osl int |
Definition at line 1199 of file int.c.
Referenced by osl_int_mul(), osl_int_mul_si(), osl_relation_expression_element(), osl_relation_get_array_id(), osl_relation_integrity_check(), osl_relation_is_simple_output(), osl_relation_sprint_comment(), osl_scop_check_compatible_scoplib(), and osl_vector_is_scalar().