PIPS
disjunct.c
Go to the documentation of this file.
1 
2 #line 62 "disjunct.w"
3 
4 
5 #line 335 "UNION.w"
6 
7 /* Package : C3/union
8  * Author : Arnauld LESERVOT (leservot(a)limeil.cea.fr)
9  * Date :
10  * Modified : 04 04 95
11  * Documents: UNION.tex : ``Extension de C3 aux unions de polyedres''
12  * Comments :
13  */
14 /*
15  * WARNING
16  *
17  * THOSE FUNCTIONS ARE AUTOMATICALLY DERIVED
18  *
19  * FROM THE WEB SOURCES !
20  */
21 
22 /* Ansi includes */
23 #ifdef HAVE_CONFIG_H
24  #include "config.h"
25 #endif
26 #include <stdlib.h>
27 #include <stdio.h>
28 #include <string.h>
29 #include "linear_assert.h"
30 #include <time.h>
31 #include <sys/time.h>
32 
33 /* Linear includes */
34 #include "boolean.h"
35 #include "arithmetique.h"
36 #include "vecteur.h"
37 #include "contrainte.h"
38 #include "sc.h"
39 #include "sommet.h"
40 #include "polyedre.h"
41 #include "union.h"
42 
43 
44 #line 63 "disjunct.w"
45 
46 
47 #line 71 "disjunct.w"
48 
49 /* Pdisjunct dj_new() AL 26/10/93
50  * Allocate a new Pdisjunct
51  */
52 Pdisjunct dj_new() { return( (Pdisjunct) sl_new() ); }
53 
54 
55 /* Pdisjunct dj_dup( (Pdisjunct) in_dj ) AL 15/11/93
56  * Duplicates input disjunction.
57  */
58 Pdisjunct dj_dup( in_dj )
59 Pdisjunct in_dj;
60 {
61  if (dj_full_p(in_dj)) return dj_full();
62  return (Pdisjunct) sl_dup( (Psyslist) in_dj );
63 }
64 
65 
66 /* Pdisjunct dj_free( (Pdisjunct) in_dj ) AL 31/05/94
67  * w - 1 depth free of input disjunction.
68  */
70 Pdisjunct in_dj; { return (Pdisjunct) sl_free( (Psyslist) in_dj ); }
71 
72 
73 /* Pdisjunct dj_dup1( (Pdisjunct) in_dj ) AL 31/05/94
74  * 1st depth duplication of input disjunction.
75  */
77 Pdisjunct in_dj;
78 { return( (Pdisjunct) sl_dup1( (Psyslist) in_dj ) ); }
79 
80 
81 /* Pdisjunct dj_free1( (Pdisjunct) in_dj ) AL 31/05/94
82  * 1st depth free of input disjunction.
83  */
85 Pdisjunct in_dj; { return (Pdisjunct) sl_free1( (Psyslist) in_dj ); }
86 
87 #line 116 "disjunct.w"
88 
89 /* Pdisjunct dj_full() AL 18/11/93
90  * Return full space disjunction = dj_new()
91  */
92 Pdisjunct dj_full(){ return( dj_new() ); }
93 
94 
95 /* dj_full_p( (Pdisjunct) in_dj ) AL 30/05/94
96  * Returns True if in_dj = (NIL) ^ (NIL)
97  */
98 bool dj_full_p( in_dj )
99 Pdisjunct in_dj;
100 {
101  return( (in_dj != DJ_UNDEFINED) &&
102  ( in_dj->succ == NULL ) &&
103  ( in_dj->psys == NULL ) );
104 }
105 
106 #line 138 "disjunct.w"
107 
108 /* Pdisjunct dj_empty() AL 18/11/93
109  * Returns a disjunction with sc_empty() element.
110  */
112 { return (Pdisjunct) sl_append_system(NULL, sc_empty((Pbase) NULL)); }
113 
114 
115 /* dj_empty_p( (Ppath) in_pa ) AL 30/05/94
116  * Returns True if in_dj = (1*TCST = 0) ^ (NIL)
117  */
118 bool dj_empty_p( in_dj )
119 Pdisjunct in_dj;
120 {
121  return( ( in_dj != DJ_UNDEFINED ) &&
122  ( in_dj->succ == NULL ) &&
123  ( in_dj->psys != NULL ) &&
124  ( sc_empty_p( in_dj->psys ) ) );
125 }
126 
127 #line 169 "disjunct.w"
128 
129 /* Pdisjunct dj_intersection_ofl_ctrl( in_dj1, in_dj2, ofl_ctrl )
130  * Computes intersection of two disjunctions. AL,BC 23/03/95
131  * Very costly function : -> sc_faisabilite_ofl_ctrl used.
132  * No sharing
133  */
134 Pdisjunct dj_intersection_ofl_ctrl( in_dj1, in_dj2, ofl_ctrl )
135 Pdisjunct in_dj1, in_dj2;
136 int ofl_ctrl;
137 {
138  Pdisjunct dj1, dj2, ret_dj;
139 
140  if (DJ_UNDEFINED_P(in_dj1)||DJ_UNDEFINED_P(in_dj2)) return DJ_UNDEFINED ;
141  if (dj_full_p(in_dj1) && dj_full_p(in_dj2)) return dj_full() ;
142  if (dj_full_p(in_dj1)) return dj_dup(in_dj2) ;
143  if (dj_full_p(in_dj2)) return dj_dup(in_dj1) ;
144  if (dj_empty_p(in_dj1)||dj_empty_p(in_dj2)) return dj_empty() ;
145 
146  ret_dj = (Pdisjunct) NULL;
147  for(dj1 = in_dj1; dj1 != NULL; dj1 = dj1->succ) {
148  for(dj2 = in_dj2; dj2 != NULL; dj2 = dj2->succ) {
149  Psysteme ps = sc_append( sc_dup(dj1->psys), dj2->psys );
150  if (!sc_rational_feasibility_ofl_ctrl( ps, ofl_ctrl, true ))
151  { ps = sc_free( ps ); continue; }
152  ret_dj = (Pdisjunct) sl_append_system( ret_dj, ps );
153  }
154  }
155  if (ret_dj == (Pdisjunct) NULL) return dj_empty(); /* empty intersection */
156  return ret_dj;
157 }
158 
159 #line 205 "disjunct.w"
160 
161 /* Pdisjunct dj_intersect_system_ofl_ctrl( ) */
162 Pdisjunct dj_intersect_system_ofl_ctrl( in_dj, in_ps, ofl_ctrl )
163 Pdisjunct in_dj ;
164 Psysteme in_ps ;
165 int ofl_ctrl ;
166 { return dj_intersection_ofl_ctrl( in_dj, sl_append_system(NULL, in_ps), ofl_ctrl ); }
167 
168 #line 219 "disjunct.w"
169 
170 /* Pdisjunct dj_intersect_djcomp_ofl_ctrl( )
171  * No sharing. in_dj1 and in_dj2 stay as is.
172  */
173 Pdisjunct dj_intersect_djcomp_ofl_ctrl( in_dj1, in_dj2, ofl_ctrl )
174 Pdisjunct in_dj1, in_dj2;
175 int ofl_ctrl;
176 {
177  Pdisjunct dj, ret_dj;
178 
179  /* Special cases */
180  if (DJ_UNDEFINED_P(in_dj1) || DJ_UNDEFINED_P(in_dj2)) return DJ_UNDEFINED;
181 
182  if (dj_empty_p( in_dj1 ) || dj_full_p(in_dj2)) return dj_empty();
183  if (dj_full_p ( in_dj1 )) return dj_disjunct_complement( in_dj2 );
184  if (dj_empty_p( in_dj2 )) return dj_dup( in_dj1 );
185 
186  /* debuging */
187  C3_DEBUG("dj_intersect_djcomp_ofl_ctrl",{
188  fprintf(stderr,"Inputs (in_dj1, then in_dj2):");
189  dj_fprint_tab(stderr, in_dj1, union_variable_name, 1);
190  dj_fprint_tab(stderr, in_dj2, union_variable_name, 1);
191  });
192 
193  /* General cases */
194  ret_dj = dj_empty();
195  for(dj = in_dj1; dj != NULL; dj = dj->succ ){
196  Ppath pa = pa_make( dj->psys, (Pcomplist) in_dj2 );
197  ret_dj = dj_union( ret_dj, pa_path_to_few_disjunct_ofl_ctrl( pa, ofl_ctrl ) );
198  free(pa);
199  }
200  C3_RETURN(IS_DJ, ret_dj);
201 }
202 
203 #line 257 "disjunct.w"
204 
205 /* Pdisjunct dj_union( (Pdisjunct) in_dj1, (Pdisjunct) in_dj2 )
206  * Give the union of the two disjunctions. AL 15/11/93
207  * Memory: systems of the 2 unions are shared.
208  * in_dj1 = dj_union(in_dj1,in_dj2);
209  * (in_dj1 = dj_free(in_dj1); to remove in_dj1 and in_dj2
210  */
211 Pdisjunct dj_union( in_dj1, in_dj2 )
212 Pdisjunct in_dj1, in_dj2;
213 {
214  Pdisjunct dj;
215 
216  if (DJ_UNDEFINED_P(in_dj1) || DJ_UNDEFINED_P(in_dj2)) return DJ_UNDEFINED;
217  if (dj_empty_p( in_dj2 )) {dj_free(in_dj2); return in_dj1;}
218  if (dj_full_p ( in_dj2 )) {dj_free(in_dj1); return in_dj2;}
219  if (dj_empty_p( in_dj1 )) {dj_free(in_dj1); return in_dj2;}
220  if (dj_full_p ( in_dj1 )) {dj_free(in_dj2); return in_dj1;}
221 
222  for( dj = in_dj1; dj->succ != NULL; dj = dj->succ) {};
223  dj->succ = in_dj2;
224  return in_dj1;
225 }
226 
227 #line 287 "disjunct.w"
228 
229 /* bool dj_feasibility_ofl_ctrl( (Pdisjunct) in_dj, (int) ofl_ctrl )
230  * Returns true if in_dj is a feasible disjunction. AL,BC 23/02/95
231  */
232 bool dj_feasibility_ofl_ctrl( in_dj, ofl_ctrl )
233 Pdisjunct in_dj;
234 int ofl_ctrl;
235 {
236  bool ret_bool = false;
237  Pdisjunct dj;
238 
239  if ( in_dj == DJ_UNDEFINED ) return false;
240  for( dj = in_dj; dj != NULL && !ret_bool; dj = dj->succ ) {
241  if (dj->psys == SC_UNDEFINED) return false;
242  ret_bool = ret_bool ||
243  sc_rational_feasibility_ofl_ctrl( dj->psys, ofl_ctrl, true );
244  }
245  return ret_bool;
246 }
247 
248 #line 315 "disjunct.w"
249 
250 /* Pdisjunct dj_system_complement( (Psystem) in_ps ) AL 26/10/93
251  * Input : A Psysteme.
252  * Output : A disjunction which is complement of in_ps.
253  */
255 Psysteme in_ps;
256 {
257  Pdisjunct ret_dj = NULL;
258  Pvecteur v1 = NULL, pv = NULL;
259  Psysteme ps = NULL;
260  Pcontrainte eq = NULL, ineq = NULL;
261 
262  if ( in_ps == SC_UNDEFINED ) return DJ_UNDEFINED;
263  if (sc_empty_p(in_ps)) return dj_full();
264 
265  /* debugging */
266  C3_DEBUG("dj_system_complement (in_ps)",
267  {sc_fprint(stderr, in_ps, union_variable_name);});
268 
269 
270  /* v1 = 1*TCST to build complement system ... */
271  v1 = vect_new( TCST, VALUE_ONE);
272  /* Look for equalities */
273  for( eq = in_ps->egalites; eq != NULL; eq = eq->succ ) {
275  contrainte_make( vect_add( v1, eq->vecteur ) ) );
276  ret_dj = (Pdisjunct) sl_append_system( ret_dj, ps );
277  pv = vect_dup( eq->vecteur ); vect_chg_sgn( pv );
279  vect_rm( pv ); pv = NULL;
280  ret_dj = (Pdisjunct) sl_append_system( ret_dj, ps );
281 
282  }
283  /* Look for inequalities */
284  for(ineq = in_ps->inegalites; ineq != NULL; ineq = ineq->succ) {
285  pv = vect_dup(ineq->vecteur);
286  vect_chg_sgn( pv );
288  vect_rm( pv ); pv = NULL;
289  ret_dj = dj_append_system( ret_dj, ps );
290  }
291 
292  vect_rm( v1 );
293  C3_RETURN(IS_DJ, ret_dj);
294 }
295 
296 #line 367 "disjunct.w"
297 
298 /* Returns complement of in_dj. No sharing */
300 Pdisjunct in_dj;
301 {
302  Pdisjunct ret_dj;
303  if DJ_UNDEFINED_P(in_dj) return DJ_UNDEFINED;
304  if (dj_empty_p(in_dj)||dj_full_p(in_dj)) return dj_dup(in_dj);
305 
306  /* debugging */
307  C3_DEBUG("dj_disjunct_complement (in_ps)",
308  {dj_fprint_tab(stderr, in_dj, union_variable_name, 1);});
309 
310  ret_dj = dj_full();
311  for(; in_dj != NULL; in_dj = in_dj->succ)
312  { ret_dj = dj_intersection(ret_dj, dj_system_complement(in_dj->psys)); }
313  C3_RETURN(IS_DJ, ret_dj);
314 }
315 
316 #line 391 "disjunct.w"
317 
318 /* Returns projection of in_dj along vars of in_pv. Sharing : in_dj is modified */
320 Pdisjunct in_dj;
321 Pvecteur in_pv;
322 int ofl_ctrl;
323 {
324  Pdisjunct dj;
325  if DJ_UNDEFINED_P(in_dj) return DJ_UNDEFINED;
326  if (dj_empty_p(in_dj)||dj_full_p(in_dj)) return in_dj;
327 
328  for(dj = in_dj; dj != NULL; dj = dj->succ)
329  { sc_projection_along_variables_ofl_ctrl( &(dj->psys), in_pv, ofl_ctrl ); }
330  return in_dj;
331 }
332 
333 #line 414 "disjunct.w"
334 
335 /* Pdisjunct dj_simple_inegs_to_eg( in_dj ) transforms two opposite
336  * inequalities in a simple equality in each system of the input disjunction.
337  * Input disjunction is not modified.
338  */
340 Pdisjunct in_dj;
341 {
342  Pdisjunct dj;
343  Pdisjunct ret_dj = NULL;
344 
345  /* Special case */
346  if (DJ_UNDEFINED_P(in_dj) || dj_empty_p(in_dj) || dj_full_p(in_dj))
347  return dj_dup(in_dj);
348 
349  /* General case */
350  for( dj = in_dj; dj != NULL; dj = dj->succ) {
351  Psysteme ps = dj->psys, new_ps;
352  Pcontrainte ineq;
353 
354  assert(!SC_UNDEFINED_P(ps)&&!sc_empty_p(ps)&&!sc_full_p(ps));
355 
356  if (ps->nb_ineq <= 1) {
357  ret_dj = sl_append_system( ret_dj, sc_dup( ps ));
358  continue;
359  }
360 
361  /* Compare with inequalities */
363  for (ineq = ps->inegalites; ineq != NULL; ineq = ineq->succ) {
364  Pcontrainte co, ineq2;
365  Pvecteur pv = vect_dup(ineq->vecteur);
366  vect_chg_sgn ( pv );
367  co = contrainte_make( pv );
368  ineq2 = contrainte_dup(ineq);
369 
370  /* Do we have ineq <= 0 and - ineq <= 0 ? */
371  if (contrainte_in_liste(co, ps->inegalites)) {
372  if ( !contrainte_in_liste(ineq, new_ps->egalites)
373  && !contrainte_in_liste(co, new_ps->egalites) )
374  sc_add_egalite( new_ps, ineq2 );
375  }
376  else { sc_add_inegalite( new_ps, ineq2 ); }
377  co = contrainte_free( co );
378  }
379 
380  new_ps->base = NULL;
381  sc_creer_base( new_ps );
382  ret_dj = (Pdisjunct) sl_append_system( ret_dj, new_ps );
383  }
384 
385  return ret_dj;
386 }
387 
388 #line 477 "disjunct.w"
389 
390 /* bool dj_is_system_p( (Pdisjunct) in_dj ) AL 16/11/93
391  * Returns True if disjunction in_dj has only one Psysteme in it.
392  */
393 bool dj_is_system_p( in_dj )
394 Pdisjunct in_dj;
395 { return( sl_is_system_p( (Psyslist) in_dj ) ); }
396 
397 
398 /* Pdisjunct dj_append_system( (Pdisjunct) in_dj, (Psysteme) in_ps )
399  * Input : A disjunct in_dj to wich in_ps will be added. AL 10/11/93
400  * Output : Disjunct in_dj with in_ps. => ! Sharing.
401  * Comment: Nothing is checked on result in_dj.
402  */
404 Pdisjunct in_dj;
405 Psysteme in_ps;
406 {
407  Pdisjunct ret_dj;
408 
409  if (dj_full_p(in_dj)) { ret_dj = dj_new(); ret_dj->psys = in_ps; }
410  else {ret_dj = (Pdisjunct) sl_append_system((Psyslist) in_dj, in_ps);}
411  return ret_dj;
412 }
413 
414 #line 507 "disjunct.w"
415 
416 /* dj_variable_rename replaces in_vold with in_vnew : in_dj is modified */
417 Pdisjunct dj_variable_rename( in_dj, in_vold, in_vnew )
418 Pdisjunct in_dj;
419 Variable in_vold;
420 Variable in_vnew;
421 {
422  Pdisjunct dj;
423  if DJ_UNDEFINED_P(in_dj) return DJ_UNDEFINED;
424  if (dj_empty_p(in_dj)||dj_full_p(in_dj)) return in_dj;
425 
426  for(dj = in_dj; dj != NULL; dj = dj->succ)
427  { sc_variable_rename( dj->psys, in_vold, in_vnew ); }
428  return in_dj;
429 }
430 
431 #line 532 "disjunct.w"
432 
433 /* Pdisjunct dj_variable_substitution_with_eqs_ofl_ctrl() AL160595
434  * Substitutes to all systems of disjunction in_dj definitions
435  * of variables in in_pv that are implied by in_pc.
436  * in_pc are equality constraints that define uniquely each
437  * variable of in_pc.
438  * Function based on sc_variable_substitution_with_eq_ofl_ctrl().
439  */
441 Pdisjunct in_dj ;
442 Pcontrainte in_pc ;
443 Pvecteur in_pv ;
444 int ofl_ctrl ;
445 {
446  Pvecteur vec1;
447 
448  /* Special cases */
449  if (dj_full_p(in_dj)||dj_empty_p(in_dj)||DJ_UNDEFINED_P(in_dj)) return in_dj;
450 
451 
452  C3_DEBUG( "dj_variable_substitution_with_eqs_ofl_ctrl", {
453  dj_fprint ( stderr, in_dj, union_variable_name );
454  contrainte_fprint( stderr, in_pc, false, union_variable_name );
455  vect_fprint ( stderr, in_pv, union_variable_name );
456  });
457 
458 
459  /* For each variable in in_pv,
460  * we should have one and only one constraint in in_pc that defines it.
461  * In each constraint, we should have only one variable in in_pv.
462  */
463  for(vec1 = in_pv; vec1 != NULL; vec1 = vec1->succ) {
464  Variable var = vec1->var;
465  int found = 0;
466  Pcontrainte pr, def = NULL;
467  Pvecteur vec2 ;
468  Pdisjunct dj ;
469 
470  /* Find constraint def that defines var (only one !) */
471  for(pr = in_pc; pr != NULL; pr = pr->succ)
472  { if(vect_coeff(var, pr->vecteur) != 0) {found++; def = pr;} }
473  assert( found == 1);
474 
475  /* Assert that there is no other variable of in_pv that belongs to def */
476  for(vec2 = in_pv; vec2 != NULL; vec2 = vec2->succ) {
477  if (vec2->var == var) continue;
478  assert( vect_coeff( vec2->var, def->vecteur ) == 0 );
479  }
480 
481  /* Assert that there is no other variable of in_pv that belongs to def */
482  for(dj = in_dj; dj != NULL; dj = dj->succ)
483  { dj->psys = sc_variable_substitution_with_eq_ofl_ctrl(dj->psys, def, var, ofl_ctrl); }
484 
485  }
486  return( in_dj );
487 }
488 
489 #line 597 "sl_io.w"
490 
491 /* void dj_fprint_tab(FILE*, Pdisjunct, function, int) prints a Pdisjunct */
492 void dj_fprint_tab( in_fi, in_dj, in_fu, in_tab )
493 FILE* in_fi;
494 Pdisjunct in_dj;
495 char *(*in_fu)();
496 int in_tab;
497 {
498  char* tabs = sl_get_tab_string( in_tab );
499 
500  if (dj_full_p(in_dj)) { fprintf(in_fi, "%sDJ_FULL\n", tabs); return; }
501  if DJ_UNDEFINED_P(in_dj) { fprintf(in_fi, "%sDJ_UNDEFINED\n", tabs); return; }
502 
503  fprintf ( in_fi, "\n%s# -----DJ BEGIN-----\n", tabs );
504  sl_fprint_tab( in_fi, (Psyslist) in_dj, in_fu, in_tab );
505  fprintf ( in_fi, "\n%s# -----DJ END-----\n", tabs );
506 }
507 
508 
509 /* void dj_read(FILE*) reads a Pdisjunct */
511 char* nomfic;
512 { return ( (Pdisjunct) sl_read(nomfic) ); }
513 
514 #line 64 "disjunct.w"
515 
#define VALUE_ONE
#define CONTRAINTE_UNDEFINED
Pcontrainte contrainte_make(Pvecteur pv)
Pcontrainte contrainte_make(Pvecteur pv): allocation et initialisation d'une contrainte avec un vecte...
Definition: alloc.c:73
Pcontrainte contrainte_free(Pcontrainte c)
Pcontrainte contrainte_free(Pcontrainte c): liberation de l'espace memoire alloue a la contrainte c a...
Definition: alloc.c:184
Pcontrainte contrainte_dup(Pcontrainte c_in)
Pcontrainte contrainte_dup(Pcontrainte c_in): allocation d'une contrainte c_out prenant la valeur de ...
Definition: alloc.c:132
Pcontrainte contraintes_dup(Pcontrainte c_in)
Pcontrainte contraintes_dup(Pcontrainte c_in) a list of constraints is copied.
Definition: alloc.c:146
void contrainte_fprint(FILE *, Pcontrainte, bool, char *(*)(Variable))
io.c
bool contrainte_in_liste(Pcontrainte, Pcontrainte)
listes.c
Definition: listes.c:52
Pdisjunct dj_system_complement(Psysteme in_ps)
Pdisjunct dj_system_complement( (Psystem) in_ps ) AL 26/10/93 Input : A Psysteme.
Definition: disjunct.c:254
bool dj_is_system_p(Pdisjunct in_dj)
bool dj_is_system_p( (Pdisjunct) in_dj ) AL 16/11/93 Returns True if disjunction in_dj has only one P...
Definition: disjunct.c:393
Pdisjunct dj_disjunct_complement(Pdisjunct in_dj)
Returns complement of in_dj.
Definition: disjunct.c:299
Pdisjunct dj_read(char *nomfic)
void dj_read(FILE*) reads a Pdisjunct
Definition: disjunct.c:510
Pdisjunct dj_free(Pdisjunct in_dj)
Pdisjunct dj_free( (Pdisjunct) in_dj ) AL 31/05/94 w - 1 depth free of input disjunction.
Definition: disjunct.c:69
Pdisjunct dj_new()
Package : C3/union Author : Arnauld LESERVOT (leservot(a)limeil.cea.fr) Date : Modified : 04 04 95 ...
Definition: disjunct.c:52
Pdisjunct dj_intersect_system_ofl_ctrl(in_dj, in_ps, ofl_ctrl)
Pdisjunct dj_intersect_system_ofl_ctrl( )
Definition: disjunct.c:162
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...
Definition: disjunct.c:403
Pdisjunct dj_intersection_ofl_ctrl(Pdisjunct in_dj1, Pdisjunct in_dj2, int ofl_ctrl)
Pdisjunct dj_intersection_ofl_ctrl( in_dj1, in_dj2, ofl_ctrl ) Computes intersection of two disjuncti...
Definition: disjunct.c:134
Pdisjunct dj_projection_along_variables_ofl_ctrl(Pdisjunct in_dj, Pvecteur in_pv, int ofl_ctrl)
Returns projection of in_dj along vars of in_pv.
Definition: disjunct.c:319
Pdisjunct dj_dup1(Pdisjunct in_dj)
Pdisjunct dj_dup1( (Pdisjunct) in_dj ) AL 31/05/94 1st depth duplication of input disjunction.
Definition: disjunct.c:76
Pdisjunct dj_dup(Pdisjunct in_dj)
Pdisjunct dj_dup( (Pdisjunct) in_dj ) AL 15/11/93 Duplicates input disjunction.
Definition: disjunct.c:58
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...
Definition: disjunct.c:339
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.
Definition: disjunct.c:211
bool dj_empty_p(Pdisjunct in_dj)
dj_empty_p( (Ppath) in_pa ) AL 30/05/94 Returns True if in_dj = (1*TCST = 0) ^ (NIL)
Definition: disjunct.c:118
Pdisjunct dj_intersect_djcomp_ofl_ctrl(Pdisjunct in_dj1, Pdisjunct in_dj2, int ofl_ctrl)
Pdisjunct dj_intersect_djcomp_ofl_ctrl( ) No sharing.
Definition: disjunct.c:173
Pdisjunct dj_variable_rename(Pdisjunct in_dj, Variable in_vold, Variable in_vnew)
dj_variable_rename replaces in_vold with in_vnew : in_dj is modified
Definition: disjunct.c:417
Pdisjunct dj_full()
Pdisjunct dj_full() AL 18/11/93 Return full space disjunction = dj_new()
Definition: disjunct.c:92
bool dj_full_p(Pdisjunct in_dj)
dj_full_p( (Pdisjunct) in_dj ) AL 30/05/94 Returns True if in_dj = (NIL) ^ (NIL)
Definition: disjunct.c:98
bool dj_feasibility_ofl_ctrl(Pdisjunct in_dj, int ofl_ctrl)
bool dj_feasibility_ofl_ctrl( (Pdisjunct) in_dj, (int) ofl_ctrl ) Returns true if in_dj is a feasible...
Definition: disjunct.c:232
Pdisjunct dj_variable_substitution_with_eqs_ofl_ctrl(in_dj, in_pc, in_pv, ofl_ctrl)
Pdisjunct dj_variable_substitution_with_eqs_ofl_ctrl() AL160595 Substitutes to all systems of disjunc...
Definition: disjunct.c:440
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
Definition: disjunct.c:492
Pdisjunct dj_free1(Pdisjunct in_dj)
Pdisjunct dj_free1( (Pdisjunct) in_dj ) AL 31/05/94 1st depth free of input disjunction.
Definition: disjunct.c:84
Pdisjunct dj_empty()
Pdisjunct dj_empty() AL 18/11/93 Returns a disjunction with sc_empty() element.
Definition: disjunct.c:111
void free(void *)
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...
Definition: io.c:124
#define assert(ex)
Definition: newgen_assert.h:41
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 ...
Definition: path.c:53
Pdisjunct pa_path_to_few_disjunct_ofl_ctrl(Ppath in_pa, int ofl_ctrl)
line 1197 "reduc.w"
Definition: reduc.c:648
Psysteme sc_make(Pcontrainte leg, Pcontrainte lineg)
Psysteme sc_make(Pcontrainte leg, Pcontrainte lineg): allocation et initialisation d'un systeme d'equ...
Definition: sc.c:78
Psysteme sc_variable_rename(Psysteme s, Variable v_old, Variable v_new)
Psysteme sc_variable_rename(Psysteme s, Variable v_old, Variable v_new): reecriture du systeme s remp...
Definition: sc.c:157
Psysteme sc_empty(Pbase b)
Psysteme sc_empty(Pbase b): build a Psysteme with one unfeasible constraint to define the empty subsp...
Definition: sc_alloc.c:319
void sc_creer_base(Psysteme ps)
void sc_creer_base(Psysteme ps): initialisation des parametres dimension et base d'un systeme lineair...
Definition: sc_alloc.c:129
void sc_add_egalite(Psysteme p, Pcontrainte e)
void sc_add_egalite(Psysteme p, Pcontrainte e): macro ajoutant une egalite e a un systeme p; la base ...
Definition: sc_alloc.c:389
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.
Definition: sc_alloc.c:350
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...
Definition: sc_alloc.c:406
Psysteme sc_dup(Psysteme ps)
Psysteme sc_dup(Psysteme ps): should becomes a link.
Definition: sc_alloc.c:176
bool sc_rational_feasibility_ofl_ctrl(Psysteme sc, int ofl_ctrl, bool ofl_res)
Pcontrainte eq
element du vecteur colonne du systeme donne par l'analyse
Definition: sc_gram.c:108
Psysteme sc_append(Psysteme s1, Psysteme s2)
Psysteme sc_append(Psysteme s1, Psysteme s2): calcul de l'intersection des polyedres definis par s1 e...
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...
Definition: sc_io.c:220
Psysteme sc_free(Psysteme in_ps)
Psysteme sc_free( in_ps ) AL 30/05/94 Free of in_ps.
Definition: sc_list.c:112
Psyslist sl_free1(Psyslist psl)
Psyslist sl_free1(Psyslist psl) AL 30/05/94 1 depth free.
Definition: sc_list.c:343
Psyslist sl_free(Psyslist psl)
Psyslist sl_free(Psyslist psl) BA, AL 30/05/94 w - 1 depth free.
Definition: sc_list.c:327
bool sl_is_system_p(Psyslist in_sl)
bool sl_is_system_p( (Psyslist) in_sl ) AL 16/11/93 Returns True if syslist in_sl has only one Psyste...
Definition: sc_list.c:230
char *(* union_variable_name)(Variable)
Package : C3/union Author : Arnauld LESERVOT (leservot(a)limeil.cea.fr) Date : Modified : 04 04 95 ...
Definition: sc_list.c:51
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...
Definition: sc_list.c:240
Psyslist sl_dup1(Psyslist in_sl)
Psyslist sl_dup1( (Psyslist) in_sl ) AL 15/11/93 Duplicates input syslist.
Definition: sc_list.c:311
char * sl_get_tab_string(int in_tab)
char* sl_get_tab_string( in_tab ) returns a string of in_tab \t
Definition: sc_list.c:366
Psyslist sl_read(char *nomfic)
void sl_read(FILE*) reads a Psyslist
Definition: sc_list.c:461
bool sc_full_p(Psysteme in_ps)
Psysteme sc_full_p( in_ps ) similar to sc_new.
Definition: sc_list.c:61
Psyslist sl_dup(Psyslist in_sl)
Psyslist sl_dup( (Psyslist) in_sl ) AL 15/11/93 w - 1 duplication : everything is duplicated,...
Definition: sc_list.c:296
Psyslist sl_new()
Psyslist sl_new() AL 26/10/93 Input : Nothing.
Definition: sc_list.c:277
void sl_fprint_tab(FILE *in_fi, Psyslist in_sl, char *(*in_fu)(), int in_tab)
Definition: sc_list.c:383
int fprintf()
test sc_min : ce test s'appelle par : programme fichier1.data fichier2.data ...
void vect_chg_sgn(Pvecteur v)
void vect_chg_sgn(Pvecteur v): multiplie v par -1
Definition: scalaires.c:151
Pvecteur vecteur
struct Scontrainte * succ
Warning! Do not modify this file that is automatically generated!
Definition: union-local.h:3
Psysteme psys
Definition: union-local.h:4
struct Ssyslist * succ
Definition: union-local.h:5
Pcontrainte inegalites
Definition: sc-local.h:71
Pcontrainte egalites
Definition: sc-local.h:70
int nb_ineq
Definition: sc-local.h:73
le type des coefficients dans les vecteurs: Value est defini dans le package arithmetique
Definition: vecteur-local.h:89
Variable var
Definition: vecteur-local.h:90
struct Svecteur * succ
Definition: vecteur-local.h:92
#define dj_fprint(fi, dj, fu)
Definition: union-local.h:96
#define IS_DJ
Definition: union-local.h:135
#define DJ_UNDEFINED_P(dj)
Definition: union-local.h:97
Ssyslist * Pdisjunct
Definition: union-local.h:10
#define C3_DEBUG(fun, code)
Definition: union-local.h:150
#define dj_intersection(dj1, dj2)
Definition: union-local.h:101
#define C3_RETURN(type, val)
Definition: union-local.h:151
#define DJ_UNDEFINED
Definition: union-local.h:12
#define TCST
VARIABLE REPRESENTANT LE TERME CONSTANT.
void * Variable
arithmetique is a requirement for vecteur, but I do not want to inforce it in all pips files....
Definition: vecteur-local.h:60
Pvecteur vect_dup(Pvecteur v_in)
Pvecteur vect_dup(Pvecteur v_in): duplication du vecteur v_in; allocation de et copie dans v_out;.
Definition: alloc.c:51
Pvecteur vect_new(Variable var, Value coeff)
Pvecteur vect_new(Variable var,Value coeff): allocation d'un vecteur colineaire au vecteur de base va...
Definition: alloc.c:110
void vect_rm(Pvecteur v)
void vect_rm(Pvecteur v): desallocation des couples de v;
Definition: alloc.c:78
Pvecteur vect_add(Pvecteur v1, Pvecteur v2)
package vecteur - operations binaires
Definition: binaires.c:53
Value vect_coeff(Variable var, Pvecteur vect)
Variable vect_coeff(Variable var, Pvecteur vect): coefficient de coordonnee var du vecteur vect —> So...
Definition: unaires.c:228