PIPS
path.c File Reference
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "linear_assert.h"
#include <time.h>
#include <sys/time.h>
#include "boolean.h"
#include "arithmetique.h"
#include "vecteur.h"
#include "contrainte.h"
#include "sc.h"
#include "sommet.h"
#include "polyedre.h"
#include "union.h"
+ Include dependency graph for path.c:

Go to the source code of this file.

Functions

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 Documents: UNION.tex : `‘Extension de C3 aux unions de polyedres’' Comments : More...
 
Ppath pa_dup (Ppath in_pa)
 void pa_dup(Ppath pa) AL 30/05/94 More...
 
Ppath pa_free (Ppath in_pa)
 Ppath pa_free(Ppath pa) BA, AL 30/05/94. More...
 
Ppath pa_dup1 (Ppath in_pa)
 void pa_dup1(Ppath pa) AL 30/05/94 1 depth duplication: system and complements are shared. More...
 
Ppath pa_free1 (Ppath in_pa)
 Ppath pa_free1(Ppath pa) BA, AL 30/05/94 1 depth free. More...
 
Ppath pa_full ()
 Ppath pa_full() AL 18/11/93 Returns full space path : pa_full = pa_new() More...
 
bool pa_full_p (Ppath in_pa)
 pa_full_p( (Ppath) in_pa ) AL 18/11/93 Returns True if in_pa = (NIL) ^ (NIL) More...
 
Ppath pa_empty ()
 Ppath pa_empty() AL 18/11/93 Returns empty path : pa_empty = sc_empty(NULL) ^ (NIL) More...
 
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) More...
 
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. More...
 
Ppath pa_intersect_system (Ppath in_pa, Psysteme in_ps)
 Ppath pa_intersect_system( (Ppath) in_pa, (Psysteme) in_ps ) Computes the intersection between in_pa and in_ps. More...
 
Ppath pa_intersect_complement (Ppath in_pa, Pcomplement in_pc)
 Ppath pa_intersect_complement( (Ppath) in_pa, (Pcomplement) in_pc ) Computes the intersection between in_pa and in_ps. More...
 
Ppath pa_reduce_simple_complement (Ppath in_pa)
 Ppath pa_reduce_simple_complement( (Ppath) in_pa ) AL 16/11/93 Scan all the complement. More...
 
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 inequalities and returns in_pa. More...
 
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 possible and false if it is not possible or undefined. More...
 
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 corresponding to the path Ppath. More...
 
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 More...
 
Ppath pa_read (char *nomfic)
 void pa_read(FILE*) reads a Ppath More...
 

Function Documentation

◆ pa_dup()

Ppath pa_dup ( Ppath  in_pa)

void pa_dup(Ppath pa) AL 30/05/94

Parameters
in_pan_pa

Definition at line 68 of file path.c.

70 {
71  if (in_pa == PA_UNDEFINED ) return PA_UNDEFINED;
72  return pa_make( sc_dup(in_pa->psys), sl_dup(in_pa->pcomp) );
73 }
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
Psysteme sc_dup(Psysteme ps)
Psysteme sc_dup(Psysteme ps): should becomes a link.
Definition: sc_alloc.c:176
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
Pcomplist pcomp
Definition: union-local.h:20
Psysteme psys
Definition: union-local.h:19
#define PA_UNDEFINED
Definition: union-local.h:23

References pa_make(), PA_UNDEFINED, sc_dup(), and sl_dup().

+ Here is the call graph for this function:

◆ pa_dup1()

Ppath pa_dup1 ( Ppath  in_pa)

void pa_dup1(Ppath pa) AL 30/05/94 1 depth duplication: system and complements are shared.

Parameters
in_pan_pa

Definition at line 91 of file path.c.

93 {
94  if (in_pa == PA_UNDEFINED) return PA_UNDEFINED;
95  return pa_make( in_pa->psys, sl_dup1(in_pa->pcomp) );
96 }
Psyslist sl_dup1(Psyslist in_sl)
Psyslist sl_dup1( (Psyslist) in_sl ) AL 15/11/93 Duplicates input syslist.
Definition: sc_list.c:311

References pa_make(), PA_UNDEFINED, and sl_dup1().

+ Here is the call graph for this function:

◆ pa_empty()

Ppath pa_empty ( void  )

Ppath pa_empty() AL 18/11/93 Returns empty path : pa_empty = sc_empty(NULL) ^ (NIL)

Definition at line 135 of file path.c.

135 { return pa_make(sc_empty(NULL), NULL); }
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

References pa_make(), and sc_empty().

Referenced by adg_path_possible_source(), pa_intersect_complement(), pa_intersect_system(), pa_path_to_few_disjunct_ofl_ctrl(), pa_reduce_simple_complement(), and pa_supress_same_constraints().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ pa_empty_p()

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)

Parameters
in_pan_pa

Definition at line 141 of file path.c.

143 {
144  return( (in_pa != PA_UNDEFINED) &&
145  ( in_pa->pcomp == NULL ) &&
146  ( in_pa->psys != NULL ) &&
147  ( sc_empty_p( in_pa->psys ) ) );
148 }
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

References PA_UNDEFINED, and sc_empty_p().

Referenced by adg_dataflowgraph(), adg_path_possible_source(), pa_feasibility_ofl_ctrl(), pa_intersect_complement(), pa_intersect_system(), pa_max_constraints_nb(), pa_path_to_disjunct_ofl_ctrl(), pa_path_to_disjunct_rule4_ofl_ctrl(), pa_path_to_few_disjunct_ofl_ctrl(), pa_reduce_simple_complement(), pa_supress_same_constraints(), and pa_transform_eg_in_ineg().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ pa_feasibility_ofl_ctrl()

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 possible and false if it is not possible or undefined.


Parameters
in_pan_pa
ofl_ctrlfl_ctrl

Definition at line 309 of file path.c.

312 {
313  Pdisjunct dj;
314  Ppath pa;
315  bool ret_bo = false;
316 #ifdef TRACE_LINEAR_PATH
317  FILE* report_file;
318 #endif
319 
320  if ( PA_UNDEFINED_P( in_pa )) return false;
321  if ( pa_empty_p ( in_pa )) return false;
322  if ( pa_full_p ( in_pa )) return true;
323 
324 #ifdef TRACE_LINEAR_PATH
325  /* Just to keep trace of input paths if wanted */
326  if (getenv("KEEP_PATH") != (char*) NULL) {
327  struct timeval *tp = (struct timeval*) malloc(sizeof(struct timeval));
328  struct timezone *tz = (struct timezone*) malloc(sizeof(struct timezone));
329  int seconds;
330  gettimeofday( tp, tz ); seconds = tp->tv_sec;
331  report_file = fopen("mail_those_paths_to_arnauld","a");
332  pa_fprint( report_file, in_pa, union_variable_name );
333  fprintf( report_file, "# %s", ctime( &(seconds) ));
334  fprintf( report_file,
335  "# Module: \t%s\n", db_get_current_module_name());
336  fprintf( report_file,
337  "# Input number of complement: \t%d\n", sl_length(in_pa->pcomp) );
338  fprintf( report_file,
339  "# Input max constrainst: \t%d\n", pa_max_constraints_nb(in_pa));
340  fflush ( report_file ); free( tp ); free( tz );
341  }
342 #endif
343 
344  pa = pa_supress_same_constraints( in_pa );
345  dj = pa_path_to_few_disjunct_ofl_ctrl( pa, ofl_ctrl );
346  if( dj_empty_p(dj) || (dj == NULL) ) ret_bo = false;
347  else ret_bo = true;
348 
349 
350 #ifdef TRACE_LINEAR_PATH
351  /* keep trace of paths */
352  if (getenv("KEEP_PATH") != (char*) NULL) {
353  fprintf( report_file,
354  "# Output number of disjunctions: \t%d\n", sl_length(dj) );
355  fprintf( report_file,
356  "# Output max constrainst: \t%d\n", sl_max_constraints_nb(dj));
357  fprintf( report_file,
358  "# Feasible: \t%s\n", (ret_bo) ? "YES":"NO" );
359  fclose ( report_file );
360  }
361 #endif
362 
363  pa = pa_free( pa ); dj = dj_free( dj );
364  return ret_bo;
365 }
string db_get_current_module_name(void)
Also used to check whether set...
Definition: database.c:1059
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
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
void * malloc(YYSIZE_T)
void free(void *)
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.
Definition: path.c:155
Ppath pa_free(Ppath in_pa)
Ppath pa_free(Ppath pa) BA, AL 30/05/94.
Definition: path.c:76
bool pa_full_p(Ppath in_pa)
pa_full_p( (Ppath) in_pa ) AL 18/11/93 Returns True if in_pa = (NIL) ^ (NIL)
Definition: path.c:123
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)
Definition: path.c:141
Ppath pa_supress_same_constraints(Ppath in_pa)
Ppath pa_supress_same_constraints( (Ppath) in_pa ) Supress from complements of in_pa same constrain...
Definition: reduc.c:528
Pdisjunct pa_path_to_few_disjunct_ofl_ctrl(Ppath in_pa, int ofl_ctrl)
line 1197 "reduc.w"
Definition: reduc.c:648
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
int sl_max_constraints_nb(Psyslist in_sl)
int sl_max_constraints_nb( (Psyslist) in_sl ) Give the maximum constraints nb among systems of in_sl.
Definition: sc_list.c:207
bool sl_length(Psyslist in_sl)
int sl_length( (Psyslist) in_sl ) AL 26/04/95 Returns length of in_sl.
Definition: sc_list.c:193
int fprintf()
test sc_min : ce test s'appelle par : programme fichier1.data fichier2.data ...
Warning! Do not modify this file that is automatically generated!
Definition: union-local.h:3
#define pa_fprint(fi, pa, fu)
Definition: union-local.h:109
#define PA_UNDEFINED_P(pa)
Definition: union-local.h:110

References db_get_current_module_name(), dj_empty_p(), dj_free(), fprintf(), free(), malloc(), pa_empty_p(), pa_fprint, pa_free(), pa_full_p(), pa_max_constraints_nb(), pa_path_to_few_disjunct_ofl_ctrl(), pa_supress_same_constraints(), PA_UNDEFINED_P, sl_length(), sl_max_constraints_nb(), and union_variable_name.

Referenced by disjunction_to_region_sc(), pa_convex_hull_equals_union_p_ofl_ctrl(), and pa_inclusion_p_ofl_ctrl().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ pa_fprint_tab()

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

Definition at line 412 of file path.c.

417 {
418  Psyslist sl;
419  char* tabs = sl_get_tab_string( in_tab );
420 
421  if (pa_full_p(in_pa)) {
422  fprintf(in_fi, "%sPA_FULL\n", tabs);
423  free(tabs); return;
424  }
425  if PA_UNDEFINED_P(in_pa) {
426  fprintf(in_fi, "%sPA_UNDEFINED\n", tabs);
427  free(tabs); return;
428  }
429 
430  sl = sl_new(); sl->succ = in_pa->pcomp; sl->psys = in_pa->psys;
431  fprintf ( in_fi, "\n%s# --------PA BEGIN------\n", tabs);
432  sl_fprint_tab( in_fi, sl, in_fu, in_tab );
433  fprintf ( in_fi, "\n%s# --------PA END--------\n", tabs);
434  free( sl ); free( tabs ); return;
435 }
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_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
Psysteme psys
Definition: union-local.h:4
struct Ssyslist * succ
Definition: union-local.h:5

References fprintf(), free(), pa_full_p(), PA_UNDEFINED_P, Spath::pcomp, Ssyslist::psys, Spath::psys, sl_fprint_tab(), sl_get_tab_string(), sl_new(), and Ssyslist::succ.

Referenced by pa_path_to_few_disjunct_ofl_ctrl(), pa_reduce_simple_complement(), and pa_supress_same_constraints().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ pa_free()

Ppath pa_free ( Ppath  in_pa)

Ppath pa_free(Ppath pa) BA, AL 30/05/94.

Parameters
in_pan_pa

Definition at line 76 of file path.c.

78 {
79  if (in_pa != PA_UNDEFINED) {
80  in_pa->psys = sc_free(in_pa->psys);
81  in_pa->pcomp = sl_free((Psyslist) in_pa->pcomp);
82  free( in_pa ); in_pa = PA_UNDEFINED;
83  }
84  return((Ppath) PA_UNDEFINED);
85 }
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_free(Psyslist psl)
Psyslist sl_free(Psyslist psl) BA, AL 30/05/94 w - 1 depth free.
Definition: sc_list.c:327

References free(), PA_UNDEFINED, Spath::psys, sc_free(), and sl_free().

Referenced by pa_feasibility_ofl_ctrl(), pa_path_to_disjunct_rule4_ofl_ctrl(), pa_path_to_few_disjunct_ofl_ctrl(), and pa_reduce_simple_complement().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ pa_free1()

Ppath pa_free1 ( Ppath  in_pa)

Ppath pa_free1(Ppath pa) BA, AL 30/05/94 1 depth free.

System and complement are not freed.

Parameters
in_pan_pa

Definition at line 102 of file path.c.

104 {
105  if (in_pa != PA_UNDEFINED) {
106  sl_free1((Psyslist) in_pa->pcomp);
107  free( in_pa ); in_pa = PA_UNDEFINED;
108  }
109  return((Ppath) PA_UNDEFINED);
110 }
Psyslist sl_free1(Psyslist psl)
Psyslist sl_free1(Psyslist psl) AL 30/05/94 1 depth free.
Definition: sc_list.c:343

References free(), PA_UNDEFINED, and sl_free1().

Referenced by disjunction_to_region_sc(), pa_convex_hull_equals_union_p_ofl_ctrl(), pa_inclusion_p_ofl_ctrl(), pa_path_to_few_disjunct_ofl_ctrl(), pa_reduce_simple_complement(), and pa_system_difference_ofl_ctrl().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ pa_full()

Ppath pa_full ( void  )

Ppath pa_full() AL 18/11/93 Returns full space path : pa_full = pa_new()

Definition at line 117 of file path.c.

117 { return pa_new(); }
#define pa_new()
Definition: union-local.h:111

References pa_new.

Referenced by adg_dataflowgraph(), adg_dataflowgraph_with_extremities(), and pa_supress_same_constraints().

+ Here is the caller graph for this function:

◆ pa_full_p()

bool pa_full_p ( Ppath  in_pa)

pa_full_p( (Ppath) in_pa ) AL 18/11/93 Returns True if in_pa = (NIL) ^ (NIL)

Parameters
in_pan_pa

Definition at line 123 of file path.c.

125 {
126  return( (in_pa != PA_UNDEFINED) &&
127  ( in_pa->pcomp == NULL ) &&
128  ( in_pa->psys == NULL ) );
129 }

References PA_UNDEFINED.

Referenced by pa_feasibility_ofl_ctrl(), pa_fprint_tab(), pa_intersect_complement(), pa_intersect_system(), pa_max_constraints_nb(), pa_path_to_disjunct_ofl_ctrl(), pa_path_to_few_disjunct_ofl_ctrl(), pa_reduce_simple_complement(), pa_supress_same_constraints(), and pa_transform_eg_in_ineg().

+ Here is the caller graph for this function:

◆ pa_intersect_complement()

Ppath pa_intersect_complement ( Ppath  in_pa,
Pcomplement  in_pc 
)

Ppath pa_intersect_complement( (Ppath) in_pa, (Pcomplement) in_pc ) Computes the intersection between in_pa and in_ps.

AL 17/11/93 No sharing

Parameters
in_pan_pa
in_pcn_pc

Definition at line 200 of file path.c.

203 {
204  Pcomplist pc;
205  Psysteme ps;
206 
207  if (PA_UNDEFINED_P(in_pa)||SC_UNDEFINED_P(in_pc)) return PA_UNDEFINED;
208  if (pa_empty_p(in_pa)) return pa_empty();
209 
210  if (pa_full_p(in_pa)) ps = sc_full(); else ps = sc_dup(in_pa->psys);
211  pc = sl_append_system( sl_dup(in_pa->pcomp), sc_dup(in_pc) );
212  return pa_make(ps, pc) ;
213 }
Ppath pa_empty()
Ppath pa_empty() AL 18/11/93 Returns empty path : pa_empty = sc_empty(NULL) ^ (NIL)
Definition: path.c:135
Psysteme sc_full()
Psysteme sc_full() similar to sc_new.
Definition: sc_list.c:58
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

References pa_empty(), pa_empty_p(), pa_full_p(), pa_make(), PA_UNDEFINED, PA_UNDEFINED_P, sc_dup(), sc_full(), sl_append_system(), and sl_dup().

Referenced by adg_path_max_source(), adg_path_possible_source(), and adg_update_dfg().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ pa_intersect_system()

Ppath pa_intersect_system ( Ppath  in_pa,
Psysteme  in_ps 
)

Ppath pa_intersect_system( (Ppath) in_pa, (Psysteme) in_ps ) Computes the intersection between in_pa and in_ps.

AL 25/04/95 No sharing

Parameters
in_pan_pa
in_psn_ps

Definition at line 178 of file path.c.

181 {
182  Psysteme ps;
183 
184  if (PA_UNDEFINED_P(in_pa)||SC_UNDEFINED_P(in_ps))
185  return PA_UNDEFINED;
186  if ( pa_empty_p(in_pa) ) return pa_empty();
187  if ( pa_full_p(in_pa) ) return pa_make(sc_dup(in_ps),NULL);
188 
189  ps = sc_normalize(sc_append( sc_dup(in_pa->psys), in_ps ));
190  if (ps == NULL){ ps = sc_free(ps); return pa_empty(); }
191  return pa_make(ps, sl_dup(in_pa->pcomp));
192 }
Psysteme sc_append(Psysteme s1, Psysteme s2)
Psysteme sc_append(Psysteme s1, Psysteme s2): calcul de l'intersection des polyedres definis par s1 e...
Psysteme sc_normalize(Psysteme ps)
Psysteme sc_normalize(Psysteme ps): normalisation d'un systeme d'equation et d'inequations lineaires ...

References pa_empty(), pa_empty_p(), pa_full_p(), pa_make(), PA_UNDEFINED, PA_UNDEFINED_P, sc_append(), sc_dup(), sc_free(), sc_normalize(), and sl_dup().

Referenced by adg_max_of_leaves(), adg_path_max_source(), adg_path_possible_source(), and adg_update_dfg().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ pa_make()

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 Documents: UNION.tex : `‘Extension de C3 aux unions de polyedres’' Comments :

path.c

           WARNING

THOSE FUNCTIONS ARE AUTOMATICALLY DERIVED

    FROM THE WEB SOURCES !

Ansi includes
Linear includes
Ppath pa_make(in_ps, in_pcomp) AL 16/11/93 Allocates a Ppath and initialize it with in_ps and in_pcomp SHARING.

Parameters
in_psn_ps
in_pcompn_pcomp

Definition at line 53 of file path.c.

56 {
57  Ppath ret_pa = (Ppath) malloc( sizeof( Spath ) );
58  if (ret_pa == NULL) {
59  (void) fprintf(stderr,"pa_new: Out of memory space\n");
60  exit(-1);
61  }
62  ret_pa->psys = in_ps; ret_pa->pcomp = in_pcomp;
63  return ret_pa;
64 }
#define exit(code)
Definition: misc-local.h:54
struct Spath * Ppath

References exit, fprintf(), malloc(), Spath::pcomp, and Spath::psys.

Referenced by disjunction_to_region_sc(), dj_intersect_djcomp_ofl_ctrl(), pa_convex_hull_equals_union_p_ofl_ctrl(), pa_dup(), pa_dup1(), pa_empty(), pa_inclusion_p_ofl_ctrl(), pa_intersect_complement(), pa_intersect_system(), pa_path_to_disjunct_rule4_ofl_ctrl(), pa_path_to_few_disjunct_ofl_ctrl(), pa_read(), pa_reduce_simple_complement(), pa_supress_same_constraints(), and pa_system_difference_ofl_ctrl().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ pa_max_constraints_nb()

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.

Parameters
in_pan_pa

Definition at line 155 of file path.c.

157 {
158  Psysteme ps;
159  int loc, ret_int;
160 
161  if (PA_UNDEFINED_P(in_pa)||pa_full_p(in_pa)) return 0;
162  if ( pa_empty_p(in_pa) ) return 1;
163 
164  ps = in_pa->psys;
165  ret_int = 2*(ps->nb_eq) + ps->nb_ineq;
166  loc = sl_max_constraints_nb( (Psyslist) in_pa->pcomp );
167 
168  if (loc > ret_int) ret_int = loc;
169  return ret_int;
170 }
int nb_ineq
Definition: sc-local.h:73
int nb_eq
Definition: sc-local.h:72

References Ssysteme::nb_eq, Ssysteme::nb_ineq, pa_empty_p(), pa_full_p(), PA_UNDEFINED_P, and sl_max_constraints_nb().

Referenced by pa_feasibility_ofl_ctrl(), and pa_path_to_disjunct_rule4_ofl_ctrl().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ pa_path_to_disjunct_ofl_ctrl()

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 corresponding to the path Ppath.

No sharing.

comparison between 2 methods

Parameters
in_pan_pa
ofl_ctrlfl_ctrl

Definition at line 374 of file path.c.

377 {
378  Pdisjunct ret_dj;
379  Pcomplist comp;
380  int meth1 = 0, meth2 = 1; /* comparison between 2 methods */
381 
382  if ( in_pa == PA_UNDEFINED ) return DJ_UNDEFINED;
383  if (pa_full_p(in_pa)) return dj_full();
384  if (pa_empty_p(in_pa)) return dj_empty();
385  if ((in_pa->psys != NULL) &&
386  sc_empty_p(in_pa->psys)) return dj_empty();
387 
388  ret_dj = (Pdisjunct) sl_append_system(NULL, sc_dup(in_pa->psys));
389  for( comp = in_pa->pcomp; comp != NULL; comp = comp->succ) {
390  Pdisjunct dj1 = dj_system_complement( comp->psys );
391  Pdisjunct dj2 = ret_dj;
392  int lg1 = sl_length( dj1 );
393  int lg2 = sl_length( dj2 );
394 
395  meth1 = meth1 + lg2*lg1 ; meth2 = meth2 * lg1;
396 
397  ret_dj = dj_intersection_ofl_ctrl( ret_dj, dj1, ofl_ctrl);
398  dj1 = dj_free( dj1 ); dj2 = dj_free( dj2 );
399  }
400 
401  C3_DEBUG("pa_path_to_disjunct_ofl_ctrl", {
402  fprintf(stderr, "Feasibility calls with method 1 and 2 : %d\t%d\n",
403  meth1, meth2);
404  });
405 
406  return( ret_dj );
407 }
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
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_full()
Pdisjunct dj_full() AL 18/11/93 Return full space disjunction = dj_new()
Definition: disjunct.c:92
Pdisjunct dj_empty()
Pdisjunct dj_empty() AL 18/11/93 Returns a disjunction with sc_empty() element.
Definition: disjunct.c:111
Ssyslist * Pdisjunct
Definition: union-local.h:10
#define C3_DEBUG(fun, code)
Definition: union-local.h:150
#define DJ_UNDEFINED
Definition: union-local.h:12

References C3_DEBUG, dj_empty(), dj_free(), dj_full(), dj_intersection_ofl_ctrl(), dj_system_complement(), DJ_UNDEFINED, fprintf(), pa_empty_p(), pa_full_p(), PA_UNDEFINED, Ssyslist::psys, sc_dup(), sc_empty_p(), sl_append_system(), sl_length(), and Ssyslist::succ.

Referenced by pa_path_to_disjunct_rule4_ofl_ctrl().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ pa_read()

Ppath pa_read ( char*  nomfic)

void pa_read(FILE*) reads a Ppath

Parameters
nomficomfic

Definition at line 438 of file path.c.

440 {
441  Ppath ret_pa;
442  Psyslist sl;
443 
444  sl = sl_read(nomfic);
445  if (sl == SL_NULL) return PA_UNDEFINED;
446  ret_pa = pa_make(sl->psys, (Pcomplist) sl->succ);
447  free( sl );
448  return ret_pa;
449 }
Psyslist sl_read(char *nomfic)
void sl_read(FILE*) reads a Psyslist
Definition: sc_list.c:461
#define SL_NULL
Definition: union-local.h:8

References free(), pa_make(), PA_UNDEFINED, Ssyslist::psys, SL_NULL, sl_read(), and Ssyslist::succ.

+ Here is the call graph for this function:

◆ pa_reduce_simple_complement()

Ppath pa_reduce_simple_complement ( Ppath  in_pa)

Ppath pa_reduce_simple_complement( (Ppath) in_pa ) AL 16/11/93 Scan all the complement.

If one complement is a simple inequality, its complement is computed and intersected with psys part of in_pa. in_pa is modified. (Sharing with in_pa).

Do we have a simple complement ?

also frees pss

Parameters
in_pan_pa

Definition at line 222 of file path.c.

224 {
225  Psysteme pss;
226  Pcomplist pco, pco2 = NULL, tofree = NULL;
227  Ppath ret_pa;
228  bool at_least_one = false ; /* Do we have a simple complement ? */
229 
230  if( pa_full_p(in_pa) || pa_empty_p(in_pa) || (in_pa == PA_UNDEFINED) )
231  return (in_pa);
232 
233  C3_DEBUG("pa_reduce_simple_complement", {
234  fprintf(stderr, "Input path:\n");
235  pa_fprint_tab( stderr, in_pa, union_variable_name, 1 );
236  });
237 
238  pss = in_pa->psys;
239  for( pco = in_pa->pcomp, pco2 = NULL; pco != NULL; pco = pco->succ ) {
240  Psysteme ps = pco->psys;
241 
242  if (ps == SC_UNDEFINED) {
243  pco2 = sl_free1(pco2);
244  in_pa = pa_free1(in_pa);
245  return PA_UNDEFINED ;
246  }
247  else if (sc_empty_p(ps)) continue;
248  else if ((ps->nb_ineq == 1) && (ps->nb_eq == 0)) {
249  Pdisjunct dj = dj_system_complement( ps );
250  pss = sc_safe_append( pss, dj->psys );
251  tofree = sl_append_system( tofree, ps );
252  dj = dj_free( dj );
253  at_least_one = true;
254  }
255  else { pco2 = (Pcomplist) sl_append_system( pco2, ps ); }
256  }
257 
258  if(!at_least_one) {
259  pco2 = sl_free1(pco2);
260  ret_pa = in_pa;
261  }
262  else if(!sc_faisabilite_ofl(pss)) {
263  pco2 = sl_free1( pco2 );
264  tofree = sl_free1( tofree );
265  in_pa = pa_free ( in_pa ); /* also frees pss */
266  ret_pa = pa_empty();
267  }
268  else {
269  in_pa = pa_free1( in_pa );
270  tofree = sl_free ( tofree );
271  ret_pa = pa_make ( pss, pco2 );
272  }
273 
274  C3_RETURN( IS_PA, ret_pa );
275 }
#define false
Definition: newgen_types.h:80
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
Definition: path.c:412
Ppath pa_free1(Ppath in_pa)
Ppath pa_free1(Ppath pa) BA, AL 30/05/94 1 depth free.
Definition: path.c:102
Psysteme sc_safe_append(Psysteme s1, Psysteme s2)
Psysteme sc_safe_append(Psysteme s1, Psysteme s2) input : output : calcul de l'intersection des polye...
#define C3_RETURN(type, val)
Definition: union-local.h:151
#define IS_PA
Definition: union-local.h:136
Ssyslist * Pcomplist
Definition: union-local.h:17

References C3_DEBUG, C3_RETURN, dj_free(), dj_system_complement(), false, fprintf(), IS_PA, Ssysteme::nb_eq, Ssysteme::nb_ineq, pa_empty(), pa_empty_p(), pa_fprint_tab(), pa_free(), pa_free1(), pa_full_p(), pa_make(), PA_UNDEFINED, Ssyslist::psys, sc_empty_p(), sc_safe_append(), sl_append_system(), sl_free(), sl_free1(), Ssyslist::succ, and union_variable_name.

Referenced by pa_path_to_disjunct_rule4_ofl_ctrl(), and pa_path_to_few_disjunct_ofl_ctrl().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ pa_transform_eg_in_ineg()

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 inequalities and returns in_pa.

in_pa is modified. (Sharing with in_pa).

Parameters
in_pan_pa

Definition at line 284 of file path.c.

286 {
287  Pcomplist pco;
288 
289  if( pa_full_p(in_pa) || pa_empty_p(in_pa) || (in_pa == PA_UNDEFINED) )
290  return (in_pa);
291 
292  sc_transform_eg_in_ineg( in_pa->psys );
293  for( pco = in_pa->pcomp; pco != NULL; pco = pco->succ )
294  { sc_transform_eg_in_ineg( pco->psys ); }
295 
296  return in_pa;
297 }
void sc_transform_eg_in_ineg(Psysteme sc)
Package sc.

References pa_empty_p(), pa_full_p(), PA_UNDEFINED, Ssyslist::psys, sc_transform_eg_in_ineg(), and Ssyslist::succ.

Referenced by pa_path_to_few_disjunct_ofl_ctrl().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: