Gröbner basis project
Codebase for research into Gröbner basis computation
ppl_solver.hpp
1 #ifndef __PPL_SOLVER_HPP_
2 #define __PPL_SOLVER_HPP_
3 
4 /*****************************************************************************\
5 * This file is part of DynGB. *
6 * *
7 * DynGB is free software: you can redistribute it and/or modify *
8 * it under the terms of the GNU General Public License as published by *
9 * the Free Software Foundation, either version 2 of the License, or *
10 * (at your option) any later version. *
11 * *
12 * Foobar is distributed in the hope that it will be useful, *
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
15 * GNU General Public License for more details. *
16 * *
17 * You should have received a copy of the GNU General Public License *
18 * along with DynGB. If not, see <http://www.gnu.org/licenses/>. *
19 \*****************************************************************************/
20 
21 #include <ppl.hh>
22 namespace PPL = Parma_Polyhedra_Library;
23 
24 #include "system_constants.hpp"
25 
26 #include "lp_solver.hpp"
27 
38 class PPL_Solver : public LP_Solver {
39 public:
41 
43  PPL_Solver(NVAR_TYPE n);
45  PPL_Solver(const PPL_Solver &);
46  virtual bool copy(const LP_Solver *);
48 
49  virtual ~PPL_Solver();
52 
53  virtual NVAR_TYPE get_dimension() const { return n; }
55  virtual unsigned long get_number_of_constraints() { return m; }
57 
58  virtual bool solve(constraint &);
60  virtual bool solve(vector<constraint> &);
62  virtual void setup_rays();
64 protected:
65  PPL::NNC_Polyhedron * lp;
66  NVAR_TYPE n;
67  unsigned m;
68  static unsigned instances;
69  PPL::Variable ** X;
70  RAYENT_TYPE * ray_data;
71 };
72 
73 #endif
virtual bool solve(constraint &)
Adds the indicated constraint (singular!) and re-computes the solution.
Definition: ppl_solver.cpp:113
approximate skeleton of a polyhedral cone, using PPL linear solver
Definition: ppl_solver.hpp:38
NVAR_TYPE n
number of variables
Definition: ppl_solver.hpp:66
a constraint
Definition: lp_solver.hpp:53
exact or approximate polyhedral cone solution, with methods allowing definition and refinement ...
Definition: lp_solver.hpp:504
RAYENT_TYPE * ray_data
used to retrieve rays
Definition: ppl_solver.hpp:70
unsigned m
number of constraints
Definition: ppl_solver.hpp:67
PPL_Solver(NVAR_TYPE n)
initializes solver for variables
Definition: ppl_solver.cpp:52
PPL::Variable ** X
array of variables
Definition: ppl_solver.hpp:69
static unsigned instances
number of PPL instances
Definition: ppl_solver.hpp:68
virtual bool copy(const LP_Solver *)
performs a deep copy, similar to a copy constructor
Definition: ppl_solver.cpp:82
PPL::NNC_Polyhedron * lp
PPL problem interface.
Definition: ppl_solver.hpp:65
virtual NVAR_TYPE get_dimension() const
Returns the dimension of the underlying vector space.
Definition: ppl_solver.hpp:54
virtual void setup_rays()
clear the current set of rays and extracts the ones contained in lp
Definition: ppl_solver.cpp:38