Gröbner basis project
Codebase for research into Gröbner basis computation
skeleton Class Reference

skeleton of a polyhedral cone, with methods allowing definition and refinement More...

#include <skeleton.hpp>

Inheritance diagram for skeleton:
LP_Solver

Public Member Functions

Construction
void common_initialization (NVAR_TYPE)
 Initialization common to all constructors.
 
 skeleton (NVAR_TYPE)
 Constructs a basic skeleton in the given number of dimensions, initialized to the axes, or (equivalently) to the set of constraints \( x_i \geq 0 \). More...
 
 skeleton (NVAR_TYPE, vector< constraint > &)
 Constructs a skeleton described by the given system of constraints. More...
 
 skeleton (skeleton &)
 Performs a deep copy of other.
 
virtual bool copy (const LP_Solver *)
 performs a deep copy, similar to a copy constructor More...
 
Destruction
 ~skeleton ()
 Currently does nothing the compiler wouldn't do.
 
Basic properties
NVAR_TYPE get_dimension () const
 Returns the dimension of the underlying vector space.
 
unsigned long get_number_of_edges ()
 Returns the number of edges defining the skeleton.
 
set< edgeget_edges ()
 Returns the edges that define the skeleton.
 
unsigned long get_number_of_constraints ()
 Returns the number of constraints defining the skeleton.
 
const vector< constraint > & get_constraints ()
 Returns the constraints that define the skeleton.
 
constraint get_constraint (int index)
 Returns the indicated constraint. Numbering starts at 0.
 
Computation
void which_constraints_active_at (const ray &u, bool *result) const
 returns the set of constraints in the skeleton active at u
 
bool is_consistent (const constraint &c) const
 tests for consistency of a potentially new constraint.
 
Modification
virtual bool solve (vector< constraint > &)
 Adds the indicated constraints (plural!) and re-computes the skeleton. More...
 
virtual bool solve (constraint &)
 Adds the indicated constraint (singular!) and re-computes the skeleton. More...
 
set< edgeadjacencies_by_graphs (set< ray >)
 Re-computes the edges in the skeleton using Zolotych's GraphAdj algorithm and returns the result.
 
skeletonoperator= (const skeleton &)
 Assignment operator; empties current set & copies from other.
 
- Public Member Functions inherited from LP_Solver
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 bool makes_consistent_constraint (const Monomial &t, const Monomial &u, bool show_data=false)
 tests for consistency of a constraint generated by two monomials.
 

Friends

I/O
ostream & operator<< (ostream &, const skeleton &)
 prints out the constraints, then the rays, then the edges.
 

Additional Inherited Members

- Protected Attributes inherited from LP_Solver
set< rayrays
 

Detailed Description

skeleton of a polyhedral cone, with methods allowing definition and refinement

Author
John Perry
Version
1.1
Date
October 2014

This class implements the Double Description Method, an iterative algorithm for computing the skeleton of a cone. This particular version uses Zolotykh's GraphAdj criterion [5]. The iterative nature means that the cone can be updated with new constraints, passed to that algorithm, and the skeleton will be automatically recomputed.

Definition at line 169 of file skeleton.hpp.

Constructor & Destructor Documentation

◆ skeleton() [1/2]

skeleton::skeleton ( NVAR_TYPE  dimension)

Constructs a basic skeleton in the given number of dimensions, initialized to the axes, or (equivalently) to the set of constraints \( x_i \geq 0 \).

The rays are informed of their active constraints.

Precondition
the argument should be at least two
Postcondition
the skeleton of the positive orthant

Definition at line 102 of file skeleton.cpp.

◆ skeleton() [2/2]

skeleton::skeleton ( NVAR_TYPE  dimension,
vector< constraint > &  constraints 
)

Constructs a skeleton described by the given system of constraints.

Practically speaking, it first generates a basic skeleton, then iterates on the given constraints.

Precondition
u.size() == v.size() for all u, v in the vector
Postcondition
unless the system supplied was inconsistent, a valid skeleton of the corresponding polyhedral cone
Warning
Your program will almost certainly fail if you do not respect the precondition.

Definition at line 107 of file skeleton.cpp.

Member Function Documentation

◆ copy()

bool skeleton::copy ( const LP_Solver )
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.)

Implements LP_Solver.

Definition at line 123 of file skeleton.cpp.

◆ solve() [1/2]

bool skeleton::solve ( vector< constraint > &  new_constraints)
virtual

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

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.

Implements LP_Solver.

Definition at line 246 of file skeleton.cpp.

◆ solve() [2/2]

bool skeleton::solve ( constraint constraint)
virtual

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

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.

Implements LP_Solver.

Definition at line 138 of file skeleton.cpp.


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