1 #ifndef __GLPK_SOLVER_HPP_ 2 #define __GLPK_SOLVER_HPP_ 23 #include "system_constants.hpp" 25 #include "lp_solver.hpp" 56 if (dirty) result =
get_rays().size();
57 else result =
rays.size();
61 virtual unsigned long get_number_of_constraints() {
return m; }
66 virtual bool solve(vector<constraint> &);
74 bool inconsistent =
true;
76 auto riter =
rays.begin();
77 inconsistent and riter !=
rays.end();
81 for (
int i = 0; i < riter->get_dimension(); ++i)
87 if (!inconsistent) cout << *riter << endl;
90 if (show_data) cout << endl;
91 return not inconsistent;
99 RAYENT_TYPE * ray_data;
virtual bool copy(const LP_Solver *)
performs a deep copy, similar to a copy constructor
virtual bool makes_consistent_constraint(const Monomial &t, const Monomial &u, bool show_data=false)
tests for consistency of a constraint generated by two monomials.
virtual NVAR_TYPE get_dimension() const
Returns the dimension of the underlying vector space.
approximate skeleton of a polyhedral cone, using GLPK linear solver
virtual unsigned long get_number_of_rays()
Returns the number of rays defining the skeleton.
exact or approximate polyhedral cone solution, with methods allowing definition and refinement ...
GLPK_Solver(NVAR_TYPE n)
initializes solver for variables
Implementation of monomials.
virtual const set< ray > & get_rays()
Returns the rays that define the skeleton.
DEG_TYPE degree(NVAR_TYPE i) const
Degree of th variable.
virtual bool solve(constraint &)
Adds the indicated constraint (singular!) and re-computes the solution.