00001 /* Polyhedron disjoint intersections 00002 */ 00003 00004 /* 00005 disjoint_union_adj computes the disjoint union of the given list of domains. 00006 input: 00007 (integer) # of polyhedra 00008 list of polyhedra in the usual matrix (constraints) format 00009 00010 output: 00011 list of polyhedra (constraint matrices) having their facets in common 00012 00013 */ 00014 00015 #include <stdio.h> 00016 #include <stdlib.h> 00017 00018 #include <polylib/polylib.h> 00019 00020 #define WS 0 00021 00022 00023 /* Procedure to print constraints of a domain */ 00024 void AffContraintes(Polyhedron *p) 00025 { 00026 for( ;p;p=p->next) 00027 { 00028 Polyhedron_PrintConstraints(stdout, P_VALUE_FMT, p ); 00029 printf("\n"); 00030 } 00031 } 00032 00033 00034 int main() { 00035 00036 int np, i; 00037 00038 Matrix *a; 00039 Polyhedron *A, *tmp, *DD; 00040 00041 scanf( "%d", &np ); 00042 00043 A = NULL; 00044 for( i=0 ; i<np ; i++ ) 00045 { 00046 a = Matrix_Read(); 00047 tmp = Constraints2Polyhedron(a,WS); 00048 Matrix_Free(a); 00049 tmp ->next = A; 00050 A = tmp; 00051 } 00052 00053 00054 DD = Disjoint_Domain( A, 1, WS ); 00055 00056 AffContraintes(DD); 00057 00058 return 0; 00059 } 00060 00061 00062