5 #include <polylib/polylib.h>
8 void Union_Read( Polyhedron
**P
, Polyhedron
**C
, char ***param_name
)
12 unsigned NbRows
, NbColumns
;
13 char s
[1025], param
[1025];
23 if( fgets(s
, 1024, stdin
) == 0 )
26 while ( (*s
=='#' || *s
=='\n') && f
);
28 if( f
&& sscanf(s
, "%d %d", &NbRows
, &NbColumns
)==2 )
30 /* gets old pm and add it to the union */
32 if( pm
->NbColumns
!= ((*P
)->Dimension
)+2 )
35 "Polyhedra must be in the same dimension space !\n");
38 ptmp
= Constraints2Polyhedron(pm
, 200);
43 /* reads the new pm */
44 pm
= Matrix_Alloc(NbRows
, NbColumns
);
45 Matrix_Read_Input( pm
);
51 /* Context : last read pm */
52 *C
= Constraints2Polyhedron(pm
, 200);
58 /* read the parameter names */
59 *param_name
= (char **)malloc( (*C
)->Dimension
*sizeof(char *) );
61 for( i
=0 ; i
<(*C
)->Dimension
; ++i
)
66 if( s
[c
]==' ' || s
[c
]=='\n' || s
[c
]==0 ) {
75 /* else, no parameters (use default) */
79 (*param_name
)[i
] = (char *)malloc( j
);
80 strcpy( (*param_name
)[i
], param
);
82 if( i
!= (*C
)->Dimension
)
85 *param_name
= Read_ParamNames(NULL
,(*C
)->Dimension
);
89 *param_name
= Read_ParamNames(NULL
,(*C
)->Dimension
);
95 int main( int argc
, char **argv
)
103 fprintf( stderr
, " Usage : %s [< file]\n", argv
[0] );
107 Union_Read( &P
, &C
, ¶m_name
);
109 e
= Domain_Enumerate( P
, C
, 200, param_name
);
111 for( en
=e
; en
; en
=en
->next
)
113 Print_Domain(stdout
,en
->ValidityDomain
, param_name
);
114 print_evalue(stdout
,&en
->EP
, param_name
);
115 printf( "\n-----------------------------------\n" );