QQ: add operator for multiplication by a scalar (ZZ)
[barvinok.git] / decomposer.h
blobc596b75d509d81a72cf983f604ced92537c5b8e5
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, int *closed = NULL) :
10 C(NULL), rays(rays), sign(sign), closed(closed) {}
11 signed_cone(Polyhedron *C, const mat_ZZ& rays, int sign, int *closed = NULL) :
12 C(C), rays(rays), sign(sign), closed(closed) {}
13 Polyhedron *C;
14 const mat_ZZ& rays;
15 int sign;
16 /* facet not containing ray is closed */
17 int *closed;
20 struct signed_cone_consumer {
21 virtual void handle(const signed_cone& sc, barvinok_options *options) = 0;
24 struct vertex_decomposer {
25 Polyhedron *P;
26 unsigned nbV; // number of vertices
27 Param_Vertices *V; // current vertex
28 int vert; // current vertex index
29 signed_cone_consumer& scc;
31 vertex_decomposer(Polyhedron *P, unsigned nbV, signed_cone_consumer& scc) :
32 P(P), nbV(nbV), scc(scc) {}
33 void decompose_at_vertex(Param_Vertices *V, int _i, barvinok_options *options);
36 void barvinok_decompose(Polyhedron *C, signed_cone_consumer& scc,
37 barvinok_options *options);
39 #endif