77 if (SC_UNDEFINED_P(ps))
80 for (pc = ps->egalites; pc != NULL; pc = pc->
succ)
156 if (SC_EMPTY_P(ps))
return false;
168 if (!
sc_rn_p(ps) && !SC_EMPTY_P(ps) && v != var) {
169 ps = sc_projection(ps, v);
177 if (SC_EMPTY_P(ps))
return false;
184 for (pc = ps->inegalites; pc != NULL; pc = pc->
succ) {
231 sc_add_ineg(ps2, pc);
237 sc_add_ineg(ps2, pc);
285 ps->inegalites = pcs;
336 #define if_debug_sc_minmax_of_variable2 if(false)
338 volatile bool feasible_p =
true;
341 fprintf(stderr,
"[sc_minmax_of_variable2]: Begin\n");
344 if(SC_UNDEFINED_P(ps)) {
347 "[sc_minmax_of_variable2]: Empty system as input\n");
354 "[sc_minmax_of_variable2]:"
355 " Non-feasibility detected by first call to sc_normalize\n");
364 volatile int neq = sc_nbre_egalites(ps);
368 "[sc_minmax_of_variable2]: After call to sc_normalize\n");
369 fprintf(stderr,
"[sc_minmax_of_variable2]: Input system %p\n",
385 feasible_p && neq > 0 && nvar <=
level ;
387 for(
eq = sc_egalites(ps);
417 bool value_found_p =
false;
426 if ((pv->
var == var) &&
432 value_found_p =
true;
434 else if ((pv->
succ->
var == var) &&
440 value_found_p =
true;
443 value_found_p =
false;
447 if (pv->
var == var) {
450 value_found_p =
true;
453 value_found_p =
false;
493 if(nv!=
TCST && (nv!=var||value_found_p)) {
494 v2 = (v2==
TCST)? nv : v2;
503 v = (v1==
TCST)? v2 : v1;
507 assert(v!=var||value_found_p);
518 sc_simple_variable_substitution_with_eq_ofl_ctrl
577 "Print the two systems at each nvar=%d step:\n", nvar);
578 fprintf(stderr,
"[sc_minmax_of_variable2]: Input system %p\n",
587 feasible_p = feasible_p && !SC_EMPTY_P(ps =
sc_normalize(ps));
599 "Print System ps after projection and normalization:\n");
600 fprintf(stderr,
"[sc_minmax_of_variable2]: Input system ps %p\n",
624 if(!SC_UNDEFINED_P(ps)) {
631 "[sc_minmax_of_variable2]: feasible=%d, min=", feasible_p);
635 fprintf(stderr,
"\n[sc_minmax_of_variable2]: End\n");
#define value_pdiv(v1, v2)
#define value_uminus(val)
unary operators on values
#define value_zero_p(val)
#define value_mod(v1, v2)
#define value_div(v1, v2)
void fprint_Value(FILE *, Value)
bool base_contains_variable_p(Pbase b, Variable v)
bool base_contains_variable_p(Pbase b, Variable v): returns true if variable v is one of b's elements...
#define CONTRAINTE_UNDEFINED_P(c)
#define CONTRAINTE_NULLE_P(c)
contrainte nulle (non contrainte 0 == 0 ou 0 <= 0)
#define contrainte_succ(c)
#define contrainte_vecteur(c)
passage au champ vecteur d'une contrainte "a la Newgen"
#define CONTRAINTE_UNDEFINED
struct Scontrainte * Pcontrainte
#define contrainte_rm(c)
the standard xxx_rm does not return a value
Pcontrainte contrainte_make(Pvecteur pv)
Pcontrainte contrainte_make(Pvecteur pv): allocation et initialisation d'une contrainte avec un vecte...
Pcontrainte contrainte_free(Pcontrainte c)
Pcontrainte contrainte_free(Pcontrainte c): liberation de l'espace memoire alloue a la contrainte c a...
Pcontrainte contrainte_dup(Pcontrainte c_in)
Pcontrainte contrainte_dup(Pcontrainte c_in): allocation d'une contrainte c_out prenant la valeur de ...
bool egalite_normalize(Pcontrainte)
bool egalite_normalize(Pcontrainte eg): reduction d'une equation diophantienne par le pgcd de ses coe...
bool contrainte_constante_p(Pcontrainte)
bool contrainte_constante_p(Pcontrainte c): test de contrainte triviale sans variables (ie du type 0<...
int vect_dimension(Pvecteur v)
int vect_dimension(Pvecteur v): calcul du nombre de composantes non nulles et non constantes d'un vec...
bool sc_rn_p(Psysteme sc)
bool sc_rn_p(Psysteme sc): check if the set associated to sc is the whole space, rn
void sc_creer_base(Psysteme ps)
void sc_creer_base(Psysteme ps): initialisation des parametres dimension et base d'un systeme lineair...
void sc_rm(Psysteme ps)
void sc_rm(Psysteme ps): liberation de l'espace memoire occupe par le systeme de contraintes ps;
Psysteme sc_dup(Psysteme ps)
Psysteme sc_dup(Psysteme ps): should becomes a link.
Psysteme sc_elim_double_constraints(Psysteme ps)
Psysteme sc_elim_double_constraints(Psysteme ps): elimination des egalites et des inegalites identiqu...
static bool huge_system(Psysteme ps)
#define if_debug_sc_minmax_of_variable2
void sc_force_variable_to_zero(Psysteme ps, Variable var)
void sc_force_variable_to_zero(Psysteme ps, Variable var): force la variable var a prendre la valeur ...
bool sc_minmax_of_variable(Psysteme ps, Variable var, Value *pmin, Value *pmax)
void sc_minmax_of_variable(Psysteme ps, Variable var, Value *pmin, *pmax): examine un systeme pour tr...
bool sc_value_of_variable(Psysteme ps, Variable var, Value *pval)
bool sc_value_for_variable(Psysteme ps, Variable var, Value *pval): examine les egalites du systeme p...
void sc_minmax_of_variables(Psysteme ps1, Psysteme ps2, Pbase b)
This function uses sc_minmax_of_variable to compute the min and max of each variable belonging to bas...
bool sc_minmax_of_variable2(volatile Psysteme ps, Variable var, Value *pmin, Value *pmax)
void sc_minmax_of_variable2(Psysteme ps, Variable var, Value *pmin, *pmax): examine un systeme pour t...
Pcontrainte eq
element du vecteur colonne du systeme donne par l'analyse
void sc_dump(Psysteme sc)
void sc_dump(Psysteme sc): dump to stderr
int fprintf()
test sc_min : ce test s'appelle par : programme fichier1.data fichier2.data ...
Psysteme sc_normalize(Psysteme ps)
Psysteme sc_normalize(Psysteme ps): normalisation d'un systeme d'equation et d'inequations lineaires ...
Psysteme sc_elim_var(Psysteme sc, Variable v)
package sur les systemes de contraintes sc
struct Scontrainte * succ
le type des coefficients dans les vecteurs: Value est defini dans le package arithmetique
#define TCST
VARIABLE REPRESENTANT LE TERME CONSTANT.
#define VECTEUR_NUL
DEFINITION DU VECTEUR NUL.
void * Variable
arithmetique is a requirement for vecteur, but I do not want to inforce it in all pips files....
#define VECTEUR_UNDEFINED_P(v)
Pvecteur vect_make(Pvecteur v, Variable var, Value val,...)
Pvecteur vect_make(v, [var, val,]* 0, val) Pvecteur v; // may be NULL, use assigne anyway Variable va...
Pbase vect_copy(Pvecteur b)
direct duplication.
void vect_rm(Pvecteur v)
void vect_rm(Pvecteur v): desallocation des couples de v;
void vect_erase_var(Pvecteur *ppv, Variable v)
void vect_erase_var(Pvecteur * ppv, Variable v): projection du vecteur *ppv selon la direction v (i....
Value vect_coeff(Variable var, Pvecteur vect)
Variable vect_coeff(Variable var, Pvecteur vect): coefficient de coordonnee var du vecteur vect —> So...