piecewise_lst.h: avoid duplicate parameter name
[barvinok.git] / bernstein / include / bernstein / piecewise_lst.h
blobfbfdfcf24d5476a035a9908d6d148d4e8a61e8d6
1 #ifndef BERNSTEIN_PIECWISE_LST_H
2 #define BERNSTEIN_PIECWISE_LST_H
4 #include <iostream>
5 #include <vector>
6 #include <gmp.h>
7 #include <ginac/ginac.h>
8 extern "C" {
9 #include <polylib/polylibgmp.h>
12 namespace bernstein {
14 typedef std::pair< Polyhedron *, GiNaC::lst > guarded_lst;
16 struct piecewise_lst {
17 const GiNaC::exvector vars;
18 std::vector<guarded_lst> list;
19 /* 0: just collect terms
20 * 1: remove obviously smaller terms (maximize)
21 * -1: remove obviously bigger terms (minimize)
23 int sign;
25 piecewise_lst(const GiNaC::exvector& vars, int sign = 0) :
26 vars(vars), sign(sign) {}
27 void add_guarded_lst(Polyhedron *D, GiNaC::lst coeffs);
28 piecewise_lst& combine(const piecewise_lst& other);
29 void maximize();
30 void minimize();
31 void simplify_domains(Polyhedron *ctx, unsigned MaxRays);
32 GiNaC::numeric evaluate(const GiNaC::exvector& values);
33 void evaluate(int n, Value *v, Value *num, Value *d);
34 GiNaC::numeric evaluate(const GiNaC::exvector& values, int n, Value *v);
35 void add(const GiNaC::ex& poly);
36 int is_equal(const piecewise_lst& other) const;
38 ~piecewise_lst() {
39 free_list_domains();
41 private:
42 /* We don't allow making copies (yet), because we would have
43 * to make copies of all polyhedra.
45 piecewise_lst(const piecewise_lst&) {}
46 void free_list_domains() {
47 for (int i = 0; i < list.size(); ++i)
48 Domain_Free(list[i].first);
52 std::ostream & operator<< (std::ostream & os, const piecewise_lst & pl);
56 #endif