3 struct counter
: public np_base
{
10 counter(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
);
24 virtual void reset() {
25 mpq_set_si(count
, 0, 0);
36 void add_falling_powers(dpoly
& n
, Value c
);
37 virtual void handle(const mat_ZZ
& rays
, Value
*vertex
, const QQ
& c
,
38 unsigned long det
, barvinok_options
*options
);
39 virtual void get_count(Value
*result
) {
40 assert(value_one_p(&count
[0]._mp_den
));
41 value_assign(*result
, &count
[0]._mp_num
);