polylib 5.22.8
disjoint_union_sep.c
Go to the documentation of this file.
1/* Polyhedron disjoint intersections
2 */
3
4/*
5 disjoint_union_sep computes the disjoint union of the given list of domains.
6 input:
7 (integer) # of polyhedra
8 list of polyhedra in the usual matrix (constraints) format
9
10 output:
11 list of polyhedra (constraint matrices) having no integer point in common
12*/
13
14#include <stdio.h>
15#include <stdlib.h>
16
17#include <polylib/polylib.h>
18
19#define WS 0
20
21
22/* Procedure to print constraints of a domain */
24{
25 for( ;p;p=p->next)
26 {
28 printf("\n");
29 }
30}
31
32
33int main() {
34
35 int np, i;
36
37 Matrix *a;
38 Polyhedron *A, *tmp, *DD;
39
40 scanf( "%d", &np );
41
42 A = NULL;
43 for( i=0 ; i<np ; i++ )
44 {
45 a = Matrix_Read();
47 Matrix_Free(a);
48 tmp ->next = A;
49 A = tmp;
50 }
51
52
53 DD = Disjoint_Domain( A, 0, WS );
54
56
57 Domain_Free( DD );
58 Domain_Free( A );
59
60 return 0;
61}
62
63
64
void AffContraintes(Polyhedron *p)
#define WS
int main()
Matrix * Matrix_Read(void)
Definition: matrix.c:209
void Matrix_Free(Matrix *Mat)
Definition: matrix.c:71
Polyhedron * Disjoint_Domain(Polyhedron *P, int flag, unsigned NbMaxRays)
Definition: polyhedron.c:4540
void Polyhedron_PrintConstraints(FILE *Dst, const char *Format, Polyhedron *Pol)
Definition: polyhedron.c:4739
Polyhedron * Constraints2Polyhedron(Matrix *Constraints, unsigned NbMaxRays)
Given a matrix of constraints ('Constraints'), construct and return a polyhedron.
Definition: polyhedron.c:1905
void Domain_Free(Polyhedron *Pol)
Definition: polyhedron.c:1626
Definition: types.h:75
struct polyhedron * next
Definition: types.h:99
#define P_VALUE_FMT
Definition: types.h:39