OpenScop
0.9.0
|
Go to the source code of this file.
typedef union osl_int const* const osl_const_int_const_p |
typedef union osl_int const* osl_const_int_p |
typedef union osl_int const osl_const_int_t |
typedef union osl_int* const osl_int_const_p |
void osl_int_abs | ( | int | precision, |
osl_int_const_p | variable, | ||
osl_const_int_t | value | ||
) |
variable <- | value |;
Definition at line 914 of file int.c.
References OSL_error, OSL_PRECISION_DP, OSL_PRECISION_MP, and OSL_PRECISION_SP.
void osl_int_add | ( | int | precision, |
osl_int_const_p | variable, | ||
osl_const_int_t | val1, | ||
osl_const_int_t | val2 | ||
) |
variable <- val1 + val2;
Definition at line 524 of file int.c.
References OSL_error, osl_int_neg(), osl_int_pos(), OSL_overflow, OSL_PRECISION_DP, OSL_PRECISION_MP, and OSL_PRECISION_SP.
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 <- value + i;
Definition at line 570 of file int.c.
References OSL_error, osl_int_neg(), osl_int_pos(), OSL_overflow, OSL_PRECISION_DP, OSL_PRECISION_MP, and OSL_PRECISION_SP.
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;
Definition at line 167 of file int.c.
References OSL_error, OSL_PRECISION_DP, OSL_PRECISION_MP, and OSL_PRECISION_SP.
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
Definition at line 353 of file int.c.
References OSL_error, OSL_PRECISION_DP, OSL_PRECISION_MP, and OSL_PRECISION_SP.
Referenced by osl_int_free(), osl_relation_free_inside(), and osl_vector_free().
void osl_int_decrement | ( | int | precision, |
osl_int_const_p | variable, | ||
osl_const_int_t | value | ||
) |
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
Definition at line 720 of file int.c.
References OSL_error, OSL_PRECISION_DP, OSL_PRECISION_MP, and OSL_PRECISION_SP.
int osl_int_divisible | ( | int | precision, |
osl_const_int_t | val1, | ||
osl_const_int_t | val2 | ||
) |
((val1 % val2) == 0)
Definition at line 1147 of file int.c.
References OSL_error, OSL_PRECISION_DP, OSL_PRECISION_MP, and OSL_PRECISION_SP.
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.
References OSL_PRECISION_DP, OSL_PRECISION_MP, and OSL_PRECISION_SP.
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)
Definition at line 1007 of file int.c.
References OSL_error, OSL_PRECISION_DP, OSL_PRECISION_MP, and OSL_PRECISION_SP.
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)
q is the quotient
Definition at line 742 of file int.c.
References OSL_error, osl_int_neg(), osl_int_pos(), OSL_PRECISION_DP, OSL_PRECISION_MP, and OSL_PRECISION_SP.
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.
q is the quotient
r is the remainder
Definition at line 811 of file int.c.
References OSL_error, osl_int_floor_div_q(), OSL_PRECISION_DP, OSL_PRECISION_MP, and OSL_PRECISION_SP.
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) (r <- a % b is used)
r is the remainder
Definition at line 782 of file int.c.
References OSL_error, osl_int_floor_div_q(), OSL_PRECISION_DP, OSL_PRECISION_MP, and OSL_PRECISION_SP.
void osl_int_free | ( | int | , |
osl_int_const_p | |||
) |
Definition at line 376 of file int.c.
References osl_int_clear().
void osl_int_gcd | ( | int | const, |
osl_int_const_p | , | ||
osl_const_int_t | , | ||
osl_const_int_t | |||
) |
Compute the gcd (greatest common divisor) of a and b.
Definition at line 869 of file int.c.
References llgcd(), OSL_error, OSL_PRECISION_DP, OSL_PRECISION_MP, and OSL_PRECISION_SP.
double osl_int_get_d | ( | int | precision, |
osl_const_int_t | i | ||
) |
Get a double from the osl_int_t.
[in] | precision | Precision used. |
[in] | i | A osl_int_t |
Definition at line 259 of file int.c.
References OSL_error, OSL_PRECISION_DP, OSL_PRECISION_MP, and OSL_PRECISION_SP.
int osl_int_get_si | ( | int | precision, |
osl_const_int_t | value | ||
) |
return value;
Definition at line 218 of file int.c.
References OSL_error, OSL_overflow, OSL_PRECISION_DP, OSL_PRECISION_MP, and OSL_PRECISION_SP.
Referenced by 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 | ||
) |
void osl_int_init | ( | int | , |
osl_int_const_p | |||
) |
Definition at line 132 of file int.c.
References OSL_error, OSL_malloc, OSL_PRECISION_DP, OSL_PRECISION_MP, and OSL_PRECISION_SP.
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
Definition at line 281 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
Definition at line 290 of file int.c.
References OSL_error, OSL_malloc, OSL_PRECISION_DP, OSL_PRECISION_MP, and OSL_PRECISION_SP.
Referenced by 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. |
Definition at line 90 of file int.c.
References OSL_PRECISION_DP, OSL_PRECISION_MP, and OSL_PRECISION_SP.
osl_int_p osl_int_malloc | ( | int | ) |
Definition at line 155 of file int.c.
References osl_int_init(), and OSL_malloc.
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
Definition at line 839 of file int.c.
References OSL_error, OSL_PRECISION_DP, OSL_PRECISION_MP, and OSL_PRECISION_SP.
int osl_int_mone | ( | int | precision, |
osl_const_int_t | value | ||
) |
(value == -1)
Definition at line 1125 of file int.c.
References OSL_error, OSL_PRECISION_DP, OSL_PRECISION_MP, and OSL_PRECISION_SP.
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;
Definition at line 639 of file int.c.
References OSL_error, osl_int_zero(), OSL_overflow, OSL_PRECISION_DP, OSL_PRECISION_MP, and OSL_PRECISION_SP.
void osl_int_mul_si | ( | int | precision, |
osl_int_const_p | variable, | ||
osl_const_int_t | value, | ||
int | i | ||
) |
variable <- value * i;
Definition at line 679 of file int.c.
References OSL_error, osl_int_zero(), OSL_overflow, OSL_PRECISION_DP, OSL_PRECISION_MP, and OSL_PRECISION_SP.
Referenced by osl_vector_mul_scalar().
int osl_int_ne | ( | int | precision, |
osl_const_int_t | val1, | ||
osl_const_int_t | val2 | ||
) |
(val1 != val2)
Definition at line 1029 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)
Definition at line 1059 of file int.c.
References OSL_error, OSL_PRECISION_DP, OSL_PRECISION_MP, and OSL_PRECISION_SP.
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)
Definition at line 1103 of file int.c.
References OSL_error, OSL_PRECISION_DP, OSL_PRECISION_MP, and OSL_PRECISION_SP.
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;
Definition at line 888 of file int.c.
References OSL_error, OSL_PRECISION_DP, OSL_PRECISION_MP, and OSL_PRECISION_SP.
Referenced by osl_int_sub(), and osl_relation_subexpression().
int osl_int_pos | ( | int | precision, |
osl_const_int_t | value | ||
) |
(value > 0)
Definition at line 1037 of file int.c.
References OSL_error, OSL_PRECISION_DP, OSL_PRECISION_MP, and OSL_PRECISION_SP.
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 389 of file int.c.
References osl_int_sprint(), and OSL_MAX_STRING.
Referenced by osl_relation_idump(), and osl_vector_idump().
void osl_int_set_si | ( | int | precision, |
osl_int_const_p | variable, | ||
int | i | ||
) |
variable = i;
Definition at line 193 of file int.c.
References OSL_error, OSL_PRECISION_DP, OSL_PRECISION_MP, and OSL_PRECISION_SP.
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 | ||
) |
Definition at line 983 of file int.c.
References lllog10(), OSL_error, OSL_PRECISION_DP, OSL_PRECISION_MP, and OSL_PRECISION_SP.
size_t osl_int_size_in_base_2 | ( | int const | precision, |
osl_const_int_t const | value | ||
) |
Definition at line 951 of file int.c.
References lllog2(), OSL_error, OSL_PRECISION_DP, OSL_PRECISION_MP, and OSL_PRECISION_SP.
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 405 of file int.c.
References OSL_error, OSL_FMT_DP, OSL_FMT_MP, OSL_FMT_SP, OSL_PRECISION_DP, OSL_PRECISION_MP, and OSL_PRECISION_SP.
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 437 of file int.c.
References OSL_error, OSL_FMT_TXT_DP, OSL_FMT_TXT_MP, OSL_FMT_TXT_SP, OSL_PRECISION_DP, OSL_PRECISION_MP, and OSL_PRECISION_SP.
Referenced by osl_relation_expression_element().
void osl_int_sread | ( | char ** | , |
int | , | ||
osl_int_const_p | |||
) |
Definition at line 492 of file int.c.
References osl_int_sscanf().
Referenced by osl_relation_pread(), and osl_relation_psread().
int osl_int_sscanf | ( | char * | , |
int | , | ||
osl_int_const_p | |||
) |
Definition at line 463 of file int.c.
References OSL_error, OSL_FMT_TXT_DP, OSL_FMT_TXT_SP, OSL_PRECISION_DP, OSL_PRECISION_MP, and OSL_PRECISION_SP.
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;
Definition at line 620 of file int.c.
References osl_int_add(), osl_int_init(), osl_int_oppose(), and OSL_PRECISION_MP.
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 | ||
) |
var1 <=> var2;
Definition at line 316 of file int.c.
References OSL_error, OSL_PRECISION_DP, OSL_PRECISION_MP, and OSL_PRECISION_SP.
Referenced by osl_relation_swap_constraints().
int osl_int_zero | ( | int | precision, |
osl_const_int_t | value | ||
) |
(value == 0)
Definition at line 1081 of file int.c.
References OSL_error, OSL_PRECISION_DP, OSL_PRECISION_MP, and OSL_PRECISION_SP.
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().