Cone_Hilbert_Basis: use standard_constraints to avoid some slack variables
[barvinok.git] / skewed_genfun.h
blob0e32fff62f3519c470d679e55ba1b6f65cdf40a6
1 #ifndef SKEWED_GENFUN_H
2 #define SKEWED_GENFUN_H
4 #include <barvinok/barvinok.h>
6 struct skewed_gen_fun {
7 gen_fun *gf;
8 /* maps original space to space in which gf is defined */
9 Matrix *T;
10 /* equalities in the original space that need to be satisfied for
11 * gf to be valid
13 Matrix *eq;
14 /* divisibilities in the original space that need to be satisfied for
15 * gf to be valid
17 Matrix *div;
19 skewed_gen_fun(gen_fun *gf, Matrix *T = NULL, Matrix *eq = NULL,
20 Matrix *div = NULL) :
21 gf(gf), T(T), eq(eq), div(div) {}
22 ~skewed_gen_fun() {
23 if (T)
24 Matrix_Free(T);
25 if (eq)
26 Matrix_Free(eq);
27 if (div)
28 Matrix_Free(div);
29 delete gf;
32 void print(std::ostream& os, unsigned int nparam, char **param_name) const;
33 operator evalue *() const {
34 assert(T == NULL && eq == NULL); /* other cases not supported for now */
35 return *gf;
37 void coefficient(Value* params, Value* c, barvinok_options *options) const;
40 #endif