1 #include <barvinok/options.h>
2 #include "reduce_domain.h"
4 Polyhedron
*reduce_domain(Polyhedron
*D
, Matrix
*CT
, Polyhedron
*CEq
,
5 Polyhedron
**fVD
, int nd
,
6 struct barvinok_options
*options
)
13 C
= D
->next
? DomainConvex(D
, options
->MaxRays
) : D
;
14 Dt
= CT
? DomainPreimage(C
, CT
, options
->MaxRays
) : C
;
15 rVD
= CEq
? DomainIntersection(Dt
, CEq
, options
->MaxRays
) : Domain_Copy(Dt
);
17 /* if rVD is empty or too small in geometric dimension */
18 if(!rVD
|| emptyQ(rVD
) ||
19 (CEq
&& rVD
->Dimension
-rVD
->NbEq
< Dt
->Dimension
-Dt
->NbEq
-CEq
->NbEq
)) {
26 return 0; /* empty validity domain */
34 fVD
[nd
] = Domain_Copy(rVD
);
35 for (i
= 0 ; i
< nd
; ++i
) {
37 Polyhedron
*I
= DomainIntersection(fVD
[nd
], fVD
[i
], options
->MaxRays
);
42 F
= DomainSimplify(I
, fVD
[nd
], options
->MaxRays
);
45 rVD
= DomainDifference(rVD
, F
, options
->MaxRays
);
52 rVD
= DomainConstraintSimplify(rVD
, options
->MaxRays
);
60 barvinok_count_with_options(rVD
, &c
, options
);
61 if (value_zero_p(c
)) {