PIPS
|
Go to the source code of this file.
Data Structures | |
struct | frac |
struct | col |
Macros | |
#define | CURRENT_FUNCTION "<unknown>" |
Warning! Do not modify this file that is automatically generated! More... | |
#define | PUSH_TIMEOUT_ENV(env) push_timeout_env(env, CURRENT_FUNCTION, __FILE__, __LINE__) |
#define | POP_TIMEOUT_ENV(env) pop_timeout_env(env, CURRENT_FUNCTION, __FILE__, __LINE__) |
#define | PUSH_TIMEOUT(delay) push_timeout(delay, CURRENT_FUNCTION, __FILE__, __LINE__) |
#define | POP_TIMEOUT() pop_timeout(CURRENT_FUNCTION, __FILE__, __LINE__) |
#define | __LONG_LONG_MAX__ 9223372036854775807LL |
put there because I cannot have these constants with ansi options. More... | |
#define | LONG_LONG_MAX __LONG_LONG_MAX__ |
#define | LONG_LONG_MIN (-LONG_LONG_MAX-1) |
#define | ULONG_LONG_MAX (LONG_LONG_MAX * 2ULL + 1) |
#define | LINEAR_VALUE_STRING "int" |
default: LINEAR_VALUE_IS_INT More... | |
#define | VALUE_FMT "%d" |
#define | VALUE_CONST(val) (val) |
#define | VALUE_NAN INT_MIN |
#define | VALUE_MIN (INT_MIN+1) |
#define | VALUE_MAX INT_MAX |
#define | VALUE_ZERO 0 |
#define | VALUE_ONE 1 |
#define | VALUE_MONE -1 |
#define | VALUE_TO_LONG(val) ((long)(val)) |
#define | VALUE_TO_INT(val) ((int)(val)) |
#define | VALUE_TO_FLOAT(val) ((float)(val)) |
#define | VALUE_TO_DOUBLE(val) ((double)(val)) |
#define | int_to_value(i) ((Value)(i)) |
end LINEAR_VALUE_IS_INT More... | |
#define | long_to_value(l) ((Value)(l)) |
#define | float_to_value(f) ((Value)(f)) |
#define | double_to_value(d) ((Value)(d)) |
#define | value_eq(v1, v2) ((v1)==(v2)) |
bool operators on values More... | |
#define | value_ne(v1, v2) ((v1)!=(v2)) |
#define | value_gt(v1, v2) ((v1)>(v2)) |
#define | value_ge(v1, v2) ((v1)>=(v2)) |
#define | value_lt(v1, v2) ((v1)<(v2)) |
#define | value_le(v1, v2) ((v1)<=(v2)) |
#define | value_sign(v) (value_eq(v,VALUE_ZERO)?0:value_lt(v,VALUE_ZERO)?-1:1) |
trian operators on values More... | |
#define | value_compare(v1, v2) (value_eq(v1,v2)?0:value_lt(v1,v2)?-1:1) |
#define | value_plus(v1, v2) ((v1)+(v2)) |
binary operators on values More... | |
#define | value_div(v1, v2) ((v1)/(v2)) |
#define | value_mod(v1, v2) ((v1)%(v2)) |
#define | value_direct_multiply(v1, v2) ((v1)*(v2)) /**direct! */ |
#define | value_minus(v1, v2) ((v1)-(v2)) |
#define | value_pdiv(v1, v2) (divide(v1,v2)) |
#define | value_pmod(v1, v2) (modulo(v1,v2)) |
#define | value_min(v1, v2) (value_le(v1,v2)? (v1): (v2)) |
#define | value_max(v1, v2) (value_ge(v1,v2)? (v1): (v2)) |
#define | value_or(v1, v2) ((v1)|(v2)) |
#define | value_and(v1, v2) ((v1)&(v2)) |
#define | value_lshift(v1, v2) ((v1)<<(v2)) |
#define | value_rshift(v1, v2) ((v1)>>(v2)) |
#define | value_assign(ref, val) (ref=(val)) |
assigments More... | |
#define | value_addto(ref, val) (ref+=(val)) |
#define | value_increment(ref) (ref++) |
#define | value_direct_product(ref, val) (ref*=(val)) /**direct! */ |
#define | value_multiply(ref, val) value_assign(ref,value_mult(ref,val)) |
#define | value_substract(ref, val) (ref-=(val)) |
#define | value_decrement(ref) (ref--) |
#define | value_division(ref, val) (ref/=(val)) |
#define | value_modulus(ref, val) (ref%=(val)) |
#define | value_pdivision(ref, val) value_assign(ref,value_pdiv(ref,val)) |
#define | value_oppose(ref) value_assign(ref,value_uminus(ref)) |
#define | value_absolute(ref) value_assign(ref,value_abs(ref)) |
#define | value_minimum(ref, val) value_assign(ref,value_min(ref,val)) |
#define | value_maximum(ref, val) value_assign(ref,value_max(ref,val)) |
#define | value_orto(ref, val) (ref |= (val)) |
#define | value_andto(ref, val) (ref &= (val)) |
#define | value_uminus(val) (-(val)) |
unary operators on values More... | |
#define | value_not(val) (~(val)) |
#define | value_abs(val) |
#define | value_pos_p(val) value_gt(val,VALUE_ZERO) |
#define | value_neg_p(val) value_lt(val,VALUE_ZERO) |
#define | value_posz_p(val) value_ge(val,VALUE_ZERO) |
#define | value_negz_p(val) value_le(val,VALUE_ZERO) |
#define | value_zero_p(val) value_eq(val,VALUE_ZERO) |
#define | value_notzero_p(val) value_ne(val,VALUE_ZERO) |
#define | value_one_p(val) value_eq(val,VALUE_ONE) |
#define | value_notone_p(val) value_ne(val,VALUE_ONE) |
#define | value_mone_p(val) value_eq(val,VALUE_MONE) |
#define | value_notmone_p(val) value_ne(val,VALUE_MONE) |
#define | value_min_p(val) value_eq(val,VALUE_MIN) |
#define | value_max_p(val) value_eq(val,VALUE_MAX) |
#define | value_notmin_p(val) value_ne(val,VALUE_MIN) |
#define | value_notmax_p(val) value_ne(val,VALUE_MAX) |
#define | value_protected_hard_idiv_multiply(v, w, throw) |
(|v| < MAX / |w|) => v*w is okay I could check ((v*w)/w)==v but a tmp would be useful More... | |
#define | value_protected_multiply(v, w, throw) value_protected_hard_idiv_multiply(v,w,throw) |
is a software idiv is assumed, quick check performed first More... | |
#define | value_protected_mult(v, w) value_protected_multiply(v,w,THROW(overflow_error)) |
protected versions More... | |
#define | value_protected_product(v, w) v=value_protected_mult(v,w) |
#define | value_mult(v, w) |
whether the default is protected or not this define makes no sense any more... More... | |
#define | value_product(v, w) v=value_mult(v,w) |
#define | ABS(x) (((x)>=0) ? (x) : -(x)) |
was: #define value_mult(v,w) value_direct_multiply(v,w) #define value_product(v,w) value_direct_product(v,w) could be: protected versions... More... | |
#define | MIN(x, y) (((x)>=(y))?(y):(x)) |
minimum and maximum if they are defined somewhere else, they are very likely to be defined the same way. More... | |
#define | MAX(x, y) (((x)>=(y))?(x):(y)) |
#define | SIGN(x) (((x)>0)? 1 : ((x)==0? 0 : -1)) |
signe d'un entier: -1, 0 ou 1 More... | |
#define | DIVIDE(x, y) |
division avec reste toujours positif basee sur les equations: a/(-b) = - (a/b) (-a)/b = - ((a+b-1)/b) ou a et b sont des entiers positifs More... | |
#define | POSITIVE_DIVIDE(x, y) ((x)>0 ? (x)/(y) : - (-(x)+(y)-1)/(y)) |
division avec reste toujours positif quand y est positif: assert(y>=0) More... | |
#define | MODULO(x, y) ((y)>0 ? POSITIVE_MODULO(x,y) : POSITIVE_MODULO(-x,-y)) |
modulo a resultat toujours positif More... | |
#define | POSITIVE_MODULO(x, y) |
modulo par rapport a un nombre positif: assert(y>=0) More... | |
#define | pgcd(a, b) pgcd_slow(a,b) |
Pour la recherche de performance, selection d'une implementation particuliere des fonctions. More... | |
#define | divide(a, b) DIVIDE(a,b) |
#define | modulo(a, b) MODULO(a,b) |
#define | _has_yy_size_t |
Typedefs | |
typedef int | Value |
typedef struct col | tableau |
typedef size_t | yy_size_t |
Functions | |
void | __attribute__ ((weak, noreturn)) throw_exception(const int |
Value | abs_ofl_ctrl (Value, int) |
_has_yy_size_t More... | |
Value | absval_ofl (Value) |
int absval_ofl(int i): absolute value of i (SUN version) More... | |
Value | absval (Value) |
int absval(int i): absolute value of i (SUN version) More... | |
Value | divide_fast (Value, Value) |
divide.c More... | |
Value | divide_slow (Value, Value) |
Value | exponentiate (Value, int) |
exp.c More... | |
Value | modulo_fast (Value, Value) |
modulo.c More... | |
Value | pgcd_slow (Value, Value) |
pgcd.c More... | |
Value | pgcd_fast (Value, Value) |
int pgcd_fast(int a, int b): calcul iteratif du pgcd de deux entiers; le pgcd retourne est toujours positif; il n'est pas defini si a et b sont nuls (abort); More... | |
Value | pgcd_interne (Value, Value) |
int pgcd_interne(int a, int b): calcul iteratif du pgcd de deux entiers strictement positifs tels que a > b; le pgcd retourne est toujours positif; More... | |
Value | gcd_subtract (Value, Value) |
int gcd_subtract(int a, int b): find the gcd (pgcd) of two integers More... | |
Value | vecteur_bezout (Value[], Value[], int) |
int vecteur_bezout(int u[], int v[], int l): calcul du vecteur v qui verifie le theoreme de bezout pour le vecteur u; les vecteurs u et v sont de dimension l More... | |
Value | bezout (Value, Value, Value *, Value *) |
int bezout(int a, int b, int *x, int *y): calcule x et y, les deux nombres qui verifient le theoreme de Bezout pour a et b; le pgcd de a et b est retourne par valeur More... | |
Value | bezout_grl (Value, Value, Value *, Value *) |
int bezout_grl(int a, int b, int *x, int *y): calcule x et y, les deux entiers quelconcs qui verifient le theoreme de Bezout pour a et b; le pgcd de a et b est retourne par valeur More... | |
Value | ppcm (Value, Value) |
ppcm.c More... | |
void | print_Value (Value) |
io.c More... | |
void | fprint_Value (FILE *, Value) |
void | fprint_string_Value (FILE *, char *, Value) |
void | sprint_Value (char *, Value) |
int | fscan_Value (FILE *, Value *) |
int | scan_Value (Value *) |
int | sscan_Value (char *, Value *) |
char * | Value_to_string (Value) |
char const * | get_exception_name (const linear_exception_t) |
void | linear_reset_error_counters (void) |
reset linear counters More... | |
unsigned int | linear_error_count (void) |
return number of linear errors may be used as a test after a reset to know whether new errors occured. More... | |
void | linear_get_error_counts (unsigned int *, unsigned int *, unsigned int *) |
return various errors counts through unsigned int pointer overflow, simplex & misc (aka others) NULL pointers are ignored More... | |
void | set_exception_callbacks (exception_callback_t, exception_callback_t) |
void | dump_exception_stack_to_file (FILE *) |
void | dump_exception_stack (void) |
jmp_buf * | linear_push_exception_on_stack (const int, const char *, const char *, const int) |
jmp_buf * | push_exception_on_stack (const int, const char *, const char *, const int) |
void | linear_pop_exception_from_stack (const int, const char *, const char *, const int) |
void | pop_exception_from_stack (const int, const char *, const char *, const int) |
void | linear_throw_exception (const int, const char *, const char *, const int) |
void | throw_exception (const int, const char *, const char *, const int) |
void | linear_initialize_exception_stack (unsigned int, exception_callback_t, exception_callback_t) |
bool | linear_with_gmp (void) |
whether linear can use gmp (i.e. More... | |
bool | linear_require_gmp (void) |
whether linear is asked to use gmp if possible (env variable) More... | |
bool | linear_use_gmp (void) |
whether linear is to use gmp More... | |
void | set_timeout_callback (timeout_callback_f) |
void | push_timeout (const unsigned int, const char *, const char *, const int) |
bool | push_timeout_env (const char *, const char *, const char *, const int) |
void | pop_timeout (const char *, const char *, const int) |
void | pop_timeout_env (const char *, const char *, const char *, const int) |
int | value_comparison (Value, Value) |
value.c More... | |
Variables | |
void const char const char const | int |
int | linear_assertion_result |
errors.c More... | |
linear_exception_t | the_last_just_thrown_exception |
int | linear_number_of_exception_thrown |
#define __LONG_LONG_MAX__ 9223372036854775807LL |
put there because I cannot have these constants with ansi options.
would fix on solaris: #define LONG_LONG_MAX LLONG_MAX #define LONG_LONG_MIN LLONG_MIN
Definition at line 98 of file arithmetique.h.
#define _has_yy_size_t |
Definition at line 597 of file arithmetique.h.
was: #define value_mult(v,w) value_direct_multiply(v,w) #define value_product(v,w) value_direct_product(v,w) could be: protected versions...
LINEAR_VALUE_IS_CHARS is used for type checking. some operations are not allowed on (char*), thus they are switched to some other operation here... valeur absolue
Definition at line 537 of file arithmetique.h.
#define CURRENT_FUNCTION "<unknown>" |
Warning! Do not modify this file that is automatically generated!
Modify src/Libs/arithmetique/arithmetique-local.h instead, to add your own modifications. header file built by cproto arithmetique-local.h package arithmetique
Francois Irigoin, mai 1989
Modifications
Indeed, we cannot switch easily to bignums that need constructors dans destructors... That would lead to too many modifications... C++ would make things easier and cleaner...
Fabien COELHO for FILE * to be included for _MIN and _MAX: include <limits.h>
Definition at line 72 of file arithmetique.h.
#define divide | ( | a, | |
b | |||
) | DIVIDE(a,b) |
Definition at line 584 of file arithmetique.h.
#define DIVIDE | ( | x, | |
y | |||
) |
division avec reste toujours positif basee sur les equations: a/(-b) = - (a/b) (-a)/b = - ((a+b-1)/b) ou a et b sont des entiers positifs
Definition at line 560 of file arithmetique.h.
#define double_to_value | ( | d | ) | ((Value)(d)) |
Definition at line 328 of file arithmetique.h.
Definition at line 327 of file arithmetique.h.
#define int_to_value | ( | i | ) | ((Value)(i)) |
#define LINEAR_VALUE_STRING "int" |
default: LINEAR_VALUE_IS_INT
Definition at line 303 of file arithmetique.h.
#define LONG_LONG_MAX __LONG_LONG_MAX__ |
Definition at line 101 of file arithmetique.h.
#define LONG_LONG_MIN (-LONG_LONG_MAX-1) |
Definition at line 103 of file arithmetique.h.
#define long_to_value | ( | l | ) | ((Value)(l)) |
Definition at line 326 of file arithmetique.h.
Definition at line 548 of file arithmetique.h.
minimum and maximum if they are defined somewhere else, they are very likely to be defined the same way.
Thus the previous def is not overwritten.
Definition at line 545 of file arithmetique.h.
#define modulo | ( | a, | |
b | |||
) | MODULO(a,b) |
Definition at line 586 of file arithmetique.h.
#define MODULO | ( | x, | |
y | |||
) | ((y)>0 ? POSITIVE_MODULO(x,y) : POSITIVE_MODULO(-x,-y)) |
modulo a resultat toujours positif
Definition at line 567 of file arithmetique.h.
#define pgcd | ( | a, | |
b | |||
) | pgcd_slow(a,b) |
Pour la recherche de performance, selection d'une implementation particuliere des fonctions.
Definition at line 582 of file arithmetique.h.
#define POP_TIMEOUT | ( | ) | pop_timeout(CURRENT_FUNCTION, __FILE__, __LINE__) |
Definition at line 85 of file arithmetique.h.
#define POP_TIMEOUT_ENV | ( | env | ) | pop_timeout_env(env, CURRENT_FUNCTION, __FILE__, __LINE__) |
Definition at line 79 of file arithmetique.h.
division avec reste toujours positif quand y est positif: assert(y>=0)
Definition at line 564 of file arithmetique.h.
#define POSITIVE_MODULO | ( | x, | |
y | |||
) |
modulo par rapport a un nombre positif: assert(y>=0)
Ce n'est pas la macro la plus efficace que j'aie jamais ecrite: il faut faire, dans le pire des cas, deux appels a la routine .rem, qui n'est surement pas plus cablee que la division ou la multiplication
Definition at line 575 of file arithmetique.h.
#define PUSH_TIMEOUT | ( | delay | ) | push_timeout(delay, CURRENT_FUNCTION, __FILE__, __LINE__) |
Definition at line 82 of file arithmetique.h.
#define PUSH_TIMEOUT_ENV | ( | env | ) | push_timeout_env(env, CURRENT_FUNCTION, __FILE__, __LINE__) |
Definition at line 76 of file arithmetique.h.
signe d'un entier: -1, 0 ou 1
Definition at line 552 of file arithmetique.h.
#define ULONG_LONG_MAX (LONG_LONG_MAX * 2ULL + 1) |
Definition at line 105 of file arithmetique.h.
#define value_abs | ( | val | ) |
Definition at line 387 of file arithmetique.h.
#define value_absolute | ( | ref | ) | value_assign(ref,value_abs(ref)) |
Definition at line 377 of file arithmetique.h.
Definition at line 367 of file arithmetique.h.
#define value_and | ( | v1, | |
v2 | |||
) | ((v1)&(v2)) |
Definition at line 360 of file arithmetique.h.
Definition at line 381 of file arithmetique.h.
assigments
Definition at line 366 of file arithmetique.h.
Definition at line 342 of file arithmetique.h.
#define VALUE_CONST | ( | val | ) | (val) |
Definition at line 306 of file arithmetique.h.
Definition at line 372 of file arithmetique.h.
#define value_direct_multiply | ( | v1, | |
v2 | |||
) | ((v1)*(v2)) /**direct! */ |
Definition at line 353 of file arithmetique.h.
Definition at line 369 of file arithmetique.h.
#define value_div | ( | v1, | |
v2 | |||
) | ((v1)/(v2)) |
Definition at line 351 of file arithmetique.h.
Definition at line 373 of file arithmetique.h.
#define value_eq | ( | v1, | |
v2 | |||
) | ((v1)==(v2)) |
bool operators on values
Definition at line 332 of file arithmetique.h.
#define VALUE_FMT "%d" |
Definition at line 305 of file arithmetique.h.
#define value_ge | ( | v1, | |
v2 | |||
) | ((v1)>=(v2)) |
Definition at line 335 of file arithmetique.h.
#define value_gt | ( | v1, | |
v2 | |||
) | ((v1)>(v2)) |
Definition at line 334 of file arithmetique.h.
Definition at line 368 of file arithmetique.h.
#define value_le | ( | v1, | |
v2 | |||
) | ((v1)<=(v2)) |
Definition at line 337 of file arithmetique.h.
#define value_lshift | ( | v1, | |
v2 | |||
) | ((v1)<<(v2)) |
Definition at line 361 of file arithmetique.h.
#define value_lt | ( | v1, | |
v2 | |||
) | ((v1)<(v2)) |
Definition at line 336 of file arithmetique.h.
#define VALUE_MAX INT_MAX |
Definition at line 309 of file arithmetique.h.
#define value_max | ( | v1, | |
v2 | |||
) | (value_ge(v1,v2)? (v1): (v2)) |
Definition at line 358 of file arithmetique.h.
Definition at line 405 of file arithmetique.h.
#define value_maximum | ( | ref, | |
val | |||
) | value_assign(ref,value_max(ref,val)) |
Definition at line 379 of file arithmetique.h.
#define VALUE_MIN (INT_MIN+1) |
Definition at line 308 of file arithmetique.h.
#define value_min | ( | v1, | |
v2 | |||
) | (value_le(v1,v2)? (v1): (v2)) |
Definition at line 357 of file arithmetique.h.
Definition at line 404 of file arithmetique.h.
#define value_minimum | ( | ref, | |
val | |||
) | value_assign(ref,value_min(ref,val)) |
Definition at line 378 of file arithmetique.h.
#define value_minus | ( | v1, | |
v2 | |||
) | ((v1)-(v2)) |
Definition at line 354 of file arithmetique.h.
#define value_mod | ( | v1, | |
v2 | |||
) | ((v1)%(v2)) |
Definition at line 352 of file arithmetique.h.
Definition at line 374 of file arithmetique.h.
#define VALUE_MONE -1 |
Definition at line 312 of file arithmetique.h.
#define value_mone_p | ( | val | ) | value_eq(val,VALUE_MONE) |
Definition at line 402 of file arithmetique.h.
#define value_mult | ( | v, | |
w | |||
) |
whether the default is protected or not this define makes no sense any more...
well, doesn't matter. FC. I do enforce the protection whatever requested:-) prints out a message and throws the exception, hoping that some valid CATCH waits for it upwards.
Definition at line 452 of file arithmetique.h.
#define value_multiply | ( | ref, | |
val | |||
) | value_assign(ref,value_mult(ref,val)) |
Definition at line 370 of file arithmetique.h.
#define VALUE_NAN INT_MIN |
Definition at line 307 of file arithmetique.h.
#define value_ne | ( | v1, | |
v2 | |||
) | ((v1)!=(v2)) |
Definition at line 333 of file arithmetique.h.
#define value_neg_p | ( | val | ) | value_lt(val,VALUE_ZERO) |
Definition at line 393 of file arithmetique.h.
#define value_negz_p | ( | val | ) | value_le(val,VALUE_ZERO) |
Definition at line 395 of file arithmetique.h.
#define value_not | ( | val | ) | (~(val)) |
Definition at line 386 of file arithmetique.h.
Definition at line 407 of file arithmetique.h.
Definition at line 406 of file arithmetique.h.
#define value_notmone_p | ( | val | ) | value_ne(val,VALUE_MONE) |
Definition at line 403 of file arithmetique.h.
Definition at line 401 of file arithmetique.h.
#define value_notzero_p | ( | val | ) | value_ne(val,VALUE_ZERO) |
Definition at line 399 of file arithmetique.h.
#define VALUE_ONE 1 |
Definition at line 311 of file arithmetique.h.
Definition at line 400 of file arithmetique.h.
#define value_oppose | ( | ref | ) | value_assign(ref,value_uminus(ref)) |
Definition at line 376 of file arithmetique.h.
#define value_or | ( | v1, | |
v2 | |||
) | ((v1)|(v2)) |
Definition at line 359 of file arithmetique.h.
Definition at line 380 of file arithmetique.h.
#define value_pdiv | ( | v1, | |
v2 | |||
) | (divide(v1,v2)) |
Definition at line 355 of file arithmetique.h.
#define value_pdivision | ( | ref, | |
val | |||
) | value_assign(ref,value_pdiv(ref,val)) |
Definition at line 375 of file arithmetique.h.
#define value_plus | ( | v1, | |
v2 | |||
) | ((v1)+(v2)) |
binary operators on values
pdiv and pmod always return a positive remainder and a positive modulo. E.g. -1/100 = -1 and its remainder is 99. The modulo operator is periodic and not symmetric around zero.
Definition at line 350 of file arithmetique.h.
#define value_pmod | ( | v1, | |
v2 | |||
) | (modulo(v1,v2)) |
Definition at line 356 of file arithmetique.h.
#define value_pos_p | ( | val | ) | value_gt(val,VALUE_ZERO) |
Definition at line 392 of file arithmetique.h.
#define value_posz_p | ( | val | ) | value_ge(val,VALUE_ZERO) |
Definition at line 394 of file arithmetique.h.
#define value_product | ( | v, | |
w | |||
) | v=value_mult(v,w) |
Definition at line 455 of file arithmetique.h.
#define value_protected_hard_idiv_multiply | ( | v, | |
w, | |||
throw | |||
) |
(|v| < MAX / |w|) => v*w is okay I could check ((v*w)/w)==v but a tmp would be useful
Definition at line 416 of file arithmetique.h.
#define value_protected_mult | ( | v, | |
w | |||
) | value_protected_multiply(v,w,THROW(overflow_error)) |
protected versions
Definition at line 435 of file arithmetique.h.
#define value_protected_multiply | ( | v, | |
w, | |||
throw | |||
) | value_protected_hard_idiv_multiply(v,w,throw) |
is a software idiv is assumed, quick check performed first
Definition at line 429 of file arithmetique.h.
#define value_protected_product | ( | v, | |
w | |||
) | v=value_protected_mult(v,w) |
Definition at line 437 of file arithmetique.h.
#define value_rshift | ( | v1, | |
v2 | |||
) | ((v1)>>(v2)) |
Definition at line 362 of file arithmetique.h.
#define value_sign | ( | v | ) | (value_eq(v,VALUE_ZERO)?0:value_lt(v,VALUE_ZERO)?-1:1) |
trian operators on values
Definition at line 341 of file arithmetique.h.
Definition at line 371 of file arithmetique.h.
#define VALUE_TO_DOUBLE | ( | val | ) | ((double)(val)) |
Definition at line 316 of file arithmetique.h.
#define VALUE_TO_FLOAT | ( | val | ) | ((float)(val)) |
Definition at line 315 of file arithmetique.h.
#define VALUE_TO_INT | ( | val | ) | ((int)(val)) |
Definition at line 314 of file arithmetique.h.
#define VALUE_TO_LONG | ( | val | ) | ((long)(val)) |
Definition at line 313 of file arithmetique.h.
#define value_uminus | ( | val | ) | (-(val)) |
unary operators on values
Definition at line 385 of file arithmetique.h.
#define VALUE_ZERO 0 |
Definition at line 310 of file arithmetique.h.
#define value_zero_p | ( | val | ) | value_eq(val,VALUE_ZERO) |
Definition at line 396 of file arithmetique.h.
Definition at line 304 of file arithmetique.h.
Definition at line 598 of file arithmetique.h.
void __attribute__ | ( | (weak, noreturn) | ) | const |
_has_yy_size_t
end of arithmetique-local.h cproto-generated files abs.c
_has_yy_size_t
FC.
ofl_ctrl | fl_ctrl |
Definition at line 38 of file abs.c.
References assert, overflow_error, THROW, value_eq, VALUE_MIN, value_ne, value_pos_p, and value_uminus.
Referenced by absval(), and absval_ofl().
int absval(int i): absolute value of i (SUN version)
Definition at line 58 of file abs.c.
References abs_ofl_ctrl().
int absval_ofl(int i): absolute value of i (SUN version)
Definition at line 50 of file abs.c.
References abs_ofl_ctrl().
int bezout(int a, int b, int *x, int *y): calcule x et y, les deux nombres qui verifient le theoreme de Bezout pour a et b; le pgcd de a et b est retourne par valeur
a * x + b * y = gcd(a,b) return gcd(a,b)
Definition at line 265 of file pgcd.c.
References value_div, value_ge, value_minus, value_mod, value_mult, value_notzero_p, VALUE_ONE, VALUE_ZERO, value_zero_p, and x.
Referenced by vecteur_bezout().
int bezout_grl(int a, int b, int *x, int *y): calcule x et y, les deux entiers quelconcs qui verifient le theoreme de Bezout pour a et b; le pgcd de a et b est retourne par valeur
a * x + b * y = gcd(a,b) return gcd(a,b) gcd () >=0 le pre et le post conditions de pgcd sont comme la fonction gcd_subtract(). les situations speciaux sont donnes ci_dessous: si (a==0 et b==0) x=y=0; gcd()=0, si (a==0)(ou b==0) x=1(ou -1) y=0 (ou x=0 y=1(ou -1)) et gcd()=a(ou -a) (ou gcd()=b(ou -b))
les signes de a et b
Definition at line 324 of file pgcd.c.
References value_div, value_ge, value_minus, value_mod, VALUE_MONE, value_mult, value_neg_p, value_notzero_p, VALUE_ONE, value_uminus, VALUE_ZERO, value_zero_p, and x.
Referenced by base_G_h1_unnull().
INTLIBRARY int divide(int a, int b): calcul du divide de a par b; le reste (qui n'est pas retourne) est toujours positif; il est fourni par la fonction modulo()
Il y a quatre configuration de signe a traiter:
definition d'une look-up table pour les valeurs de a appartenant a [-DIVIDE_MAX_A..DIVIDE_MAX_A] et pour les valeurs de b appartenant a 1..DIVIDE_MAX_B
Serait-il utile d'ajouter une test b==1 pour supprimer une colonne?
Serait-il utile de tester b > a pour renvoyer 0 ou -1 tout de suite?
b == 1 2 3 4 5 6 7 8
a == - 7
a == - 6
a == - 5
a == - 4
a == - 3
a == - 2
a == - 1
a == 0
a == 1
a == 2
a == 3
a == 4
a == 5
a == 6
a == 7
translation de a pour acces a la look-up table par indice positif: la == a + DIVIDE_MAX_A >= 0
valeur du quotient C
serait-il utile d'optimiser la division de a=0 par b? Ou bien cette routine n'est-elle jamais appelee avec a=0 par le package vecteur?
direct table look up
shift a for the table
this is just divide_slow
Definition at line 51 of file divide.c.
References assert, DIVIDE_MAX_A, DIVIDE_MAX_B, int_to_value, value_ge, value_le, value_notzero_p, value_pdiv, VALUE_TO_INT, and value_uminus.
Definition at line 114 of file divide.c.
References value_pdiv.
void dump_exception_stack | ( | void | ) |
void dump_exception_stack_to_file | ( | FILE * | ) |
INTLIBRARY no overflow is checked int exponentiate(x,n): raise x to the power n
Precondition: n => 0
validation - n is positive
FI: la complexite pourrait etre reduite de O(n) a O(log n)
Definition at line 45 of file exp.c.
References assert, VALUE_ONE, value_product, and x.
Referenced by integer_power_to_transformer().
void fprint_string_Value | ( | FILE * | f, |
char * | blah, | ||
Value | v | ||
) |
blah | lah |
Definition at line 47 of file io.c.
References f(), and fprint_Value().
Referenced by build_sc_machine(), calculate_delay(), evaluate_var_to_complexity(), make_movements_loop_body_wp65(), print_cone_vecteur(), print_dependence_cone(), print_vect_in_vertice_val(), region_translation_init(), and TestDiVariables().
void fprint_Value | ( | FILE * | f, |
Value | v | ||
) |
Definition at line 42 of file io.c.
References f(), fprintf(), and VALUE_FMT.
Referenced by adg_contrainte_fprint(), build1(), choose(), computebounds(), contrainte_fprint(), coupe(), evaluate_var_to_complexity(), fast(), fastplus(), findandmod(), fourier1(), fprint_contrainte_vecteur(), fprint_string_Value(), gcdtest(), igvoir3(), inequaldivision(), ipivotage2(), iprimal(), iprimalplus(), is2(), lowbound(), majlowbounds(), majuu(), matrice_fprint(), matrix_fprint(), matrix_pr_quot(), pr_quot(), pu_contrainte_fprint(), pu_vect_fprint(), sc_minmax_of_variable2(), sommet_fprint(), sommet_fprint_as_dense(), splitpb(), tableau_janus(), term(), upperbound(), vect_fprint(), vect_fprint_as_dense(), vect_gen_write(), voirbornes(), vzcut(), and wvoir().
pv | v |
Definition at line 58 of file io.c.
References f(), and VALUE_FMT.
Referenced by matrice_fscan(), and matrix_fscan().
int gcd_subtract(int a, int b): find the gcd (pgcd) of two integers
There is no precondition on the input. Negative input is handled in the same way as positive ones. If one input is zero the output is equal to the other input - thus an input of two zeros is the only way an output of zero is created. Postcondition: gcd(a,b) > 0 ; gcd(a,b)==0 iff a==0 and b==0 whereas it should be undefined (F. Irigoin) Exception: gcd(0,0) aborts Implementation: by subtractions
Note: the signs of a and b do not matter because they can be exactly divided by the gcd
b == 0
Definition at line 189 of file pgcd.c.
References assert, value_abs, value_ge, value_minus, value_notzero_p, and value_zero_p.
char const* get_exception_name | ( | const | linear_exception_t | ) |
linear_exception_t | xception |
unsigned int linear_error_count | ( | void | ) |
return number of linear errors may be used as a test after a reset to know whether new errors occured.
Definition at line 85 of file errors.c.
References misc_error_count, overflow_error_count, and simplex_error_count.
Referenced by catch_user_error().
return various errors counts through unsigned int pointer overflow, simplex & misc (aka others) NULL pointers are ignored
poe | oe |
pse | se |
pme | me |
Definition at line 94 of file errors.c.
References misc_error_count, overflow_error_count, and simplex_error_count.
Referenced by catch_user_error().
void linear_initialize_exception_stack | ( | unsigned int | , |
exception_callback_t | , | ||
exception_callback_t | |||
) |
bool linear_require_gmp | ( | void | ) |
whether linear is asked to use gmp if possible (env variable)
Definition at line 446 of file errors.c.
References env.
Referenced by catch_user_error(), and linear_use_gmp().
void linear_reset_error_counters | ( | void | ) |
reset linear counters
Definition at line 75 of file errors.c.
References misc_error_count, overflow_error_count, and simplex_error_count.
Referenced by catch_user_error().
bool linear_use_gmp | ( | void | ) |
whether linear is to use gmp
Definition at line 454 of file errors.c.
References fprintf(), linear_require_gmp(), linear_with_gmp(), and warned_if_inconsistent_gmp.
Referenced by internal_sc_feasibility(), sc_convex_hull(), sc_to_sg_chernikova(), and sg_to_sc_chernikova().
bool linear_with_gmp | ( | void | ) |
whether linear can use gmp (i.e.
compiled in)
Definition at line 435 of file errors.c.
Referenced by catch_user_error(), and linear_use_gmp().
INTLIBRARY int modulo_fast(int a, int b): calcul du modulo de a par b; le modulo retourne est toujours positif
Il y a quatre configuration de signe a traiter:
definition d'une look-up table pour les valeurs de a appartenant a [-MODULO_MAX_A..MODULO_MAX_A] et pour les valeurs de b appartenant a 1..MODULO_MAX_B Serait-il utile d'ajouter une test b==1 pour supprimer une colonne?
b == 1 2 3 4 5
a == - 5
a == - 4
a == - 3
a == - 2
a == - 1
a == 0
a == 1
a == 2
a == 3
a == 4
a == 5
supprime pour cause de look-up table if(a==1 || a== 0) return(a);
if(b==1) return(0);
Definition at line 48 of file modulo.c.
References assert, int_to_value, MODULO_MAX_A, MODULO_MAX_B, value_abs, value_ge, value_le, value_minus, value_mod, value_neg_p, value_notzero_p, and VALUE_TO_INT.
int pgcd_fast(int a, int b): calcul iteratif du pgcd de deux entiers; le pgcd retourne est toujours positif; il n'est pas defini si a et b sont nuls (abort);
si cette routine n'est JAMAIS appelee avec des arguments nuls, il faudrait supprimer les deux tests d'egalite a 0; ca devrait etre le cas avec les vecteurs creux
Definition at line 82 of file pgcd.c.
References assert, pgcd_interne(), value_abs, value_gt, value_notzero_p, and value_zero_p.
int pgcd_interne(int a, int b): calcul iteratif du pgcd de deux entiers strictement positifs tels que a > b; le pgcd retourne est toujours positif;
Definition d'une look-up table pour les valeurs de a appartenant a 0..GCD_MAX_A et pour les valeurs de b appartenant a 1..GCD_MAX_B
Serait-il utile d'ajouter une test b==1 pour supprimer une colonne?
la commutativite du pgcd n'est pas utilisee pour reduire la taille de la table
b == 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
a == 0
a == 1
a == 2
a == 3
a == 4
a == 5
a == 6
a == 7
a == 8
a == 9
a == 10
a == 11
a == 12
a == 13
a == 14
a == 15
on pourrait aussi utiliser une table des nombres premiers pour diminuer le nombre de boucles
on utilise la valeur particuliere -1 pour iterer
compute modulo(a,b) en utilisant la routine C puisque a et b sont strictement positifs (vaudrait-il mieux utiliser la soustraction?)
Definition at line 106 of file pgcd.c.
References assert, GCD_MAX_A, GCD_MAX_B, int_to_value, value_gt, value_le, value_mod, VALUE_MONE, value_neg_p, value_pos_p, VALUE_TO_INT, and value_zero_p.
Referenced by pgcd_fast().
INTLIBRARY Value pgcd_slow(Value a, Value b) computation of the gcd of a and b. the result is always positive. standard algorithm in log(max(a,b)). pgcd_slow(0,0)==1 (maybe should we abort?). I changed from a recursive for a simple iterative version, FC 07/96.
a==0, b==0
a==0, b!=0
a!=0, b==0
a==b
swap
on entry in this loop, a > b > 0 is insured
Definition at line 44 of file pgcd.c.
References value_abs, value_absolute, value_eq, value_gt, value_mod, value_notzero_p, VALUE_ONE, and value_zero_p.
Referenced by matrice_determinant(), matrice_diagonale_inversion(), matrice_triangulaire_inversion(), matrix_determinant(), and substitute_var_with_vec().
void pop_timeout | ( | const char * | , |
const char * | , | ||
const int | |||
) |
void pop_timeout_env | ( | const char * | env, |
const char * | funcname, | ||
const char * | filename, | ||
const int | lineno | ||
) |
env | nv |
funcname | uncname |
filename | ilename |
lineno | ineno |
Definition at line 619 of file errors.c.
References env, env2int(), and pop_timeout().
INTLIBRARY int ppcm(int i, int j): plus petit entier positif divisible par i et j
Ancien nom et ancien type: void lcm(int i, int j, int *pk)
Definition at line 42 of file ppcm.c.
References pgcd, value_div, value_mult, value_neg_p, value_uminus, VALUE_ZERO, and value_zero_p.
Referenced by bounds_equal_p(), build_contraction_matrices(), compose_vvs(), include_trans_on_LC_in_ref(), matrice_diagonale_inversion(), matrice_substract(), matrix_add(), matrix_diagonal_inversion(), matrix_substract(), my_matrices_to_constraints_with_sym_cst(), my_matrices_to_constraints_with_sym_cst_2(), simplify_dimension(), simplify_predicate(), and vvs_on_vvs().
void print_Value | ( | Value | v | ) |
io.c
io.c
IO on a Value
Definition at line 37 of file io.c.
References printf(), and VALUE_FMT.
Referenced by __attribute__(), add_var_sup(), eq_in_ineq(), lignes_entrant(), printfrac(), and var_ecart_sup().
void push_timeout | ( | const unsigned int | delay, |
const char * | funcname, | ||
const char * | filename, | ||
const int | lineno | ||
) |
delay | elay |
funcname | uncname |
filename | ilename |
lineno | ineno |
Definition at line 539 of file errors.c.
References assert, timeout_t::delay, timeout_t::end, timeout_t::env, timeout_t::filename, timeout_t::funcname, timeout_t::lineno, timeout_t::start, timeout_index, TIMEOUT_MAX_STACK_SIZE, and timeouts.
Referenced by push_timeout_env().
bool push_timeout_env | ( | const char * | env, |
const char * | funcname, | ||
const char * | filename, | ||
const int | lineno | ||
) |
env | nv |
funcname | uncname |
filename | ilename |
lineno | ineno |
Definition at line 575 of file errors.c.
References timeout_t::env, env, env2int(), push_timeout(), timeout_index, and timeouts.
pv | v |
Definition at line 63 of file io.c.
References VALUE_FMT.
Referenced by fonct_read(), and vect_read().
void set_exception_callbacks | ( | exception_callback_t | , |
exception_callback_t | |||
) |
Referenced by atinit(), gpips_main(), pips_main(), tpips_main(), and wpips_main().
void set_timeout_callback | ( | timeout_callback_f | callback | ) |
callback | allback |
Definition at line 485 of file errors.c.
References callback, and timeout_callback.
Referenced by set_pips_timeout(), and set_pips_timeout_from_env().
void sprint_Value | ( | char * | s, |
Value | v | ||
) |
Definition at line 53 of file io.c.
References VALUE_FMT.
Referenced by heuristique_1(), heuristique_3(), and vect_sprint_as_monome().
pv | v |
Definition at line 68 of file io.c.
References VALUE_FMT.
Referenced by vect_gen_read().
char* Value_to_string | ( | Value | v | ) |
Definition at line 76 of file io.c.
References buf, BUFFER_SIZE, and VALUE_FMT.
Referenced by add_Value_to_current_line().
int vecteur_bezout(int u[], int v[], int l): calcul du vecteur v qui verifie le theoreme de bezout pour le vecteur u; les vecteurs u et v sont de dimension l
-> -> -> < u . v > = gcd(u ) i
printf("gcd = %d \n",gcd);
sum u * v = gcd(u ) k<l k k k<l k
a1 = gcd (u ) k<l-1 k
printf("gcd = %d\n",gcd);
Definition at line 220 of file pgcd.c.
References assert, bezout(), VALUE_ONE, value_product, and x.
void const char const char const int |
Definition at line 593 of file arithmetique.h.
|
extern |
Referenced by __attribute__(), build_sc_nredund_1pass_ofl_ctrl(), efficient_sc_check_inequality_feasibility(), internal_sc_feasibility(), sc_cute_convex_hull(), sc_feasibility_ofl_ctrl(), sc_fourier_motzkin_feasibility_ofl_ctrl_timeout_ctrl(), sc_janus_feasibility_ofl_ctrl_timeout_ctrl(), and sc_simplexe_feasibility_ofl_ctrl_timeout_ctrl().
|
extern |
Referenced by __attribute__(), catch_user_error(), safe_concurrent_apply(), and tpips_exec().