3 struct counter
: public np_base
{
12 counter(unsigned dim
, unsigned long max_index
) : np_base(dim
) {
14 num
= Matrix_Alloc(max_index
, 1);
15 den
= Matrix_Alloc(dim
, 1);
16 lambda
= Vector_Alloc(dim
);
20 virtual void init(Polyhedron
*P
) {
22 randomvector(P
, l
, dim
);
23 zz2values(l
, lambda
->p
);
26 virtual void reset() {
27 mpq_set_si(count
, 0, 0);
38 void add_falling_powers(dpoly
& n
, Value c
);
39 virtual void handle(const mat_ZZ
& rays
, Value
*vertex
, const QQ
& c
,
40 unsigned long det
, int *closed
, barvinok_options
*options
);
41 virtual void get_count(Value
*result
) {
42 assert(value_one_p(&count
[0]._mp_den
));
43 value_assign(*result
, &count
[0]._mp_num
);