73 { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
74 { 1, 1, 1, 0, 0, 0, 0, 0, 0, 1 },
75 { 2, 2, 2, 0, 0, 0, 0, 0, 0, 2 },
76 { 3, 9, 9, 3, 0, 0, 3, 0, 3, 3 },
77 { 4, 9, 9, 6, 4, 4, 4, 0, 4, 4 },
78 { 5, 9, 9, 6, 5, 5, 5, 0, 5, 5 },
79 { 6, 9, 9, 6, 6, 6, 6, 0, 6, 6 },
80 { 7, 9, 9, 8, 8, 8, 8, 7, 7, 7 },
81 { 8, 9, 9, 8, 8, 8, 8, 8, 8, 8 },
82 { 9, 9, 9, 9, 9, 9, 9, 9, 9, 9 }};
85 #define hspara_join(se1, se2) (((se1) >= (se2))?hspara_jm[(se1)][(se2)]:hspara_jm[(se2)][(se1)])
86 #define hspara_meet(se1, se2) (((se1) <= (se2))?hspara_jm[(se1)][(se2)]:hspara_jm[(se2)][(se1)])
87 #define hspara_to_string(se) (char*) hspara_string[(int) (se)]
110 bool same_sign =
false;
115 if (!in_v1 || !in_v2)
return unpara;
130 for (v1 = in_v1; v1 != NULL; v1 = v1->
succ) {
137 for (v2 = in_v2; v2 != NULL; v2 = v2->
succ) {
143 if (l1 != l2)
return unpara ;
147 for (v2 = in_v2; v2 != NULL; v2 = v2->
succ) {
152 if (var2 ==
TCST)
continue;
154 for (v1 = in_v1; v1 != NULL; v1 = v1->
succ) {
161 if (!ss && !op)
return unpara;
162 if (first) {first =
false; same_sign = (ss)?ss:op ;}
163 if ((same_sign && op)||(!same_sign && ss))
return unpara;
215 C3_DEBUG(
"contrainte_parallel_in_list", {
216 fprintf(stderr,
"Input in_co:");
218 fprintf(stderr,
"Input in_lc:\n");
222 vpos = in_co->vecteur;
228 C3_DEBUG(
"contrainte_parallel_in_list", {
229 fprintf(stderr,
"ret_sle: %s , hs: %s\n",
239 C3_DEBUG(
"contrainte_parallel_in_list",
260 bool stop =
false, dup1 =
false, dup2 =
false;
262 if ( in_ps1 == SC_RN )
return sc_dup(in_ps2);
265 C3_DEBUG(
"sc_supress_parallel_constraints", {
266 fprintf(stderr,
"Input systems, in_ps1, then in_ps2:\n");
273 if (in_ps1->nb_eq != 0)
277 if (in_ps2->nb_eq != 0)
285 for (ineq1 = ps1->
inegalites; ineq1 != NULL && !stop; ineq1 = ineq1->
succ) {
298 case full:
continue;
break;
301 fprintf(stderr,
"%s supress_kind == %d should not appear !",
302 "[sc_supress_parallel_redund_constraints]", (
int) sk );
310 if ((ret_ps != NULL) && !
sc_empty_p(ret_ps)) {
317 ps1 = (dup1)?
sc_free(ps1) : ps1;
318 ps2 = (dup2)?
sc_free(ps2) : ps2;
335 if ( in_ps1 == SC_RN )
return sc_dup(in_ps2);
337 C3_DEBUG(
"sc_supress_same_constraints", {
338 fprintf(stderr,
"\nInput systems, in_ps1, then in_ps2:\n");
344 for (
eq = in_ps2->egalites;
eq != NULL;
eq =
eq->
succ) {
366 else ret_ps =
sc_make( NULL, co );
368 else if (co_in_ineq) {
371 else ret_ps =
sc_make( NULL, eq2 );
377 else ret_ps =
sc_make( NULL, eq2 );
383 for (ineq = in_ps2->inegalites; ineq != NULL; ineq = ineq->
succ) {
422 if ( in_ps1->nb_ineq == 0 )
return in_ps2;
425 C3_DEBUG(
"sc_elim_redund_with_first", {
426 fprintf(stderr,
"\nInput systems, in_ps1, then in_ps2:\n");
437 tail->succ = in_ps2->inegalites;
440 C3_DEBUG(
"sc_elim_redund_with_first", {
441 fprintf(stderr,
"ps1 old: nb_eq= %d, nb_ineq= %d, dimension= %d, base= \n",
444 fprintf(stderr,
"in_ps2: nb_eq= %d, nb_ineq= %d, dimension= %d, base= \n",
445 in_ps2->nb_eq, in_ps2->nb_ineq, in_ps2->dimension);
458 C3_DEBUG(
"sc_elim_redund_with_first", {
459 fprintf(stderr,
"ps1: nb_eq= %d, nb_ineq= %d, dimension= %d, base= \n",
471 tail->succ = NULL; ps1 =
sc_free(ps1);
485 C3_DEBUG(
"sc_elim_redund_with_first", {
487 fprintf(stderr,
"nb_eq= %d, nb_ineq= %d, dimension= %d\n",
495 prev_eq = prev_eq->
succ;
500 if (in_ps2->inegalites ==
eq)
501 in_ps2->inegalites =
eq->
succ;
514 if ( in_ps2->inegalites == NULL )
517 tail->succ = NULL; ps1 =
sc_free( ps1 );
542 C3_DEBUG(
"pa_supress_same_constraints", {
543 fprintf(stderr,
"Input path:\n");
548 positif = in_pa->psys;
549 if (!sc_faisabilite_ofl(positif))
return pa_empty();
551 for( comp = in_pa->pcomp; comp != NULL; comp = comp->
succ) {
578 int pa_clength1, pa_clength2;
583 C3_DEBUG(
"pa_path_to_disjunct_rule4_ofl_ctrl", {
584 fprintf(stderr,
"\n\n Input path:\n\n");
592 systeme = in_pa->psys;
593 if (in_pa->pcomp == NULL)
596 for( comp = in_pa->pcomp; comp != NULL; comp = comp->
succ ) {
598 if (comp->
psys == SC_UNDEFINED)
622 else if (pa_clength2 == 0)
624 else if (pa_clength1 != pa_clength2)
666 Psysteme common_ps, common_ps_oppose;
668 bool pa1_empty =
false, pa2_empty =
false;
669 bool pa1_filled =
false, pa2_filled =
false;
679 C3_DEBUG(
"pa_path_to_few_disjunct_ofl_ctrl", {
680 fprintf(stderr,
"\n\n Input path:\n\n");
689 systeme = in_pa->psys ;
707 C3_DEBUG(
"pa_path_to_few_disjunct_ofl_ctrl", {
712 if ( pa->
pcomp == NULL ) {
716 C3_DEBUG(
"pa_path_to_few_disjunct_ofl_ctrl", {
717 fprintf(stderr,
"No complement, returning:\n");
732 for(
cons = (lcomp->
psys)->inegalites;
734 bool is_common =
true;
738 for(comp = lcomp->
succ;(comp != NULL) && is_common; comp = comp->
succ){
740 bool is_common1, is_common2;
744 is_common = is_common1 || is_common2;
757 C3_DEBUG(
"pa_path_to_few_disjunct_ofl_ctrl", {
759 if (common_cons == NULL)
fprintf(stderr,
"NULL\n");
768 if( common_cons != NULL ) {
778 for(comp = lcomp; comp != NULL; comp = comp->
succ){
784 if (local_ps == SC_EMPTY) { pa1 =
pa_empty(); pa1_empty =
true;
continue;}
789 if (local_ps == SC_EMPTY) {pa2 =
pa_empty(); pa2_empty =
true;
continue;}
804 C3_DEBUG(
"pa_path_to_few_disjunct", {
819 C3_DEBUG(
"pa_path_to_few_disjunct", {
836 common_ps =
sc_free( common_ps );
837 common_ps_oppose =
sc_free( common_ps_oppose );
838 vect_rm(cons_pv); cons_pv = NULL;
915 if ((ps1 == SC_UNDEFINED)||(ps2 == SC_UNDEFINED))
return DJ_UNDEFINED;
938 (conv_hull, ps1, ps2, ofl_ctrl, ofl_res)
941 volatile bool ofl_res;
943 volatile Ppath chemin;
#define value_minus(v1, v2)
#define pgcd(a, b)
Pour la recherche de performance, selection d'une implementation particuliere des fonctions.
#define value_uminus(val)
unary operators on values
#define value_zero_p(val)
#define value_eq(v1, v2)
bool operators on values
#define value_plus(v1, v2)
binary operators on values
#define value_mult(v, w)
whether the default is protected or not this define makes no sense any more...
Pbase base_union(Pbase b1, Pbase b2)
Pbase base_union(Pbase b1, Pbase b2): compute a new basis containing all elements of b1 and all eleme...
#define CONTRAINTE_UNDEFINED_P(c)
#define CONTRAINTE_NULLE_P(c)
contrainte nulle (non contrainte 0 == 0 ou 0 <= 0)
#define CONTRAINTE_UNDEFINED
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 ...
void eq_set_vect_nul(Pcontrainte)
void_eq_set_vect_nul(Pcontrainte c): transformation d'une contrainte en une contrainte triviale 0 == ...
void inegalites_fprint(FILE *, Pcontrainte, char *(*)(Variable))
void contrainte_reverse(Pcontrainte)
void contrainte_reverse(Pcontrainte eq): changement de signe d'une contrainte, i.e.
void contrainte_chg_sgn(Pcontrainte)
void contrainte_chg_sgn(Pcontrainte eq): changement de signe d'une contrainte, i.e.
bool contrainte_in_liste(Pcontrainte, Pcontrainte)
listes.c
void inegalite_fprint(FILE *, Pcontrainte, char *(*)(Variable))
Pdisjunct dj_free(Pdisjunct in_dj)
Pdisjunct dj_free( (Pdisjunct) in_dj ) AL 31/05/94 w - 1 depth free of input disjunction.
Pdisjunct dj_append_system(Pdisjunct in_dj, Psysteme in_ps)
Pdisjunct dj_append_system( (Pdisjunct) in_dj, (Psysteme) in_ps ) Input : A disjunct in_dj to wich in...
Pdisjunct dj_simple_inegs_to_eg(Pdisjunct in_dj)
Pdisjunct dj_simple_inegs_to_eg( in_dj ) transforms two opposite inequalities in a simple equality in...
Pdisjunct dj_union(Pdisjunct in_dj1, Pdisjunct in_dj2)
Pdisjunct dj_union( (Pdisjunct) in_dj1, (Pdisjunct) in_dj2 ) Give the union of the two disjunctions.
Pdisjunct dj_full()
Pdisjunct dj_full() AL 18/11/93 Return full space disjunction = dj_new()
void dj_fprint_tab(FILE *in_fi, Pdisjunct in_dj, char *(*in_fu)(), int in_tab)
void dj_fprint_tab(FILE*, Pdisjunct, function, int) prints a Pdisjunct
Pdisjunct dj_empty()
Pdisjunct dj_empty() AL 18/11/93 Returns a disjunction with sc_empty() element.
struct cons cons
The structure used to build lists in NewGen.
void vect_fprint(FILE *f, Pvecteur v, get_variable_name_t variable_name)
void vect_fprint(FILE * f, Pvecteur v, char * (*variable_name)()): impression d'un vecteur creux v su...
int vect_size(Pvecteur v)
package vecteur - reductions
int pa_max_constraints_nb(Ppath in_pa)
int pa_max_constraints_nb( (Ppath) in_pa ) Give the maximum constraints nb among systems of in_pa.
Ppath pa_full()
Ppath pa_full() AL 18/11/93 Returns full space path : pa_full = pa_new()
Ppath pa_empty()
Ppath pa_empty() AL 18/11/93 Returns empty path : pa_empty = sc_empty(NULL) ^ (NIL)
void pa_fprint_tab(FILE *in_fi, Ppath in_pa, char *(*in_fu)(), int in_tab)
void pa_fprint_tab(FILE*, Pdisjunct, function, tab) prints a Ppath
Ppath pa_transform_eg_in_ineg(Ppath in_pa)
Ppath pa_transform_eg_in_ineg( in_pa ) Transforms all equalities of all systems composing in_pa in in...
Ppath pa_free(Ppath in_pa)
Ppath pa_free(Ppath pa) BA, AL 30/05/94.
Pdisjunct pa_path_to_disjunct_ofl_ctrl(Ppath in_pa, int ofl_ctrl)
Pdisjunct pa_path_to_disjunct_ofl_ctrl ( (Ppath) in_pa, (int) ofl_ctrl) Produces a Pdisjunct corres...
Ppath pa_make(Psysteme in_ps, Pcomplist in_pcomp)
Package : C3/union Author : Arnauld LESERVOT (leservot(a)limeil.cea.fr) Date : Modified : 04 04 95 ...
bool pa_feasibility_ofl_ctrl(Ppath in_pa, int ofl_ctrl)
bool pa_feasibility_ofl_ctrl( (Ppath) in_pa, int ofl_ctrl) Returns true if the input path is possib...
bool pa_full_p(Ppath in_pa)
pa_full_p( (Ppath) in_pa ) AL 18/11/93 Returns True if in_pa = (NIL) ^ (NIL)
Ppath pa_free1(Ppath in_pa)
Ppath pa_free1(Ppath pa) BA, AL 30/05/94 1 depth free.
bool pa_empty_p(Ppath in_pa)
pa_empty_p( (Ppath) in_pa ) AL 18/11/93 Returns True if in_pa = (1*TCST = 0) ^ (NIL)
Ppath pa_reduce_simple_complement(Ppath in_pa)
Ppath pa_reduce_simple_complement( (Ppath) in_pa ) AL 16/11/93 Scan all the complement.
Psommet eq_in_ineq(Psommet *sys, int *nb_som, Pvecteur *lvbase)
Psommet eq_in_ineq(Psommet * sys, int * nb_som, Pvecteur * lvbase): Transformation des egalites du sy...
enum hspara_elem contrainte_parallel_in_liste(Pcontrainte in_co, Pcontrainte in_lc)
enum enum hspara_elem contrainte_parallel_in_liste( in_co, in_lc ) AL950711 input: 1 constraint in_co...
#define hspara_to_string(se)
#define hspara_join(se1, se2)
Psysteme sc_supress_same_constraints(Psysteme in_ps1, Psysteme in_ps2)
Psysteme sc_supress_same_constraints( in_ps1, in_ps2 ) supress in in_ps2 constraints that are in in_p...
Psysteme sc_supress_parallel_redund_constraints(Psysteme in_ps1, Psysteme in_ps2)
Psysteme sc_supress_parallel_redund_constraints( in_ps1, in_ps2 ) input: 2 Psystemes in_ps1 and in_ps...
static enum hspara_elem hspara_jm[10][10]
Ppath pa_supress_same_constraints(Ppath in_pa)
Ppath pa_supress_same_constraints( (Ppath) in_pa ) Supress from complements of in_pa same constrain...
bool pa_convex_hull_equals_union_p_ofl_ctrl(Psysteme conv_hull, Psysteme ps1, Psysteme ps2, int ofl_ctrl, volatile bool ofl_res)
bool pa_convex_hull_equals_union_p(conv_hull, ps1, ps2) input : two Psystems and their convex hull AL...
bool pa_inclusion_p_ofl_ctrl(Psysteme ps1, Psysteme ps2, int ofl_ctrl)
bool pa_inclusion_p(Psysteme ps1, Psysteme ps2) BA, AL 31/05/94 returns true if ps1 represents a subs...
Pdisjunct pa_path_to_disjunct_rule4_ofl_ctrl(Ppath in_pa, int ofl_ctrl)
Pdisjunct pa_path_to_disjunct_rule4_ofl_ctrl( (Ppath) in_pa, int ofl_ctrl) Returns the correspondin...
Pdisjunct pa_path_to_few_disjunct_ofl_ctrl(Ppath in_pa, int ofl_ctrl)
line 1197 "reduc.w"
Pdisjunct pa_system_difference_ofl_ctrl(Psysteme ps1, Psysteme ps2, int ofl_ctrl)
Pdisjunct pa_system_difference_ofl_ctrl(ps1, ps2) input : two Psystemes output : a disjunction repres...
static char *hspara_string[10] __attribute__((unused))
Package : C3/union Author : Arnauld LESERVOT (leservot(a)limeil.cea.fr) Date : Modified : 04 04 95 ...
Psysteme sc_elim_redund_with_first_ofl_ctrl(Psysteme in_ps1, Psysteme in_ps2, int ofl_ctrl)
Psysteme sc_elim_redund_with_first_ofl_ctrl( in_ps1, in_ps2, ofl_ctrl ) Returns constraints of in_ps2...
enum hspara_elem vect_parallel(Pvecteur in_v1, Pvecteur in_v2)
enum hspara_elem vect_parallel(Pvecteur in_v1, Pvecteur in_v2) AL950711 input: 2 Pvecteur in_v1 and i...
bool pa_system_equal_p_ofl_ctrl(Psysteme ps1, Psysteme ps2, int ofl_ctrl)
bool pa_system_equal_p(Psysteme ps1, Psysteme ps2) BA
Psysteme sc_make(Pcontrainte leg, Pcontrainte lineg)
Psysteme sc_make(Pcontrainte leg, Pcontrainte lineg): allocation et initialisation d'un systeme d'equ...
bool sc_weak_consistent_p(Psysteme sc)
check that sc is well defined, that the numbers of equalities and inequalities are consistent with th...
Psysteme sc_empty(Pbase b)
Psysteme sc_empty(Pbase b): build a Psysteme with one unfeasible constraint to define the empty subsp...
void sc_creer_base(Psysteme ps)
void sc_creer_base(Psysteme ps): initialisation des parametres dimension et base d'un systeme lineair...
bool sc_empty_p(Psysteme sc)
bool sc_empty_p(Psysteme sc): check if the set associated to sc is the constant sc_empty or not.
void sc_add_inegalite(Psysteme p, Pcontrainte i)
void sc_add_inegalite(Psysteme p, Pcontrainte i): macro ajoutant une inegalite i a un systeme p; la b...
Psysteme sc_dup(Psysteme ps)
Psysteme sc_dup(Psysteme ps): should becomes a link.
bool sc_rational_feasibility_ofl_ctrl(Psysteme sc, int ofl_ctrl, bool ofl_res)
Value b1
booleen indiquant quel membre est en cours d'analyse
Pcontrainte eq
element du vecteur colonne du systeme donne par l'analyse
Psysteme sc_safe_append(Psysteme s1, Psysteme s2)
Psysteme sc_safe_append(Psysteme s1, Psysteme s2) input : output : calcul de l'intersection des polye...
void sc_fprint(FILE *fp, Psysteme ps, get_variable_name_t nom_var)
void sc_fprint(FILE * f, Psysteme ps, char * (*nom_var)()): cette fonction imprime dans le fichier po...
Psysteme sc_free(Psysteme in_ps)
Psysteme sc_free( in_ps ) AL 30/05/94 Free of in_ps.
Psysteme sc_full()
Psysteme sc_full() similar to sc_new.
Psyslist sl_free(Psyslist psl)
Psyslist sl_free(Psyslist psl) BA, AL 30/05/94 w - 1 depth free.
char *(* union_variable_name)(Variable)
Package : C3/union Author : Arnauld LESERVOT (leservot(a)limeil.cea.fr) Date : Modified : 04 04 95 ...
Psyslist sl_append_system(Psyslist in_sl, Psysteme in_ps)
Psyslist sl_append_system( (Psyslist) in_sl, (Psysteme) in_ps ) Input : A disjunct in_sl to wich in_p...
bool sc_full_p(Psysteme in_ps)
Psysteme sc_full_p( in_ps ) similar to sc_new.
Psyslist sl_dup(Psyslist in_sl)
Psyslist sl_dup( (Psyslist) in_sl ) AL 15/11/93 w - 1 duplication : everything is duplicated,...
bool sl_length(Psyslist in_sl)
int sl_length( (Psyslist) in_sl ) AL 26/04/95 Returns length of in_sl.
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 ...
void vect_chg_sgn(Pvecteur v)
void vect_chg_sgn(Pvecteur v): multiplie v par -1
struct Scontrainte * succ
Warning! Do not modify this file that is automatically generated!
le type des coefficients dans les vecteurs: Value est defini dans le package arithmetique
The structure used to build lists in NewGen.
#define pa_fprint(fi, pa, fu)
#define PA_UNDEFINED_P(pa)
#define C3_DEBUG(fun, code)
#define C3_RETURN(type, val)
hspara_elem
Implementation of the finite parallel half space lattice hspara.
@ keep
bj > b1 -> h1/hj = h1
@ ssplus
b1 == bj -> h1/hj = full
@ opzero
bj < b1 -> h1/hj = h1
@ opplus
b1 == bj -> h1/hj = h1
@ ssminus
bj > b1 -> h1/hj = full
@ unpara
compare {h1: a1 X + b1 <= 0} with {hj: aj X + bj <= 0}
@ sszero
unparallel -> h1/hj = h1
@ empty
b1 < bj -> h1/hj = empty
#define PATH_MAX_CONSTRAINTS
Misceleanous (debuging...)
#define TCST
VARIABLE REPRESENTANT LE TERME CONSTANT.
struct Svecteur * Pvecteur
void * Variable
arithmetique is a requirement for vecteur, but I do not want to inforce it in all pips files....
#define OFL_CTRL
I do thing that overflows are managed in a very poor manner.
Pvecteur vect_dup(Pvecteur v_in)
Pvecteur vect_dup(Pvecteur v_in): duplication du vecteur v_in; allocation de et copie dans v_out;.
Pvecteur vect_new(Variable var, Value coeff)
Pvecteur vect_new(Variable var,Value coeff): allocation d'un vecteur colineaire au vecteur de base va...
void vect_rm(Pvecteur v)
void vect_rm(Pvecteur v): desallocation des couples de v;
Pvecteur vect_add(Pvecteur v1, Pvecteur v2)
package vecteur - operations binaires
void vect_normalize(Pvecteur v)
void vect_normalize(Pvecteur v): division de tous les coefficients de v par leur pgcd; "normalisation...