scale.c: avoid simplification of constraints after scaling
[barvinok.git] / decomposer.h
blobf014d2f1aacff96cfb4c362127fbf760127026a8
1 #ifndef DECOMPOSER_H
2 #define DECOMPOSER_H
4 #include <gmp.h>
5 #include <barvinok/polylib.h>
6 #include <barvinok/options.h>
8 struct signed_cone {
9 signed_cone(const mat_ZZ& rays, int sign, unsigned long det,
10 int *closed = NULL) :
11 C(NULL), rays(rays), sign(sign), det(det), closed(closed) {}
12 signed_cone(Polyhedron *C, const mat_ZZ& rays, int sign, unsigned long det = 0,
13 int *closed = NULL) :
14 C(C), rays(rays), sign(sign), det(det), closed(closed) {}
15 Polyhedron *C;
16 const mat_ZZ& rays;
17 int sign;
18 unsigned long det;
19 /* facet not containing ray is closed */
20 int *closed;
23 struct signed_cone_consumer {
24 virtual void handle(const signed_cone& sc, barvinok_options *options) = 0;
25 virtual ~signed_cone_consumer() {}
28 struct vertex_decomposer {
29 Polyhedron *P;
30 unsigned nbV; // number of vertices
31 Param_Vertices *V; // current vertex
32 int vert; // current vertex index
33 signed_cone_consumer& scc;
35 vertex_decomposer(Polyhedron *P, unsigned nbV, signed_cone_consumer& scc) :
36 P(P), nbV(nbV), scc(scc) {}
37 void decompose_at_vertex(Param_Vertices *V, int _i, barvinok_options *options);
40 void barvinok_decompose(Polyhedron *C, signed_cone_consumer& scc,
41 barvinok_options *options);
43 #endif