README: rename
[ppn.git] / size.h
blobb8fa437e60bf1e09d75442b2235c81064c28aadc
1 #ifndef SIZE_H
2 #define SIZE_H
4 #include <isl/polynomial.h>
5 #include <barvinok/isl.h>
6 #include <isa/pdg.h>
7 #include "size_options.h"
9 namespace size {
11 struct enumerator {
12 enum type {
13 fixed,
14 qp,
15 fold,
16 } type;
17 int v;
18 pdg::PDG *pdg;
19 isl_pw_qpolynomial *pwqp;
20 isl_pw_qpolynomial_fold *pwf;
21 enumerator(int v) : type(fixed), v(v) {}
22 enumerator(__isl_take isl_pw_qpolynomial *pwqp, pdg::PDG *pdg) :
23 type(qp), pwqp(pwqp), pdg(pdg) {}
24 enumerator(__isl_take isl_pw_qpolynomial_fold *pwf, pdg::PDG *pdg) :
25 type(fold), pwf(pwf), pdg(pdg) {}
26 operator pdg::enumerator *() const;
27 /* evaluate the enumerator at the values stored in the parameters */
28 integer *evaluate() const;
29 ~enumerator() {
30 if (type == qp)
31 isl_pw_qpolynomial_free(pwqp);
32 if (type == fold)
33 isl_pw_qpolynomial_fold_free(pwf);
37 size::enumerator *selfloop_size(pdg::PDG *pdg, __isl_take isl_map *dep,
38 size_options *options);
39 isl_pw_qpolynomial *selfloop_tokens_in_fifo(__isl_take isl_map *dep,
40 __isl_take isl_set *ref);
44 #endif