gen_fun::add: context of sum should be union of contexts of the terms
[barvinok.git] / skewed_genfun.h
blob33de8811ceb55e0da2123b7d84af2aa6d303bb60
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, Matrix *eq, Matrix *div) :
20 gf(gf), T(T), eq(eq), div(div) {}
21 ~skewed_gen_fun() {
22 if (T)
23 Matrix_Free(T);
24 if (eq)
25 Matrix_Free(eq);
26 if (div)
27 Matrix_Free(div);
28 delete gf;
31 void print(std::ostream& os, unsigned int nparam, char **param_name) const;
32 operator evalue *() const {
33 assert(T == NULL && eq == NULL); /* other cases not supported for now */
34 return *gf;
36 void coefficient(Value* params, Value* c, barvinok_options *options) const;
39 #endif