PIPS
|
Go to the source code of this file.
Data Structures | |
struct | Scontrainte |
Macros | |
#define | CONTRAINTE 1005 |
Warning! Do not modify this file that is automatically generated! More... | |
#define | egalite_print(eg) egalite_fprint(stdout,eg) |
MACROS ET CONSTANTES. More... | |
#define | inegalite_print(ineg) inegalite_fprint(stdout,ineg) |
FI: this macro requires an additional parameter or a default value as third parameter of inegalite_fprint() More... | |
#define | contrainte_vecteur(c) ((c)->vecteur) |
passage au champ vecteur d'une contrainte "a la Newgen" More... | |
#define | contrainte_succ(c) ((c)->succ) |
#define | CONTRAINTE_NULLE_P(c) (VECTEUR_NUL_P(contrainte_vecteur(c))) |
contrainte nulle (non contrainte 0 == 0 ou 0 <= 0) More... | |
#define | CONTRAINTE_UNDEFINED ((Pcontrainte) NULL) |
#define | CONTRAINTE_UNDEFINED_P(c) ((c)==CONTRAINTE_UNDEFINED) |
#define | COEFF_CST(c) vect_coeff(TCST,(c)->vecteur) |
int COEFF_CST(Pcontrainte c): terme constant d'une contrainte More... | |
#define | contrainte_rm(c) (void) contrainte_free(c) |
the standard xxx_rm does not return a value More... | |
#define | VERSION_FINALE |
#define | CONTRAINTE_RM(rd, f) contrainte_rm(rd) |
Typedefs | |
typedef struct Scontrainte | Scontrainte |
typedef struct Scontrainte * | Pcontrainte |
typedef Scontrainte | Segalite |
typedef Scontrainte * | Pegalite |
typedef Scontrainte | Sinegalite |
typedef Scontrainte * | Pinegalite |
Functions | |
Pcontrainte | contrainte_new (void) |
CONTRAINTE. More... | |
Pcontrainte | contrainte_make (Pvecteur) |
Pcontrainte contrainte_make(Pvecteur pv): allocation et initialisation d'une contrainte avec un vecteur passe en parametre. More... | |
Pcontrainte | contrainte_make_1D (Value, Variable, Value, bool) |
Generate a constraint a x <= b or a x >= b, according to less_p, or ax==b, regardless of less_p. More... | |
Pcontrainte | contraintes_make (Pvecteur,...) |
Convert a list of vectors into a list of constraints. More... | |
Pcontrainte | contrainte_dup (Pcontrainte) |
Pcontrainte contrainte_dup(Pcontrainte c_in): allocation d'une contrainte c_out prenant la valeur de la contrainte c_in (i.e. More... | |
Pcontrainte | contraintes_dup (Pcontrainte) |
Pcontrainte contraintes_dup(Pcontrainte c_in) a list of constraints is copied. More... | |
Pcontrainte | contrainte_free (Pcontrainte) |
Pcontrainte contrainte_free(Pcontrainte c): liberation de l'espace memoire alloue a la contrainte c ainsi que de ses champs vecteur et saturations; seul le lien vers la contrainte suivante est ignore. More... | |
Pcontrainte | contraintes_free (Pcontrainte) |
Pcontrainte contraintes_free(Pcontrainte pc): desallocation de toutes les contraintes de la liste pc. More... | |
void | dbg_contrainte_rm (Pcontrainte, char *) |
void dbg_contrainte_rm(Pcontrainte c): version debug de contrainte rm; trace de la desallocation et impression de la contrainte sur stdout More... | |
Pcontrainte | contrainte_copy (Pcontrainte) |
Have a look at contrainte_dup and contraintes_dup which reverse the order of the list This copy version (including vect_copy, sc_copy) maintains the order (DN,24/6/02) More... | |
Pcontrainte | contraintes_copy (Pcontrainte) |
Pcontrainte contraintes_copy(Pcontrainte c_in) a list of constraints is copied with the same order In fact, here we only need to replace contrainte_dup by contrainte_copy Have a look at contrainte_copy (DN,24/6/02) More... | |
int | contrainte_subst_ofl (Variable, Pcontrainte, Pcontrainte, bool) |
binaires.c More... | |
int | contrainte_subst (Variable, Pcontrainte, Pcontrainte, bool) |
Pcontrainte | contrainte_substitute_dimension (Pcontrainte, Variable, Pvecteur) |
Pcontrainte | inegalite_comb (Pcontrainte, Pcontrainte, Variable) |
Pcontrainte | inegalite_comb_ofl (Pcontrainte, Pcontrainte, Variable) |
int | contrainte_subst_ofl_ctrl (Variable, Pcontrainte, Pcontrainte, bool, int) |
int contrainte_subst_ofl_ctrl(Variable v, Pcontrainte def, Pcontrainte c Boolean eq_p, int ofl_ctrl): elimination d'une variable v entre une equation def et une contrainte, egalite ou inegalite, c. More... | |
Pcontrainte | inegalite_comb_ofl_ctrl (Pcontrainte, Pcontrainte, Variable, int) |
Pcontrainte inegalite_comb_ofl_ctrl(Pcontrainte posit, Pcontrainte negat, Variable v, int ofl_ctrl): combinaison lineaire positive des deux inegalites posit et negat eliminant la variable v. More... | |
Value | eq_diff_const (Pcontrainte, Pcontrainte) |
Value eq_diff_const(Pcontrainte c1, Pcontrainte c2): calcul de la difference des deux termes constants des deux equations c1 et c2. More... | |
Value | eq_sum_const (Pcontrainte, Pcontrainte) |
Value eq_sum_const(Pcontrainte c1, Pcontrainte c2): calcul de la somme des deux termes constants des deux contraintes c1 et c2. More... | |
Pcontrainte | contrainte_append (Pcontrainte, Pcontrainte) |
Pcontrainte contrainte_append(c1, c2) Pcontrainte c1, c2;. More... | |
Pcontrainte | extract_common_constraints (Pcontrainte *, Pcontrainte *, bool) |
common (simply equal) contraints are extracted, whether equalities or inequalities. More... | |
void | contrainte_error (char *, char *,...) |
error.c More... | |
void | contrainte_fprint (FILE *, Pcontrainte, bool, char *(*)(Variable)) |
io.c More... | |
void | egalite_fprint (FILE *, Pcontrainte, char *(*)(Variable)) |
void | egalite_dump (Pcontrainte) |
void egalite_dump(Pcontrainte c): impression "physique" d'une egalite; utilise en debugging More... | |
void | inegalite_fprint (FILE *, Pcontrainte, char *(*)(Variable)) |
void | inegalite_dump (Pcontrainte) |
void inegalite_dump(Pcontrainte c): impression "physique" d'une inegalite; utilise en debugging More... | |
void | egalites_fprint (FILE *, Pcontrainte, char *(*)(Variable)) |
void | egalites_dump (Pcontrainte) |
void | inegalites_fprint (FILE *, Pcontrainte, char *(*)(Variable)) |
void | inegalites_dump (Pcontrainte) |
void | sprint_operator (char *, bool, bool) |
char * | contrainte_sprint (char *, Pcontrainte, bool, char *(*)(Variable)) |
char * | contrainte_sprint_format (char *, Pcontrainte, bool, char *(*)(Variable), bool) |
char * | egalite_sprint (char *, Pcontrainte, char *(*)(Variable)) |
char * | inegalite_sprint (char *, Pcontrainte, char *(*)(Variable)) |
char * | egalite_sprint_format (char *, Pcontrainte, char *(*)(Variable), bool) |
char * | inegalite_sprint_format (char *, Pcontrainte, char *(*)(Variable), bool) |
bool | contrainte_in_liste (Pcontrainte, Pcontrainte) |
listes.c More... | |
int | constraint_rank (Pcontrainte, Pcontrainte) |
Return the rank of constraint c in constraint list lc. More... | |
bool | egalite_in_liste (Pcontrainte, Pcontrainte) |
bool egalite_in_liste(Pcontrainte eg, Pcontrainte leg): test si une egalite appartient a une liste d'egalites More... | |
int | nb_elems_list (Pcontrainte) |
int nb_elems_list(Pcontrainte list): nombre de contraintes se trouvant dans une liste de contraintes More... | |
bool | cyclic_constraint_list_p (Pcontrainte) |
Check if list l contains a cycle. More... | |
int | safe_nb_elems_list (Pcontrainte, int) |
Compute the number of elements in the list if it is less than n. More... | |
Pcontrainte | contrainte_remove_large_coef (Pcontrainte, Value) |
bool | contrainte_normalize (Pcontrainte, bool) |
normalize.c More... | |
bool | egalite_normalize (Pcontrainte) |
bool egalite_normalize(Pcontrainte eg): reduction d'une equation diophantienne par le pgcd de ses coefficients; l'equation est infaisable si le terme constant n'est pas divisible par ce pgcd More... | |
bool | inegalite_normalize (Pcontrainte) |
bool inegalite_normalize(Pcontrainte ineg): normalisation d'une inegalite a variables entieres; voir contrainte_normalize; retourne presque toujours true car une inegalite n'ayant qu'un terme constant est toujours faisable a moins qu'il ne reste qu'un terme constant strictement positif. More... | |
bool | eq_smg (Pcontrainte, Pcontrainte) |
predicats.c More... | |
bool | inequalities_opposite_p (Pcontrainte, Pcontrainte) |
bool inequalities_opposite_p(Pcontrainte c1, Pcontrainte c2): True if the non-constant part of c1 is the opposite of the non-constant part of c2. More... | |
bool | egalite_equal (Pcontrainte, Pcontrainte) |
bool egalite_equal(Pcontrainte eg1, Pcontrainte eg2): teste l'equivalence de deux egalites; leurs coefficients peuvent etre tous egaux ou tous opposes; pour obtenir une meilleure equivalence il faut commencer par reduire leurs coefficients par les PGCD More... | |
bool | contrainte_equal (Pcontrainte, Pcontrainte) |
bool contrainte_equal(Pcontrainte c1, Pcontrainte c2): test d'egalite des contraintes c1 et c2; elles sont egales si tous leurs coefficients et leur termes constants sont egaux; il faut les avoir normalisees auparavant pour etre sur de leur egalite; More... | |
bool | contrainte_parallele (Pcontrainte, Pcontrainte, Value *, Value *) |
Les deux contraintes c1 et c2 sont paralleles s'il existe deux coefficients a1 et a2 tels que a1 c1 + a2 c2 est reduit un terme constant K. More... | |
bool | contrainte_constante_p (Pcontrainte) |
bool contrainte_constante_p(Pcontrainte c): test de contrainte triviale sans variables (ie du type 0<= K ou 0<=0 ou 0 == 0 ou 0 == K) More... | |
bool | vect_constant_p (Pvecteur) |
bool vect_constant_p(Pvecteur v): v contains only a constant term, may be zero More... | |
bool | contrainte_verifiee (Pcontrainte, bool) |
bool contrainte_verifiee(Pcontrainte ineg, bool eq_p): test de faisabilite d'inegalite (eq_p == false) ou d'egalite triviale More... | |
bool | contrainte_oppos (Pcontrainte, Pcontrainte) |
bool contrainte_oppos(Pcontrainte ineg1, Pcontrainte ineg2): indique si 2 inegalites forment une egalite ou si deux egalites sont equivalentes. More... | |
bool | constraint_without_vars (Pcontrainte, Pbase) |
bool constraint_without_vars(c, vars) Pcontrainte c; Pbase vars; More... | |
bool | constraints_without_vars (Pcontrainte, Pbase) |
bool constraints_without_vars(pc, vars) Pcontrainte pc; Pbase vars; More... | |
Value | contrainte_eval (Pvecteur, Pvecteur) |
Evaluate constraint c according to values in v and return the constant obtained. More... | |
bool | contrainte_eval_p (Pvecteur, Pvecteur, bool) |
Evaluate constraint c according to values in v and return true if the constraint is met. More... | |
bool | equality_eval_p (Pvecteur, Pvecteur) |
bool | inequality_eval_p (Pvecteur, Pvecteur) |
void | norm_eq (Pcontrainte) |
unaires.c More... | |
void | contrainte_chg_sgn (Pcontrainte) |
void contrainte_chg_sgn(Pcontrainte eq): changement de signe d'une contrainte, i.e. More... | |
void | contrainte_reverse (Pcontrainte) |
void contrainte_reverse(Pcontrainte eq): changement de signe d'une contrainte, i.e. More... | |
void | eq_set_vect_nul (Pcontrainte) |
void_eq_set_vect_nul(Pcontrainte c): transformation d'une contrainte en une contrainte triviale 0 == 0 More... | |
Pcontrainte | contrainte_translate (Pcontrainte, Pbase, char *(*)(void)) |
Pcontrainte | contrainte_variable_rename (Pcontrainte, Variable, Variable) |
Pcontrainte contrainte_variable_rename(Pcontrainte c, Variable v_old, Variable v_new): rename the potential coordinate v_old in c as v_new. More... | |
void | Pcontrainte_separate_on_vars (Pcontrainte, Pbase, Pcontrainte *, Pcontrainte *) |
void Pcontrainte_separate_on_vars(initial, vars, pwith, pwithout) Pcontrainte initial; Pbase vars; Pcontrainte *pwith, *pwithout; More... | |
void | constraints_for_bounds (Variable, Pcontrainte *, Pcontrainte *, Pcontrainte *) |
void constraints_for_bounds(var, pinit, plower, pupper) Variable var; Pcontrainte *pinit, *plower, *pupper; IN: var, *pinit; OUT: *pinit, *plower, *pupper; More... | |
Pcontrainte | contrainte_dup_extract (Pcontrainte, Variable) |
Pcontrainte contrainte_dup_extract(c, var) Pcontrainte c; Variable var;. More... | |
Pcontrainte | contrainte_extract (Pcontrainte *, Pbase, Variable) |
Pcontrainte contrainte_extract(pc, base, var) Pcontrainte *pc; Pbase base; Variable var;. More... | |
int | level_contrainte (Pcontrainte, Pbase) |
int level_contrainte(Pcontrainte pc, Pbase base_index) compute the level (rank) of the constraint pc in the nested loops. More... | |
void | contrainte_vect_sort (Pcontrainte, int(*)(Pvecteur *, Pvecteur *)) |
Pcontrainte | contrainte_var_min_coeff (Pcontrainte, Variable, Value *, bool) |
Pcontrainte contrainte_var_min_coeff(Pcontrainte contraintes, Variable v, int *coeff) input : a list of constraints (euqalities or inequalities), a variable, and the location of an integer. More... | |
int | equation_lexicographic_compare (Pcontrainte, Pcontrainte, int(*)(Pvecteur *, Pvecteur *)) |
int | inequality_lexicographic_compare (Pcontrainte, Pcontrainte, int(*)(Pvecteur *, Pvecteur *)) |
Pcontrainte | equations_lexicographic_sort (Pcontrainte, int(*)(Pvecteur *, Pvecteur *)) |
Pcontrainte | inequalities_lexicographic_sort (Pcontrainte, int(*)(Pvecteur *, Pvecteur *)) |
Pcontrainte | constraints_lexicographic_sort (Pcontrainte, int(*)(Pvecteur *, Pvecteur *)) |
For historical reasons, equal to equations_lexicographic_sort() More... | |
Pcontrainte | constraints_lexicographic_sort_generic (Pcontrainte, int(*)(Pvecteur *, Pvecteur *), bool) |
Variable | contrainte_simple_equality (Pcontrainte) |
returns whether a constraint is a simple equality: X == 12 the system is expected to be normalized? More... | |
#define COEFF_CST | ( | c | ) | vect_coeff(TCST,(c)->vecteur) |
int COEFF_CST(Pcontrainte c): terme constant d'une contrainte
Definition at line 125 of file contrainte.h.
#define CONTRAINTE 1005 |
Warning! Do not modify this file that is automatically generated!
Modify src/Libs/contrainte/contrainte-local.h instead, to add your own modifications. header file built by cproto contrainte-local.h package sur les contraintes.
Une contrainte est une egalite ou une inegalite. Elle est representee par un vecteur dont une coordonnee particuliere, TCST, represente le terme constant.
Les contraintes sont stockees sous forme de membres gauches, ce qui n'est utile a savoir que pour les inegalites:
sum a x + b <= 0 i i i
ou b est le terme constant.
Les tableaux de saturations sont calcules en fonction de polyedre (systeme generateur ou systeme de contraintes) et leurs dimensions sont inconnues au niveau des contraintes. Ils sont ignores la plupart du temps.
Les contraintes sont traitees sous forme de liste de contraintes (systeme d'egalites ou systeme d'inegalites) et possedent un champ de chainage. Certaines des fonctions portent sur des listes de contraintes et non sur des contraintes. Cette double semantique complique beaucoup les choses.
Le pointeur NULL represente implicitement l'une des contraintes toujours faisables, 0 == 0 ou 0 <= 0. Au moins, la plupart du temps... car il represente la valeur CONTRAINTE_UNDEFINED dans les routines de gestion memoire.
Il vaut mieux utiliser la macro CONTRAINTE_NULLE_P() qui verifie que le vecteur associe est le VECTEUR_NUL.
Les contraintes trivialement faisables et infaisables sont representees par un unique terme constant: 0 == k, 0 <= k, 0 <= -k (k positif). Il existe deux fonctions pour les tester.
Autres packages a inclure:
Malik Imadache, Corinne Ancourt, Neil Butler, Francois Irigoin
Bugs:
Modifications:
Definition at line 92 of file contrainte.h.
#define CONTRAINTE_NULLE_P | ( | c | ) | (VECTEUR_NUL_P(contrainte_vecteur(c))) |
contrainte nulle (non contrainte 0 == 0 ou 0 <= 0)
Definition at line 118 of file contrainte.h.
#define contrainte_rm | ( | c | ) | (void) contrainte_free(c) |
the standard xxx_rm does not return a value
Definition at line 128 of file contrainte.h.
#define CONTRAINTE_RM | ( | rd, | |
f | |||
) | contrainte_rm(rd) |
Definition at line 134 of file contrainte.h.
#define contrainte_succ | ( | c | ) | ((c)->succ) |
Definition at line 115 of file contrainte.h.
#define CONTRAINTE_UNDEFINED ((Pcontrainte) NULL) |
Definition at line 120 of file contrainte.h.
#define CONTRAINTE_UNDEFINED_P | ( | c | ) | ((c)==CONTRAINTE_UNDEFINED) |
Definition at line 122 of file contrainte.h.
#define contrainte_vecteur | ( | c | ) | ((c)->vecteur) |
passage au champ vecteur d'une contrainte "a la Newgen"
Definition at line 113 of file contrainte.h.
#define egalite_print | ( | eg | ) | egalite_fprint(stdout,eg) |
MACROS ET CONSTANTES.
Definition at line 107 of file contrainte.h.
#define inegalite_print | ( | ineg | ) | inegalite_fprint(stdout,ineg) |
FI: this macro requires an additional parameter or a default value as third parameter of inegalite_fprint()
Definition at line 110 of file contrainte.h.
#define VERSION_FINALE |
Definition at line 130 of file contrainte.h.
typedef struct Scontrainte* Pcontrainte |
typedef Scontrainte * Pegalite |
Definition at line 101 of file contrainte.h.
typedef Scontrainte * Pinegalite |
Definition at line 103 of file contrainte.h.
typedef struct Scontrainte Scontrainte |
typedef Scontrainte Segalite |
Definition at line 101 of file contrainte.h.
typedef Scontrainte Sinegalite |
Definition at line 103 of file contrainte.h.
int constraint_rank | ( | Pcontrainte | c, |
Pcontrainte | lc | ||
) |
Return the rank of constraint c in constraint list lc.
1 for the first element, and so on, Fortran style. 0 when c is not in lc.
The comparisons are based on the pointers, not on the values of the constraints. It is mainly useful to detect cycles in constraint list.
lc | c |
Definition at line 75 of file listes.c.
References assert, CONTRAINTE_NULLE_P, CONTRAINTE_UNDEFINED_P, rank, and Scontrainte::succ.
Referenced by cyclic_constraint_list_p().
bool constraint_without_vars | ( | Pcontrainte | c, |
Pbase | vars | ||
) |
bool constraint_without_vars(c, vars) Pcontrainte c; Pbase vars;
IN: c, vars
OUT: returned boolean
returns if the current constraint uses none of the variables in vars.
(c) FC 16/05/94
vars | ars |
Definition at line 276 of file predicats.c.
References BASE_NULLE, Svecteur::succ, var_of, and vect_coeff().
Referenced by constraints_without_vars(), and Pcontrainte_separate_on_vars().
void constraints_for_bounds | ( | Variable | var, |
Pcontrainte * | pinit, | ||
Pcontrainte * | plower, | ||
Pcontrainte * | pupper | ||
) |
void constraints_for_bounds(var, pinit, plower, pupper) Variable var; Pcontrainte *pinit, *plower, *pupper; IN: var, *pinit; OUT: *pinit, *plower, *pupper;
separate the constraints involving var for upper and lower bounds The constraints are removed from the original system. everything is touched. Should be fast because there is no allocation.
FC 28/11/94
v==0
var | ar |
pinit | init |
plower | lower |
pupper | upper |
Definition at line 176 of file unaires.c.
References Scontrainte::succ, value_neg_p, value_pos_p, vect_coeff(), and Scontrainte::vecteur.
Referenced by do_array_expansion(), do_check_isolate_statement_preconditions_on_call(), do_isolate_statement_preconditions_satisified_p(), do_solve_hardware_constraints_on_nb_proc(), make_rectangular_area(), region_to_minimal_dimensions(), statement_insertion_fix_access(), systeme_to_loop_nest(), and variable_to_dimensions().
Pcontrainte constraints_lexicographic_sort | ( | Pcontrainte | cl, |
int(*)(Pvecteur *, Pvecteur *) | compare | ||
) |
For historical reasons, equal to equations_lexicographic_sort()
cl | l |
Definition at line 461 of file unaires.c.
References constraints_lexicographic_sort_generic(), and CONTRAINTE_UNDEFINED.
Pcontrainte constraints_lexicographic_sort_generic | ( | Pcontrainte | cl, |
int(*)(Pvecteur *, Pvecteur *) | compare, | ||
bool | is_equation | ||
) |
the temporary table is created and initialized
sort!
the vector is regenerated in order
clean and return
cl | l |
is_equation | s_equation |
Definition at line 472 of file unaires.c.
References assert, CONTRAINTE_UNDEFINED, free(), internal_equation_compare(), internal_inequality_compare(), lexicographic_compare, malloc(), nb_elems_list(), and Scontrainte::succ.
Referenced by constraints_lexicographic_sort(), equations_lexicographic_sort(), and inequalities_lexicographic_sort().
bool constraints_without_vars | ( | Pcontrainte | pc, |
Pbase | vars | ||
) |
bool constraints_without_vars(pc, vars) Pcontrainte pc; Pbase vars;
IN: c, vars
OUT: returned boolean
returns true if none of the constraints use the variables in vars.
pc | c |
vars | ars |
Definition at line 300 of file predicats.c.
References constraint_without_vars(), and Scontrainte::succ.
Pcontrainte contrainte_append | ( | Pcontrainte | c1, |
Pcontrainte | c2 | ||
) |
Pcontrainte contrainte_append(c1, c2) Pcontrainte c1, c2;.
append directly c2 to c1. Neither c1 nor c2 are relevant when the result is returned.
c1 | 1 |
c2 | 2 |
Definition at line 267 of file binaires.c.
References Scontrainte::succ.
Referenced by algorithm_row_echelon_generic(), and sc_bounded_normalization().
void contrainte_chg_sgn | ( | Pcontrainte | c | ) |
void contrainte_chg_sgn(Pcontrainte eq): changement de signe d'une contrainte, i.e.
multiplication par -1. Les equations ne sont pas modifiees mais les inequations sont transformees.
Ancien nom: ch_sgn
Definition at line 56 of file unaires.c.
References vect_chg_sgn().
Referenced by contrainte_reverse(), contrainte_var_min_coeff(), eq_redund_with_sc_p(), make_tile_constraints(), sc_supress_same_constraints(), and tile_membership().
bool contrainte_constante_p | ( | Pcontrainte | c | ) |
bool contrainte_constante_p(Pcontrainte c): test de contrainte triviale sans variables (ie du type 0<= K ou 0<=0 ou 0 == 0 ou 0 == K)
Les equations non-faisables ne sont pas detectees.
Modifications:
Definition at line 192 of file predicats.c.
References CONTRAINTE_NULLE_P, contrainte_vecteur, and vect_constant_p().
Referenced by combiner_ofl_with_test(), contrainte_subst_ofl_ctrl(), contrainte_verifiee(), gcd_and_constant_dependence_test(), sc_force_variable_to_zero(), and sc_strong_normalize_and_check_feasibility().
Pcontrainte contrainte_copy | ( | Pcontrainte | c_in | ) |
Have a look at contrainte_dup and contraintes_dup which reverse the order of the list This copy version (including vect_copy, sc_copy) maintains the order (DN,24/6/02)
c_in | _in |
Definition at line 254 of file alloc.c.
References c_in, c_out, contrainte_new(), and vect_copy().
Referenced by bound_redund_with_sc_p(), build_integer_sc_nredund(), build_sc_nredund_1pass_ofl_ctrl(), contraintes_copy(), eq_redund_with_sc_p(), extract_nredund_subsystem(), ineq_redund_with_sc_p(), sc_append(), sc_safe_append(), sc_strong_normalize2(), sc_strong_normalize_and_check_feasibility(), and sc_strong_normalize_and_check_feasibility2().
Pcontrainte contrainte_dup | ( | Pcontrainte | c_in | ) |
Pcontrainte contrainte_dup(Pcontrainte c_in): allocation d'une contrainte c_out prenant la valeur de la contrainte c_in (i.e.
duplication d'une contrainte); les tableaux de saturations ne sont pas recopies car on n'en connait pas la dimension. Le lien vers le successeur est aussi ignore pour ne pas cree de sharing intempestif.
allocate c_out; c_out := c_in; return c_out;
Ancien nom: eq_dup() et cp_eq()
c_in | _in |
Definition at line 132 of file alloc.c.
References c_in, c_out, contrainte_new(), and vect_dup().
Referenced by build_transfer_equations(), contrainte_dup_extract(), contraintes_dup(), dj_simple_inegs_to_eg(), elim_redund_sc_with_sc(), find_implicit_equation(), find_motif(), get_bounds_expression(), insert_2ineq_end_sc(), insert_ineq_begin_sc(), insert_ineq_end_sc(), make_bounds(), make_tile_constraints(), mapping_on_broadcast(), sc_minmax_of_variable2(), sc_supress_parallel_redund_constraints(), sc_supress_same_constraints(), sc_transform_eg_in_ineg(), sc_transform_ineg_in_eg(), separate_variables(), separate_variables_2(), test_bound_generation(), tile_membership(), and valuer().
Pcontrainte contrainte_dup_extract | ( | Pcontrainte | c, |
Variable | var | ||
) |
Pcontrainte contrainte_dup_extract(c, var) Pcontrainte c; Variable var;.
returns a copy of the constraints of c which contain var.
FC 27/09/94
var | ar |
Definition at line 215 of file unaires.c.
References contrainte_dup(), Scontrainte::succ, and vect_coeff().
Referenced by algorithm_row_echelon_generic().
bool contrainte_equal | ( | Pcontrainte | c1, |
Pcontrainte | c2 | ||
) |
bool contrainte_equal(Pcontrainte c1, Pcontrainte c2): test d'egalite des contraintes c1 et c2; elles sont egales si tous leurs coefficients et leur termes constants sont egaux; il faut les avoir normalisees auparavant pour etre sur de leur egalite;
La contrainte CONTRAINTE_UNDEFINED est assimilee a la contrainte nulle
Ancien nom: ineg_same()
Modifications:
c1 | 1 |
c2 | 2 |
Definition at line 128 of file predicats.c.
References CONTRAINTE_UNDEFINED_P, contrainte_vecteur, and vect_equal().
Referenced by extract_common_constraints(), sc_elim_db_constraints(), sc_elim_double_constraints(), sc_kill_db_eg(), sc_safe_elim_db_constraints(), and sc_safe_kill_db_eg().
void contrainte_error | ( | char * | name, |
char * | fmt, | ||
... | |||
) |
error.c
error.c
INTLIBRARY void contrainte_error(va_dcl va_alist) should be called to terminate execution and to core dump when data structures are corrupted or when an undefined operation is requested (zero divide for instance). CONTRAINTE_ERROR should be called as:
CONTRAINTE_ERROR(function_name, format, expression-list)
where function_name is a string containing the name of the function calling CONTRAINTE_ERROR, and where format and expression-list are passed as arguments to vprintf. CONTRAINTE_ERROR terminates execution with abort. ARARGS0
print name of function causing error
print out remainder of message
create a core file for debug
name | ame |
fmt | mt |
Definition at line 49 of file error.c.
References abort, and fprintf().
Referenced by contrainte_sprint_format(), and contrainte_text_format().
Evaluate constraint c according to values in v and return the constant obtained.
The constraint may be an equality or an inequality.
If c is an equality, the value return must be zero or the point does not belong to the hyperplane defined by c.
If c is an inequality, the value returned is negative if v belongs to the half-space defined by c. If it is zero, the point v belongs to the constraint, i.e. is on the boundary of any constraint system containing c, i.e. to the hyperplane defined by c. If the value returned is stricly positive, v does not belong to the half-space defined by c.
Note: this function is not a predicate but it is used by the next function, which is a predicate.
Definition at line 331 of file predicats.c.
References TCST, value_addto, value_direct_multiply, VALUE_ZERO, vect_coeff(), VECTEUR_NUL, VECTEUR_NUL_P, vecteur_succ, vecteur_val, and vecteur_var.
Referenced by contrainte_eval_p(), and sc_internal_p().
Evaluate constraint c according to values in v and return true if the constraint is met.
The constraint may be an equality or an inequality depending on is_equality_p
is_equality_p | s_equality_p |
Definition at line 354 of file predicats.c.
References contrainte_eval(), value_negz_p, VALUE_ZERO, and value_zero_p.
Referenced by equality_eval_p(), and inequality_eval_p().
Pcontrainte contrainte_extract | ( | Pcontrainte * | pc, |
Pbase | base, | ||
Variable | var | ||
) |
Pcontrainte contrainte_extract(pc, base, var) Pcontrainte *pc; Pbase base; Variable var;.
returns the constraints of *pc of which the higher rank variable from base is var. These constraints are removed from *pc.
FC 27/09/94
pc | c |
base | ase |
var | ar |
Definition at line 242 of file unaires.c.
References base, rank, rank_of_variable(), search_higher_rank(), and Scontrainte::succ.
void contrainte_fprint | ( | FILE * | , |
Pcontrainte | , | ||
bool | , | ||
char * | *)(Variable | ||
) |
io.c
Referenced by dj_variable_substitution_with_eqs_ofl_ctrl(), make_bound_expression(), and show_nredund().
Pcontrainte contrainte_free | ( | Pcontrainte | c | ) |
Pcontrainte contrainte_free(Pcontrainte c): liberation de l'espace memoire alloue a la contrainte c ainsi que de ses champs vecteur et saturations; seul le lien vers la contrainte suivante est ignore.
Utilisation standard: c = contrainte_free(c);
Autre utilisation possible: (void) contrainte_free(c); c = NULL;
comme toujours, les champs pointeurs sont remis a NULL avant la desallocation pour detecter au plus tot les erreurs dues a l'allocation dynamique de memoire.
Modification:
Definition at line 184 of file alloc.c.
References CONTRAINTE_UNDEFINED, CONTRAINTE_UNDEFINED_P, Scontrainte::eq_sat, free(), Scontrainte::r_sat, Scontrainte::s_sat, Scontrainte::succ, vect_rm(), Scontrainte::vecteur, and VECTEUR_UNDEFINED.
Referenced by combiner_ofl_with_test(), contrainte_remove_large_coef(), contraintes_free(), dj_simple_inegs_to_eg(), eq_redund_with_sc_p(), extract_common_constraints(), loop_executed_approximation(), pa_path_to_few_disjunct_ofl_ctrl(), region_sc_minimal(), sc_elim_empty_constraints(), sc_elim_redund_with_first_ofl_ctrl(), sc_force_variable_to_zero(), sc_rm_empty_constraints(), sc_supress_same_constraints(), and top_down_abc_dimension().
bool contrainte_in_liste | ( | Pcontrainte | c, |
Pcontrainte | lc | ||
) |
bool contrainte_in_liste(Pcontrainte c, Pcontrainte lc): test de l'appartenance d'une contrainte c a une liste de contrainte lc
Les contrainte sont supposees normalisees (coefficients reduits par leur PGCD, y compris les termes constants).
On considere que la contrainte nulle, qui ne represente aucune contrainte (elle est toujours verifiee) appartient a toutes les listes de contraintes.
lc | c |
Definition at line 52 of file listes.c.
References assert, CONTRAINTE_NULLE_P, CONTRAINTE_UNDEFINED_P, Scontrainte::succ, vect_equal(), and Scontrainte::vecteur.
Referenced by dj_simple_inegs_to_eg(), pa_path_to_few_disjunct_ofl_ctrl(), and sc_supress_same_constraints().
Pcontrainte contrainte_make | ( | Pvecteur | pv | ) |
Pcontrainte contrainte_make(Pvecteur pv): allocation et initialisation d'une contrainte avec un vecteur passe en parametre.
Modifications:
pv | v |
Definition at line 73 of file alloc.c.
References contrainte_new(), and contrainte_vecteur.
Referenced by __attribute__(), add_equivalence_equality(), adg_dataflowgraph(), adg_dataflowgraph_with_extremities(), adg_get_conjonctions(), adg_get_predicate_of_loops(), adg_max_of_leaves(), adg_suppress_2nd_in_1st_ps(), affine_to_transformer(), base_complete(), broadcast_conditions(), broadcast_dimensions(), broadcast_of_dataflow(), build_convex_constraints_from_vertices(), build_list_of_min(), build_sc_machine(), build_sc_with_several_uniform_ref(), c_convex_effects_on_actual_parameter_forward_translation(), check_range_wrt_precondition(), comp_exec_domain(), completer_base(), completer_n_base(), compose_vvs(), compute_entity_to_declaration_constraints(), constraint_to_bound(), contrainte_make_1D(), converti_psysmin_psysmax(), dependence_cone_positive(), dependence_system_add_lci_and_di(), dj_simple_inegs_to_eg(), dj_system_complement(), do_solve_hardware_constraints_on_nb_proc(), efficient_sc_check_inequality_feasibility(), elim_var_with_eg(), expression_less_than_in_context(), expressions_to_predicate(), expressions_to_vectors(), find_implicit_equation(), find_intermediate_constraints(), find_intermediate_constraints_recursively(), find_motif(), find_pattern(), fortran_user_function_call_to_transformer(), free_guards(), full_linearization(), gcd_and_constant_dependence_test(), generate_system_for_equal_variables(), generate_work_sharing_system(), generic_equality_to_transformer(), generic_minmax_to_transformer(), hpfc_compute_align_constraints(), hpfc_compute_distribute_constraints(), hpfc_compute_entity_to_new_declaration(), hpfc_compute_unicity_constraints(), include_parameters_in_sc(), integer_divide_to_transformer(), integer_power_to_transformer(), integer_right_shift_to_transformer(), interlaced_basic_workchunk_regions_p(), local_tile_constraints(), logical_binary_function_to_transformer(), logical_constant_to_transformer(), loop_basic_workchunk_to_workchunk(), loop_bounds_to_tile_bounds(), loop_executed_approximation(), loop_index_domaine_to_contrainte(), loop_regions_normalize(), make_context_of_loop(), make_dual(), make_expression_equalities(), make_reindex(), make_scanning_over_one_tile(), matrix_to_system(), my_adg_expressions_to_predicate(), nullify_factors(), pa_path_to_few_disjunct_ofl_ctrl(), partial_broadcast_coefficients(), partial_linearization(), Pcontrainte_separate_on_vars(), plc_elim_var_with_eg(), polynome_to_contrainte(), polynome_to_sc(), prepare_reindexing(), processor_loop(), prototype_dimension(), put_variables_in_ordered_lists(), re_do_it(), relation_to_transformer(), sc_elim_double_constraints(), sc_empty(), sc_find_equalities(), sc_gen_read(), sc_image_computation(), sc_minmax_of_variables(), sc_multiply_constant_terms(), sc_of_constrs(), sc_supress_same_constraints(), separate_variables(), set_dimensions_of_local_variable_family(), simple_addition_to_transformer(), simple_affine_to_transformer(), simplify_minmax_contrainte(), small_positive_slope_reduce_coefficients_with_bounding_box(), stmt_bdt_directions(), suppress_sc_in_sc(), tile_change_of_basis(), tile_hyperplane_constraints(), tile_membership_constraints(), top_down_abc_dimension(), transformer_add_loop_index_initialization(), transformer_add_sign_information(), transformer_add_variable_incrementation(), transformer_constraint_add(), transformer_convex_hulls(), transformer_derivative_constraints(), transformer_derivative_fix_point(), transformer_equality_fix_point(), transformer_list_generic_transitive_closure(), translate_global_value(), valuer(), vvs_on_vvs(), and vvs_to_sc().
Pcontrainte contrainte_make_1D | ( | Value | a, |
Variable | x, | ||
Value | b, | ||
bool | less_p | ||
) |
Generate a constraint a x <= b or a x >= b, according to less_p, or ax==b, regardless of less_p.
Since equalities and inequalities are not distinguished, less_p is not relevant when equations are built.
less_p | ess_p |
Definition at line 86 of file alloc.c.
References contrainte_make(), value_uminus, vect_make_1D(), VECTEUR_UNDEFINED, and x.
Referenced by add_bounding_box_constraints().
Pcontrainte contrainte_new | ( | void | ) |
CONTRAINTE.
cproto-generated files alloc.c
CONTRAINTE.
INTLIBRARY Pcontrainte contrainte_new(): allocation et initialisation d'une contrainte vide
Anciens noms: init_eq(), creer_eq
= (Pcontrainte)MALLOC(sizeof (Scontrainte),CONTRAINTE, "contrainte_new");
Definition at line 47 of file alloc.c.
References Scontrainte::eq_sat, exit, fprintf(), malloc(), Scontrainte::r_sat, Scontrainte::s_sat, Scontrainte::succ, and Scontrainte::vecteur.
Referenced by adg_sc_dup(), contrainte_copy(), contrainte_dup(), contrainte_make(), contraintes_make(), creer_Psysteme(), inegalite_comb_ofl_ctrl(), make_tile_constraints(), mat_sys_conv(), matrices_to_constraints(), matrices_to_constraints_with_sym_cst(), matrices_to_contraintes_with_sym_cst(), matrices_to_loop_sc(), matrices_to_sc(), my_matrices_to_constraints_with_sym_cst(), my_matrices_to_constraints_with_sym_cst_2(), pu_matrices_to_contraintes(), sc_copy(), sc_dup1(), tile_membership(), and var_posit().
bool contrainte_normalize | ( | Pcontrainte | c, |
bool | is_egalite | ||
) |
normalize.c
normalize.c
INTLIBRARY bool contrainte_normalize(Pcontrainte c, bool is_egalite): reduction par le pgcd de ses coefficients d'une egalite (is_egalite==true) ou d'une inegalite (is_egalite==false)
Dans le cas des egalites, la faisabilite est testee et retournee
Modifications:
is_c_norm: si is_egalite=true, equation faisable
pgcd des termes non constant de c
si le coefficient du terme constant est inferieur a ABS(a), on va obtenir un couple (TCST,coeff) avec un coefficient qui vaut 0, ceci est contraire a nos conventions
mise a jour du resultat de la division C if ( b0 < 0 && nb0 > 0) vect_add_elem(&(c->vecteur),0,-1); On n'en a plus besoin parce que vect_div utilise la division a reste toujours positif dont on a besoin
is_inegalite
is_egalite | s_egalite |
Definition at line 56 of file normalize.c.
References assert, TCST, term_cst, value_abs, value_mod, value_negz_p, value_notzero_p, value_uminus, VALUE_ZERO, value_zero_p, vect_chg_coeff(), vect_clean(), vect_coeff(), vect_div(), vect_pgcd_except(), vect_size(), Scontrainte::vecteur, VECTEUR_NUL_P, and vecteur_val.
Referenced by egalite_normalize(), inegalite_normalize(), sc_bounded_normalization(), sc_elim_double_constraints(), and sc_gcd_normalize().
bool contrainte_oppos | ( | Pcontrainte | ineg1, |
Pcontrainte | ineg2 | ||
) |
bool contrainte_oppos(Pcontrainte ineg1, Pcontrainte ineg2): indique si 2 inegalites forment une egalite ou si deux egalites sont equivalentes.
return(ineg1 == -ineg2);
ineg1 | neg1 |
ineg2 | neg2 |
Definition at line 258 of file predicats.c.
References vect_oppos().
bool contrainte_parallele | ( | Pcontrainte | c1, |
Pcontrainte | c2, | ||
Value * | pa1, | ||
Value * | pa2 | ||
) |
Les deux contraintes c1 et c2 sont paralleles s'il existe deux coefficients a1 et a2 tels que a1 c1 + a2 c2 est reduit un terme constant K.
On cherche une composante quelconque relative a une variable
c1 | 1 |
c2 | 2 |
pa1 | a1 |
pa2 | a2 |
Definition at line 145 of file predicats.c.
References CONTRAINTE_UNDEFINED_P, contrainte_vecteur, TCST, vect_add(), vect_coeff(), vect_constant_p(), vect_copy(), vect_multiply(), vect_rm(), vect_size(), VECTEUR_NUL_P, vecteur_succ, and vecteur_var.
Referenced by sc_safe_elim_db_constraints().
Pcontrainte contrainte_remove_large_coef | ( | Pcontrainte | lc, |
Value | val | ||
) |
lc | list of constraint, which is modified |
val | maximum value allowed for coefficients |
lc | c |
val | al |
Definition at line 179 of file listes.c.
References contrainte_free(), linear_assert, Scontrainte::succ, value_posz_p, value_zero_p, vect_larger_coef_p(), and Scontrainte::vecteur.
Referenced by sc_remove_large_coef().
void contrainte_reverse | ( | Pcontrainte | c | ) |
void contrainte_reverse(Pcontrainte eq): changement de signe d'une contrainte, i.e.
multiplication par -1, et ajout de la constante 1.
Definition at line 67 of file unaires.c.
References contrainte_chg_sgn(), TCST, VALUE_ONE, and vect_add_elem().
Referenced by build_integer_sc_nredund(), build_sc_nredund_1pass_ofl_ctrl(), ineq_redund_with_sc_p(), sc_elim_redund_with_first_ofl_ctrl(), sc_inequations_elim_redund(), sc_triang_elim_redund(), and sc_triang_elim_redund_n_first().
Variable contrainte_simple_equality | ( | Pcontrainte | e | ) |
returns whether a constraint is a simple equality: X == 12 the system is expected to be normalized?
Definition at line 521 of file unaires.c.
References Svecteur::succ, Svecteur::var, vect_size(), and Scontrainte::vecteur.
char* contrainte_sprint | ( | char * | , |
Pcontrainte | , | ||
bool | , | ||
char * | *)(Variable | ||
) |
char* contrainte_sprint_format | ( | char * | , |
Pcontrainte | , | ||
bool | , | ||
char * | *)(Variable, | ||
bool | |||
) |
int contrainte_subst | ( | Variable | v, |
Pcontrainte | def, | ||
Pcontrainte | c, | ||
bool | eq_p | ||
) |
def | ef |
eq_p | q_p |
Definition at line 48 of file binaires.c.
References contrainte_subst_ofl_ctrl(), and NO_OFL_CTRL.
int contrainte_subst_ofl | ( | Variable | v, |
Pcontrainte | def, | ||
Pcontrainte | c, | ||
bool | eq_p | ||
) |
binaires.c
binaires.c
def | ef |
eq_p | q_p |
Definition at line 40 of file binaires.c.
References contrainte_subst_ofl_ctrl(), and FWD_OFL_CTRL.
int contrainte_subst_ofl_ctrl | ( | Variable | v, |
Pcontrainte | def, | ||
Pcontrainte | c, | ||
bool | eq_p, | ||
int | ofl_ctrl | ||
) |
int contrainte_subst_ofl_ctrl(Variable v, Pcontrainte def, Pcontrainte c
Boolean eq_p, int ofl_ctrl): elimination d'une variable v entre une equation def et une contrainte, egalite ou inegalite, c.
La contrainte c est modifiee en substituant v par sa valeur impliquee par def.
La contrainte c est interpretee comme une inegalite et la valeur retournee vaut: -1 si la contrainte c est trivialement verifiee et peut etre eliminee 0 si la contrainte c est trivialement impossible 1 sinon (tout va bien) Si la contrainte c passee en argument etait trivialement impossible ou trivialement verifiee, aucune subsitution n'a lieu et la valeur 1 est retournee.
La substitution d'une variable dans une inegalite peut aussi introduire une non-faisabilite testable par calcul de PGCD, mais cela n'est pas fait puisqu'on ne sait pas si c est une egalite ou une inegalite. Le traitement du terme constant n'est pas decidable.
Note: il faudrait separer le probleme de la combinaison lineaire a coefficients positifs de celui de la faisabilite et de la trivialite
Le controle de l'overflow est effectue et traite par le retour du contexte correspondant au dernier CATCH(overflow_error) effectue.
cv_def = coeff de v dans def
cv_c = coeff de v dans c
il faut que cv_def soit non nul pour que la variable v puisse etre eliminee
il n'y a rien a faire si la variable v n'apparait pas dans la contrainte c
substitution inutile: variable v absente
on garde trace de la valeur de c avant substitution pour pouvoir la desallouer apres le calcul de la nouvelle
on ne fait pas de distinction entre egalites et inegalites, mais on prend soin de toujours multiplier la contrainte, inegalite potentielle, par un coefficient positif
reste malikien: cette partie ne peut pas etre faite sans savoir si on est en train de traiter une egalite ou une inegalite
=> eliminer cette c inutile
=> systeme non faisable
def | ef |
eq_p | q_p |
ofl_ctrl | fl_ctrl |
Definition at line 107 of file binaires.c.
References assert, contrainte_constante_p(), contrainte_verifiee(), value_neg_p, value_notzero_p, value_uminus, value_zero_p, vect_cl2_ofl_ctrl(), vect_coeff(), vect_rm(), and Scontrainte::vecteur.
Referenced by better_elim_var_with_eg(), contrainte_subst(), contrainte_subst_ofl(), and new_elim_var_with_eg().
Pcontrainte contrainte_substitute_dimension | ( | Pcontrainte | e, |
Variable | i, | ||
Pvecteur | v | ||
) |
Definition at line 57 of file binaires.c.
References contrainte_vecteur, and vect_substitute_dimension().
Referenced by sc_substitute_dimension().
Pcontrainte contrainte_translate | ( | Pcontrainte | , |
Pbase | , | ||
char * | *)(void | ||
) |
Pcontrainte contrainte_var_min_coeff | ( | Pcontrainte | contraintes, |
Variable | v, | ||
Value * | coeff, | ||
bool | rm_if_not_first_p | ||
) |
Pcontrainte contrainte_var_min_coeff(Pcontrainte contraintes, Variable v, int *coeff) input : a list of constraints (euqalities or inequalities), a variable, and the location of an integer.
output : the constraint in "contraintes" where the coefficient of "v" is the smallest (but non-zero). modifies : nothing. comment : the returned constraint is not removed from the list if rm_if_not_first_p is false. if rm_if_not_first_p is true, the returned contraint is remove only if it is not the first constraint.
contraintes | ontraintes |
coeff | oeff |
rm_if_not_first_p | m_if_not_first_p |
Definition at line 345 of file unaires.c.
References contrainte_chg_sgn(), eq, Scontrainte::succ, value_abs, value_lt, value_neg_p, value_notzero_p, value_pos_p, VALUE_ZERO, value_zero_p, vect_coeff(), and Scontrainte::vecteur.
Referenced by better_elim_var_with_eg(), new_elim_var_with_eg(), remove_variables_if_possible(), and sc_projection_optim_along_vecteur_ofl().
Pcontrainte contrainte_variable_rename | ( | Pcontrainte | c, |
Variable | v_old, | ||
Variable | v_new | ||
) |
Pcontrainte contrainte_variable_rename(Pcontrainte c, Variable v_old, Variable v_new): rename the potential coordinate v_old in c as v_new.
v_old | _old |
v_new | _new |
Definition at line 115 of file unaires.c.
References CONTRAINTE_UNDEFINED_P, contrainte_vecteur, and vect_variable_rename().
Referenced by sc_variable_rename().
void contrainte_vect_sort | ( | Pcontrainte | , |
int(*)(Pvecteur *, Pvecteur *) | |||
) |
Referenced by sc_lexicographic_sort(), and sc_vect_sort().
bool contrainte_verifiee | ( | Pcontrainte | ineg, |
bool | eq_p | ||
) |
bool contrainte_verifiee(Pcontrainte ineg, bool eq_p): test de faisabilite d'inegalite (eq_p == false) ou d'egalite triviale
Le test est different pour les egalites.
Modifications:
l'inegalite 0 <= 0 est representee par un vecteur nul
l'inegalite 0 <= K est representee par un vecteur a un element
ineg | neg |
eq_p | q_p |
Definition at line 234 of file predicats.c.
References assert, contrainte_constante_p(), CONTRAINTE_NULLE_P, val_of, value_negz_p, and value_zero_p.
Referenced by combiner_ofl_with_test(), contrainte_subst_ofl_ctrl(), and sc_strong_normalize_and_check_feasibility().
Pcontrainte contraintes_copy | ( | Pcontrainte | c_in | ) |
Pcontrainte contraintes_copy(Pcontrainte c_in) a list of constraints is copied with the same order In fact, here we only need to replace contrainte_dup by contrainte_copy Have a look at contrainte_copy (DN,24/6/02)
c_in | _in |
Definition at line 270 of file alloc.c.
References c_in, c_out, contrainte_copy(), and Scontrainte::succ.
Referenced by build_sc_nredund_1pass_ofl_ctrl().
Pcontrainte contraintes_dup | ( | Pcontrainte | c_in | ) |
Pcontrainte contraintes_dup(Pcontrainte c_in) a list of constraints is copied.
c_in | _in |
Definition at line 146 of file alloc.c.
References c_in, c_out, contrainte_dup(), and Scontrainte::succ.
Referenced by constraints_to_loop_bound(), and dj_simple_inegs_to_eg().
Pcontrainte contraintes_free | ( | Pcontrainte | pc | ) |
Pcontrainte contraintes_free(Pcontrainte pc): desallocation de toutes les contraintes de la liste pc.
chaque contrainte est detruite par un appel a contrainte_free.
Ancien nom: elim_tte_ineg()
pc | c |
Definition at line 226 of file alloc.c.
References contrainte_free(), CONTRAINTE_UNDEFINED, CONTRAINTE_UNDEFINED_P, and Scontrainte::succ.
Referenced by apply_abstract_effect_to_transformer(), combiner_ofl_with_test(), extract_lattice(), generic_minmax_to_transformer(), hpfc_broadcast_buffers(), hpfc_compute_lid(), make_rectangular_area(), reset_equivalence_equalities(), sc_resol_smith(), sc_rm(), sc_transform_eg_in_ineg(), smith_int(), systeme_to_loop_nest(), transformer_basic_fix_point(), transformer_pattern_fix_point(), and translate_to_module_frame().
Pcontrainte contraintes_make | ( | Pvecteur | pv, |
... | |||
) |
Convert a list of vectors into a list of constraints.
pv | v |
Definition at line 99 of file alloc.c.
References contrainte_new(), contrainte_succ, contrainte_vecteur, and VECTEUR_NUL.
Referenced by find_intermediate_constraints().
bool cyclic_constraint_list_p | ( | Pcontrainte | l | ) |
Check if list l contains a cycle.
Definition at line 141 of file listes.c.
References constraint_rank(), and Scontrainte::succ.
Referenced by sc_bounded_normalization().
void dbg_contrainte_rm | ( | Pcontrainte | c, |
char * | f | ||
) |
void dbg_contrainte_rm(Pcontrainte c): version debug de contrainte rm; trace de la desallocation et impression de la contrainte sur stdout
rint_eq(c);
REE((char *)c,CONTRAINTE,f);
Definition at line 239 of file alloc.c.
References dbg_vect_rm(), f(), free(), printf(), and Scontrainte::vecteur.
void egalite_dump | ( | Pcontrainte | c | ) |
void egalite_dump(Pcontrainte c): impression "physique" d'une egalite; utilise en debugging
Definition at line 160 of file io.c.
References egalite_fprint(), and variable_debug_name.
bool egalite_equal | ( | Pcontrainte | eg1, |
Pcontrainte | eg2 | ||
) |
bool egalite_equal(Pcontrainte eg1, Pcontrainte eg2): teste l'equivalence de deux egalites; leurs coefficients peuvent etre tous egaux ou tous opposes; pour obtenir une meilleure equivalence il faut commencer par reduire leurs coefficients par les PGCD
Soit eg1, sum a1i xi = b1, et eg2, sum a2i xi = b2. i i return a1i == a2i || a1i == -a2i; i i
Note: 2x=2 est different de x=1
eg1 | g1 |
eg2 | g2 |
Definition at line 98 of file predicats.c.
References CONTRAINTE_UNDEFINED_P, vect_equal(), vect_oppos(), and Scontrainte::vecteur.
Referenced by extract_common_constraints(), free_guards(), sc_elim_db_constraints(), sc_elim_double_constraints(), sc_kill_db_eg(), sc_safe_elim_db_constraints(), and sc_safe_kill_db_eg().
void egalite_fprint | ( | FILE * | , |
Pcontrainte | , | ||
char * | *)(Variable | ||
) |
Referenced by egalite_debug(), put_variables_in_ordered_lists(), sc_fprint(), and sl_fprint_tab().
bool egalite_in_liste | ( | Pcontrainte | v, |
Pcontrainte | listev | ||
) |
bool egalite_in_liste(Pcontrainte eg, Pcontrainte leg): test si une egalite appartient a une liste d'egalites
Une egalite peut avoir ete multipliee par moins 1 mais ses coefficients, comme les coefficients des egalites de la liste, doivent avoir ete reduits par leur PGCD auparavant
Ancien nom: vect_in_liste1()
listev | istev |
Definition at line 108 of file listes.c.
References Scontrainte::succ, vect_equal(), vect_oppos(), and Scontrainte::vecteur.
bool egalite_normalize | ( | Pcontrainte | eg | ) |
bool egalite_normalize(Pcontrainte eg): reduction d'une equation diophantienne par le pgcd de ses coefficients; l'equation est infaisable si le terme constant n'est pas divisible par ce pgcd
Soit eg == sum ai xi = b i Soit k = pgcd ai i eg := eg/k
return b % k == 0 || all ai == 0 && b != 0;
eg | g |
Definition at line 136 of file normalize.c.
References contrainte_normalize().
Referenced by better_elim_var_with_eg(), gcd_and_constant_dependence_test(), new_elim_var_with_eg(), sc_add_normalize_eq(), sc_bounded_normalization(), sc_minmax_of_variable2(), sc_normalize(), sc_strong_normalize2(), sc_strong_normalize_and_check_feasibility(), and sc_strong_normalize_and_check_feasibility2().
char* egalite_sprint | ( | char * | , |
Pcontrainte | , | ||
char * | *)(Variable | ||
) |
char* egalite_sprint_format | ( | char * | , |
Pcontrainte | , | ||
char * | *)(Variable, | ||
bool | |||
) |
void egalites_dump | ( | Pcontrainte | eg | ) |
eg | g |
Definition at line 201 of file io.c.
References egalites_fprint(), and variable_debug_name.
void egalites_fprint | ( | FILE * | , |
Pcontrainte | , | ||
char * | *)(Variable | ||
) |
Referenced by build_transfer_equations(), sc_default_dump(), sc_default_dump_to_files(), sc_dump(), and sc_fprint_for_sc_fscan().
Value eq_diff_const | ( | Pcontrainte | c1, |
Pcontrainte | c2 | ||
) |
Value eq_diff_const(Pcontrainte c1, Pcontrainte c2): calcul de la difference des deux termes constants des deux equations c1 et c2.
Notes:
Modifications:
c1 | 1 |
c2 | 2 |
Definition at line 218 of file binaires.c.
References b1, b2, TCST, value_minus, value_uminus, VALUE_ZERO, and vect_coeff().
Referenced by sc_check_inequality_redundancy(), sc_elim_simple_redund_with_eq(), and sc_elim_simple_redund_with_ineq().
void eq_set_vect_nul | ( | Pcontrainte | c | ) |
void_eq_set_vect_nul(Pcontrainte c): transformation d'une contrainte en une contrainte triviale 0 == 0
cette fonction est utile lorsque l'on veut eliminer plusieurs
contraintes du systeme sans avoir a le restructurer apres chaque
elimination.
Pour eliminer toutes ces "fausses" contraintes on utilise a la fin la
fonction "syst_elim_eq" (ou "sc_rm_empty_constraints"...)
Definition at line 84 of file unaires.c.
References CONTRAINTE_UNDEFINED_P, contrainte_vecteur, vect_rm(), and VECTEUR_NUL.
Referenced by elim_redund_sc_with_sc(), sc_bounded_normalization(), sc_elim_db_constraints(), sc_elim_double_constraints(), sc_elim_redund_with_first_ofl_ctrl(), sc_elim_simple_redund_with_eq(), sc_elim_simple_redund_with_ineq(), sc_inequations_elim_redund(), sc_kill_db_eg(), sc_safe_elim_db_constraints(), sc_safe_kill_db_eg(), sc_strong_normalize_and_check_feasibility(), sc_transform_ineg_in_eg(), sc_triang_elim_redund(), sc_triang_elim_redund_n_first(), simplify_big_coeff(), and sys_int_redond().
bool eq_smg | ( | Pcontrainte | c1, |
Pcontrainte | c2 | ||
) |
INTLIBRARY bool eq_smg(Pcontrainte c1, Pcontrainte c2): comparaison des coefficients de deux contraintes pour savoir si elles ont le meme membre gauche.
Note: this works for inequalities. Similar equations may differ by a factor of -1.
c1 | 1 |
c2 | 2 |
Definition at line 52 of file predicats.c.
References TCST, and vect_equal_except().
Referenced by sc_check_inequality_redundancy(), sc_elim_double_constraints(), sc_elim_simple_redund_with_eq(), and sc_elim_simple_redund_with_ineq().
Value eq_sum_const | ( | Pcontrainte | c1, |
Pcontrainte | c2 | ||
) |
Value eq_sum_const(Pcontrainte c1, Pcontrainte c2): calcul de la somme des deux termes constants des deux contraintes c1 et c2.
Notes:
c1 | 1 |
c2 | 2 |
Definition at line 243 of file binaires.c.
References b1, b2, TCST, value_plus, VALUE_ZERO, and vect_coeff().
Referenced by sc_check_inequality_redundancy().
Definition at line 369 of file predicats.c.
References contrainte_eval_p().
Referenced by sc_belongs_p(), and sc_internal_p().
int equation_lexicographic_compare | ( | Pcontrainte | c1, |
Pcontrainte | c2, | ||
int(*)(Pvecteur *, Pvecteur *) | compare | ||
) |
it is assumed that constraints c1 and c2 are already lexicographically sorted
c1 | 1 |
c2 | 2 |
Definition at line 395 of file unaires.c.
References vect_lexicographic_compare(), and Scontrainte::vecteur.
Referenced by internal_equation_compare().
Pcontrainte equations_lexicographic_sort | ( | Pcontrainte | cl, |
int(*)(Pvecteur *, Pvecteur *) | compare | ||
) |
cl | l |
Definition at line 438 of file unaires.c.
References constraints_lexicographic_sort_generic(), and CONTRAINTE_UNDEFINED.
Referenced by sc_lexicographic_sort().
Pcontrainte extract_common_constraints | ( | Pcontrainte * | pc1, |
Pcontrainte * | pc2, | ||
bool | eq | ||
) |
common (simply equal) contraints are extracted, whether equalities or inequalities.
returns the common extracted constaints. WARNING: *pc1 and *pc2 are modified.
common!
link to result.
clean
get to next.
pc1 | c1 |
pc2 | c2 |
eq | q |
Definition at line 285 of file binaires.c.
References contrainte_equal(), contrainte_free(), CONTRAINTE_UNDEFINED, egalite_equal(), eq, and Scontrainte::succ.
Referenced by extract_common_syst().
Pcontrainte inegalite_comb | ( | Pcontrainte | posit, |
Pcontrainte | negat, | ||
Variable | v | ||
) |
posit | osit |
negat | egat |
Definition at line 65 of file binaires.c.
References inegalite_comb_ofl_ctrl(), and NO_OFL_CTRL.
Pcontrainte inegalite_comb_ofl | ( | Pcontrainte | posit, |
Pcontrainte | negat, | ||
Variable | v | ||
) |
posit | osit |
negat | egat |
Definition at line 72 of file binaires.c.
References FWD_OFL_CTRL, and inegalite_comb_ofl_ctrl().
Pcontrainte inegalite_comb_ofl_ctrl | ( | Pcontrainte | posit, |
Pcontrainte | negat, | ||
Variable | v, | ||
int | ofl_ctrl | ||
) |
Pcontrainte inegalite_comb_ofl_ctrl(Pcontrainte posit, Pcontrainte negat, Variable v, int ofl_ctrl): combinaison lineaire positive des deux inegalites posit et negat eliminant la variable v.
Une nouvelle contrainte est allouee et renvoyee.
Si le coefficient de v dans negat egale -1 ou si le coefficient de v dans posit egale 1, la nouvelle contrainte est equivalente en nombres entiers avec posit et negat.
Modifications:
Le controle de l'overflow est effectue et traite par le retour du contexte correspondant au dernier CATCH(overflow_error) effectue.
pdiv ???
posit | osit |
negat | egat |
ofl_ctrl | fl_ctrl |
Definition at line 179 of file binaires.c.
References assert, contrainte_new(), pgcd, value_div, value_neg_p, value_notone_p, value_pos_p, value_uminus, vect_cl2_ofl_ctrl(), vect_coeff(), and Scontrainte::vecteur.
Referenced by inegalite_comb(), and inegalite_comb_ofl().
void inegalite_dump | ( | Pcontrainte | c | ) |
void inegalite_dump(Pcontrainte c): impression "physique" d'une inegalite; utilise en debugging
Definition at line 182 of file io.c.
References inegalite_fprint(), and variable_debug_name.
void inegalite_fprint | ( | FILE * | , |
Pcontrainte | , | ||
char * | *)(Variable | ||
) |
Referenced by inegalite_debug(), sc_fprint(), and sl_fprint_tab().
bool inegalite_normalize | ( | Pcontrainte | ineg | ) |
bool inegalite_normalize(Pcontrainte ineg): normalisation d'une inegalite a variables entieres; voir contrainte_normalize; retourne presque toujours true car une inegalite n'ayant qu'un terme constant est toujours faisable a moins qu'il ne reste qu'un terme constant strictement positif.
Soit eg == sum ai xi <= b i Soit k = pgcd ai i eg := eg/k
return true unless all ai are 0 and b < 0
ineg | neg |
Definition at line 156 of file normalize.c.
References contrainte_normalize().
Referenced by sc_add_normalize_ineq(), sc_bounded_normalization(), sc_normalize(), and sc_strong_normalize_and_check_feasibility().
char* inegalite_sprint | ( | char * | , |
Pcontrainte | , | ||
char * | *)(Variable | ||
) |
char* inegalite_sprint_format | ( | char * | , |
Pcontrainte | , | ||
char * | *)(Variable, | ||
bool | |||
) |
void inegalites_dump | ( | Pcontrainte | eg | ) |
eg | g |
Definition at line 220 of file io.c.
References inegalites_fprint(), and variable_debug_name.
Referenced by build_convex_constraints_from_vertices(), check_coefficient_reduction(), and sc_bounded_normalization().
void inegalites_fprint | ( | FILE * | , |
Pcontrainte | , | ||
char * | *)(Variable | ||
) |
Referenced by constraints_to_loop_bound(), sc_default_dump(), sc_default_dump_to_files(), sc_dump(), and sc_fprint_for_sc_fscan().
Pcontrainte inequalities_lexicographic_sort | ( | Pcontrainte | cl, |
int(*)(Pvecteur *, Pvecteur *) | compare | ||
) |
cl | l |
Definition at line 449 of file unaires.c.
References constraints_lexicographic_sort_generic(), and CONTRAINTE_UNDEFINED.
Referenced by sc_lexicographic_sort().
bool inequalities_opposite_p | ( | Pcontrainte | c1, |
Pcontrainte | c2 | ||
) |
bool inequalities_opposite_p(Pcontrainte c1, Pcontrainte c2): True if the non-constant part of c1 is the opposite of the non-constant part of c2.
c1 | 1 |
c2 | 2 |
Definition at line 71 of file predicats.c.
References TCST, and vect_opposite_except().
Referenced by sc_check_inequality_redundancy().
Definition at line 374 of file predicats.c.
References contrainte_eval_p().
Referenced by sc_belongs_p().
int inequality_lexicographic_compare | ( | Pcontrainte | c1, |
Pcontrainte | c2, | ||
int(*)(Pvecteur *, Pvecteur *) | compare | ||
) |
it is assumed that constraints c1 and c2 are already lexicographically sorted
c1 | 1 |
c2 | 2 |
Definition at line 416 of file unaires.c.
References vect_lexicographic_compare2(), and Scontrainte::vecteur.
Referenced by internal_inequality_compare().
int level_contrainte | ( | Pcontrainte | pc, |
Pbase | base_index | ||
) |
int level_contrainte(Pcontrainte pc, Pbase base_index) compute the level (rank) of the constraint pc in the nested loops.
base_index is the index basis in the good order The result corresponds to the rank of the greatest index in the constraint, and the sign of the result corresponds to the sign of the coefficient of this index
For instance: base_index :I->J->K , I - J <=0 ==> level -2 I + J + K <=0 ==> level +3
pc | c |
base_index | ase_index |
Definition at line 292 of file unaires.c.
References level, Svecteur::succ, Svecteur::val, value_sign, and Svecteur::var.
Referenced by make_bound_expression(), and sc_triang_elim_redund().
int nb_elems_list | ( | Pcontrainte | list | ) |
int nb_elems_list(Pcontrainte list): nombre de contraintes se trouvant dans une liste de contraintes
Ancien nom: nb_elems_eq()
Cycles are not detected
list | ist |
Definition at line 129 of file listes.c.
References Scontrainte::succ.
Referenced by bounds_equal_p(), build_third_comb(), combiner_ofl_with_test(), constraints_lexicographic_sort_generic(), constraints_sort_info(), loop_iteration_domaine_to_sc(), prepare_reindexing(), region_sc_minimal(), sc_add_egalites(), sc_add_inegalites(), sc_elim_var(), sc_fix(), sc_make(), sc_projection_optim_along_vecteur_ofl(), sc_remove_large_coef(), and sc_weak_consistent_p().
void norm_eq | ( | Pcontrainte | nr | ) |
unaires.c
unaires.c
norm_eq: normalisation d'une contrainte par le pgcd de TOUS les coefficients, i.e. y compris le terme constant
nr | r |
Definition at line 44 of file unaires.c.
References vect_normalize().
Referenced by norm_syst().
void Pcontrainte_separate_on_vars | ( | Pcontrainte | initial, |
Pbase | vars, | ||
Pcontrainte * | pwith, | ||
Pcontrainte * | pwithout | ||
) |
void Pcontrainte_separate_on_vars(initial, vars, pwith, pwithout) Pcontrainte initial; Pbase vars; Pcontrainte *pwith, *pwithout;
IN: initial, vars
OUT: pwith, pwithout
builds two Pcontraintes from the one given, using the constraint_without_vars criterium.
(c) FC 16/05/94
initial | nitial |
vars | ars |
pwith | with |
pwithout | without |
Definition at line 140 of file unaires.c.
References constraint_without_vars(), contrainte_make(), CONTRAINTE_UNDEFINED, Scontrainte::succ, vect_dup(), and Scontrainte::vecteur.
Referenced by get_other_constraints(), and sc_separate_on_vars().
int safe_nb_elems_list | ( | Pcontrainte | list, |
int | n | ||
) |
Compute the number of elements in the list if it is less than n.
n is assumed positive. A negative value is returned if the number of elements is strictly greater than n, for instance because the list is cyclic.
list | ist |
Definition at line 162 of file listes.c.
References assert, and Scontrainte::succ.
Referenced by sc_consistent_p().
is_inegalite | s_inegalite |
a_la_fortran | _la_fortran |
Definition at line 224 of file io.c.
Referenced by heuristique_1(), and heuristique_3().
bool vect_constant_p(Pvecteur v): v contains only a constant term, may be zero
Bugs:
Definition at line 211 of file predicats.c.
References TCST, and VECTEUR_NUL_P.
Referenced by add_declaration_list_information(), add_reference_information(), contrainte_constante_p(), contrainte_parallele(), convert_bound_expression(), dims_array_init(), expression_and_precondition_to_integer_interval(), expression_equal_in_context_p(), expression_less_than_in_context(), expression_to_int(), IsExprConst(), loop_index_domaine_to_contrainte(), loop_regions_normalize(), region_projection_along_index_safe_p(), sc_elim_double_constraints(), signed_integer_constant_expression_value(), text_equivalence_class(), and trivial_expression_p().