Gröbner basis project
Codebase for research into Gröbner basis computation
LP_Solver Class Referenceabstract

exact or approximate polyhedral cone solution, with methods allowing definition and refinement More...

#include <lp_solver.hpp>

Inheritance diagram for LP_Solver:
GLPK_Solver PPL_Solver skeleton

Public Member Functions

Construction
virtual bool copy (const LP_Solver *)=0
 performs a deep copy, similar to a copy constructor More...
 
Modification
virtual bool solve (constraint &)=0
 Adds the indicated constraint (singular!) and re-computes the solution. More...
 
virtual bool solve (vector< constraint > &)=0
 Adds the indicated constraints (plural!) and re-computes the solution. More...
 
Basic properies

Returns rays that define a skeleton.

When using an approximate solver such as GLPK_Solver, this will give only an approximate skeleton.

virtual NVAR_TYPE get_dimension () const =0
 Returns the dimension of the underlying vector space.
 
virtual unsigned long get_number_of_rays ()
 Returns the number of rays defining the skeleton.
 
virtual const set< ray > & get_rays ()
 Returns the rays that define the skeleton.
 
virtual unsigned long get_number_of_constraints ()=0
 
Computation
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.
 

Protected Attributes

set< rayrays
 

Detailed Description

exact or approximate polyhedral cone solution, with methods allowing definition and refinement

Author
John Perry
Version
1.0
Date
January 2017

This class encapsulates the skeleton of a polyhedral cone, defined by a sequence of inequalities of the form \( c_1 x_1 + \cdots c_n x_n \geq 0 \).

Warning
Some classes may provide only an approximate cone; see, for example, GLPK_Solver. In addition, Clients must ensure two things.
  1. The rays must have the same number \( m \) of dimensions, constraints must have the same number \( n \) of variables, and \( m=n \). Violating any of these three conditions will lead to undesirable behavior.
  2. When refining the cone, it is essential to check that the return value of solve() is true; for if it is not, then the cone is no longer be consistent. Please read the relevant documentation.

Definition at line 452 of file lp_solver.hpp.

Member Function Documentation

◆ copy()

virtual bool LP_Solver::copy ( const LP_Solver )
pure virtual

performs a deep copy, similar to a copy constructor

Warning
Do not mix-and-match solvers. At the present time, a PPL_Solver is not equipped to copy a GLPK_Solver, or vice versa. (This doesn't even make sense between exact and approximate solvers.)

Implemented in skeleton, PPL_Solver, and GLPK_Solver.

◆ solve() [1/2]

virtual bool LP_Solver::solve ( constraint )
pure virtual

Adds the indicated constraint (singular!) and re-computes the solution.

Returns
true if and only if the new constraint is consistent with the current constraints
Warning
Checking the return value is crucial! If the function returns false, you have an inconsistent system! While the present cone will remain consistent, the function will not roll back previous changes you have made, so if you want to iterate again, your best bet is to copy the skeleton, and try that copy. Accept the new constraints only if that copy succeeds, in which case, you might as well discard the original, and keep the copy.

Implemented in skeleton, GLPK_Solver, and PPL_Solver.

◆ solve() [2/2]

virtual bool LP_Solver::solve ( vector< constraint > &  )
pure virtual

Adds the indicated constraints (plural!) and re-computes the solution.

Returns
true if and only if the new constraints are consistent with the current constraints
Warning
Checking the return value is crucial! If the function returns false, you have an inconsistent system! While the present cone will remain consistent, the function will not roll back previous changes you have made, so if you want to iterate again, your best bet is to copy the skeleton, and try that copy. Accept the new constraints only if that copy succeeds, in which case, you might as well discard the original, and keep the copy.

Implemented in skeleton, GLPK_Solver, and PPL_Solver.

Member Data Documentation

◆ rays

set<ray> LP_Solver::rays
protected

the skeleton (may be approximate, depending on solver)

Definition at line 544 of file lp_solver.hpp.


The documentation for this class was generated from the following files: