3 struct counter_base
: public np_base
{
10 counter_base(unsigned dim
, unsigned long max_index
) : np_base(dim
) {
12 num
= Matrix_Alloc(max_index
, 1);
13 den
= Matrix_Alloc(dim
, 1);
14 lambda
= Vector_Alloc(dim
);
18 virtual void init(Polyhedron
*P
) {
20 randomvector(P
, l
, dim
);
21 zz2values(l
, lambda
->p
);
32 virtual void add_lattice_points(int sign
) = 0;
34 virtual void handle(const mat_ZZ
& rays
, Value
*vertex
, const QQ
& c
,
35 unsigned long det
, barvinok_options
*options
);
36 virtual void get_count(Value
*result
) {
37 assert(value_one_p(&count
[0]._mp_den
));
38 value_assign(*result
, &count
[0]._mp_num
);
42 struct counter
: public counter_base
{
43 counter(unsigned dim
, unsigned long max_index
) :
44 counter_base(dim
, max_index
) {}
46 virtual void reset() {
47 mpq_set_si(count
, 0, 0);
50 virtual void add_lattice_points(int sign
);
53 struct tcounter
: public counter_base
{
59 tcounter(unsigned dim
, unsigned long max_index
) :
60 counter_base(dim
, max_index
), todd(dim
) {
66 void setup_todd(unsigned dim
);
68 void adapt_todd(dpoly
& t
, const Value c
);
69 void add_powers(dpoly
& n
, const Value c
);
73 Vector_Free(todd_denom
);
77 virtual void add_lattice_points(int sign
);