separate computation of Bernoulli coefficients and Faulhaber polynomials
[barvinok.git] / decomposer.h
blob997399a9bff861fb19d6eafc276bebfb1b748052
1 #ifndef DECOMPOSER_H
2 #define DECOMPOSER_H
4 #include <gmp.h>
5 #include <NTL/mat_ZZ.h>
6 #include <barvinok/polylib.h>
7 #include <barvinok/options.h>
9 #ifdef NTL_STD_CXX
10 using namespace NTL;
11 #endif
13 struct signed_cone {
14 signed_cone(const mat_ZZ& rays, int sign, unsigned long det,
15 int *closed = NULL) :
16 C(NULL), rays(rays), sign(sign), det(det), closed(closed) {}
17 signed_cone(Polyhedron *C, const mat_ZZ& rays, int sign, unsigned long det = 0,
18 int *closed = NULL) :
19 C(C), rays(rays), sign(sign), det(det), closed(closed) {}
20 Polyhedron *C;
21 const mat_ZZ& rays;
22 int sign;
23 unsigned long det;
24 /* facet not containing ray is closed */
25 int *closed;
28 struct signed_cone_consumer {
29 virtual void handle(const signed_cone& sc, barvinok_options *options) = 0;
30 virtual ~signed_cone_consumer() {}
33 struct vertex_decomposer {
34 Polyhedron *P;
35 unsigned nbV; // number of vertices
36 Param_Vertices *V; // current vertex
37 int vert; // current vertex index
38 signed_cone_consumer& scc;
40 vertex_decomposer(Polyhedron *P, unsigned nbV, signed_cone_consumer& scc) :
41 P(P), nbV(nbV), scc(scc) {}
42 void decompose_at_vertex(Param_Vertices *V, int _i, barvinok_options *options);
45 void barvinok_decompose(Polyhedron *C, signed_cone_consumer& scc,
46 barvinok_options *options);
48 #endif