barvinok_count: postpone computation of dual if allowed by PolyLib.
[barvinok.git] / util.h
blobd2a7d1e68a561f0b7db79159a2873f1f10fae408
1 #ifndef UTIL_H
2 #define UTIL_H
4 #if defined(__cplusplus)
5 extern "C" {
6 #endif
8 #include <polylib/polylibgmp.h>
10 #ifdef POL_NO_DUAL
11 #define emptyQ2(P) \
12 ((F_ISSET(P, POL_INEQUALITIES) && P->NbEq > P->Dimension) || \
13 (F_ISSET(P, POL_POINTS) && P->NbRays == 0))
14 #else
15 #define POL_NO_DUAL 0
16 #define emptyQ2(P) emptyQ(P)
17 #define POL_ENSURE_VERTICES(P) /* nothing */
18 #endif
20 void value_lcm(Value i, Value j, Value* lcm);
21 int random_int(int max);
22 Polyhedron* Polyhedron_Polar(Polyhedron *P, unsigned NbMaxRays);
23 void Polyhedron_Polarize(Polyhedron *P);
24 Polyhedron* supporting_cone(Polyhedron *P, int v);
25 Polyhedron* supporting_cone_p(Polyhedron *P, Param_Vertices *v);
26 Polyhedron* triangularize_cone(Polyhedron *P, unsigned NbMaxCons);
27 void check_triangulization(Polyhedron *P, Polyhedron *T);
28 Polyhedron *remove_equalities(Polyhedron *P);
29 Polyhedron *remove_equalities_p(Polyhedron *P, unsigned nvar, Matrix **factor);
30 void manual_count(Polyhedron *P, Value* result);
31 Polyhedron* Polyhedron_Reduce(Polyhedron *P, Value* factor);
32 Matrix * unimodular_complete(Vector *row);
33 Bool isIdentity(Matrix *M);
34 void Param_Polyhedron_Print(FILE* DST, Param_Polyhedron *PP, char **param_names);
35 void Enumeration_Print(FILE *Dst, Enumeration *en, char **params);
36 void Enumeration_mod2table(Enumeration *en, unsigned nparam);
37 size_t Enumeration_size(Enumeration *en);
38 void Free_ParamNames(char **params, int m);
39 int DomainIncludes(Polyhedron *Pol1, Polyhedron *Pol2);
40 int ConstraintSimplify(Value *old, Value *n, int len, Value* v);
41 Polyhedron *DomainConstraintSimplify(Polyhedron *P, unsigned MaxRays);
42 int line_minmax(Polyhedron *I, Value *min, Value *max);
43 void count_points_e (int pos, Polyhedron *P, int exist, int nparam,
44 Value *context, Value *res);
45 int DomainContains(Polyhedron *P, Value *list_args, int len,
46 unsigned MaxRays, int set);
47 Polyhedron* Polyhedron_Project(Polyhedron *P, int dim);
49 const char *barvinok_version();
51 #include "ev_operations.h"
53 Polyhedron* ParamPolyhedron_Reduce(Polyhedron *P, unsigned nvar,
54 evalue* factor);
56 #if defined(__cplusplus)
58 #endif
60 #endif