Gröbner basis project
Codebase for research into Gröbner basis computation
|
classes that solve constrained linear systems More...
Classes | |
class | constraint |
a constraint \( c_1 x_1 + \ldots + c_n x_n \geq 0 \) More... | |
class | edge |
an edge \((r_1,r_2)\) connecting the two rays \( r_1 \) and \( r_2 \) More... | |
class | GLPK_Solver |
approximate skeleton of a polyhedral cone, using GLPK linear solver More... | |
class | LP_Solver |
exact or approximate polyhedral cone solution, with methods allowing definition and refinement More... | |
class | PPL_Solver |
approximate skeleton of a polyhedral cone, using PPL linear solver More... | |
class | ray |
a ray defined by nonnegative coordinates \((a_1,\ldots,a_n)\) More... | |
class | skeleton |
skeleton of a polyhedral cone, with methods allowing definition and refinement More... | |
Functions | |
vector< bool > | intersections_of_active_constraints (bool *, bool *, unsigned) |
bool | is_first_subset_of_second (bool *, bool *, unsigned) |
int | number_of_common_constraints (bool *, bool *, unsigned) |
ray | operator* (RAYENT_TYPE, ray &) |
Multiply every coordinate in the given ray by the given scalar. More... | |
RAYENT_TYPE | operator* (const ray &, const ray &) |
Compute the dot product on the rays. More... | |
DOTPROD_TYPE | operator* (const ray &r, const constraint &c) |
Compute the dot product between the ray and the constraint. More... | |
DOTPROD_TYPE | operator* (constraint &c, ray &r) |
Compute the dot product between the ray and the constraint. More... | |
ray | operator+ (ray &, ray &) |
Add the two rays. More... | |
ray | operator- (const ray &, const ray &) |
Subtract the two rays. More... | |
ray | ray_sum (const set< ray > &) |
Add all the rays in a set. More... | |
set< edge > | union_of_edge_sets (const set< edge > &, const set< edge > &) |
classes that solve constrained linear systems
Classes in this group solve constrained linear systems; that is, they solve systems of the form \(\left\{\sum_{j=1}^na_{ij}x_j\leq b_i\right\}_{i=1}^m\) (where the inequality may or may not be strict).
class constraint |
a constraint \( c_1 x_1 + \ldots + c_n x_n \geq 0 \)
This class encapsulates a simple constraint for a skeleton; that is, an inequality of the form \( c_1 x_1 + \ldots + c_n x_n \geq 0 \). Constraints can be ordered lexicographically using the less-than operator, allowing for their inclusion in ordered collections, such as sets.
Definition at line 53 of file lp_solver.hpp.
Public Member Functions | |
Construction | |
constraint (NVAR_TYPE, CONSTR_TYPE []) | |
Initialize constraint to the given coefficients. More... | |
constraint (vector< CONSTR_TYPE > &) | |
Initialize constraint to the given coefficients. More... | |
constraint (const constraint &) | |
Copies the coefficients of the other constraint, including the allocation of new memory. | |
Destruction | |
~constraint () | |
Deletes memory allocated by the constructor. More... | |
Friends | |
I/O | |
ostream & | operator<< (ostream &, const constraint &) |
print a representation of the constraint to the stream More... | |
Basic properties | |
NVAR_TYPE | get_number_of_variables () const |
Returns the number of variables in the constraint. | |
CONSTR_TYPE | operator[] (NVAR_TYPE index) const |
Returns the coefficient indicated. Numbering starts at 0. | |
const CONSTR_TYPE * | coeffs () const |
Returns the coefficients that determine this constraints. | |
bool | operator< (const constraint &a, const constraint &b) |
Lexicographic comparison of constraints. More... | |
bool | operator== (const constraint &a, const constraint &b) |
check for constraint equality More... | |
bool | operator!= (const constraint &a, const constraint &b) |
check for constraint inequality More... | |
bool | operator!= (constraint &a, constraint &b) |
check for constraint inequality More... | |
constraint::constraint | ( | NVAR_TYPE | num_variables, |
CONSTR_TYPE | coeffs[] | ||
) |
Initialize constraint to the given coefficients.
The resulting constraint is \( c_1x_1 + \cdots + c_nx_n \geq 0, \) where \( c_i \) is the coefficient of \( x_i \).
num_variables | length of coeffs |
coeffs | copies this array of coefficients |
Definition at line 23 of file lp_solver.cpp.
constraint::constraint | ( | vector< CONSTR_TYPE > & | coeffs | ) |
Initialize constraint to the given coefficients.
The resulting constraint is \( c_1x_1 + \cdots + c_nx_n \geq 0, \) where \( c_i \) is the coefficient of \( x_i \).
coeffs | copies thiis vector of coefficients |
nvars
will have the value equal to coeffs.size()
Definition at line 31 of file lp_solver.cpp.
constraint::~constraint | ( | ) |
Deletes memory allocated by the constructor.
Currently, that means it deletes an array created by the constructors.
Definition at line 111 of file lp_solver.cpp.
|
friend |
check for constraint inequality
a | a constraint |
b | a constraint |
|
friend |
check for constraint inequality
a | a constraint |
b | a constraint |
Definition at line 71 of file lp_solver.cpp.
|
friend |
Lexicographic comparison of constraints.
a | a constraint |
b | a constraint |
Definition at line 48 of file lp_solver.cpp.
|
friend |
print a representation of the constraint to the stream
Output is of the form \( c_1 x_1 + \ldots + c_n x_n \) , where \( c_i \) is the coefficient of \( x_i \).
Definition at line 81 of file lp_solver.cpp.
|
friend |
check for constraint equality
a | a constraint |
b | a constraint |
Definition at line 61 of file lp_solver.cpp.
class edge |
an edge \((r_1,r_2)\) connecting the two rays \( r_1 \) and \( r_2 \)
This class encapsulates an edge, the other major part of a skeleton. Edges describe how the rays of the skeleton are connected. Edges are ordered, so that the smaller ray always comes first.
Definition at line 58 of file skeleton.hpp.
Public Member Functions | |
Construction | |
edge (const ray &, const ray &) | |
Creates a new edge that joins the two rays. | |
edge (const edge &) | |
Copies the rays in other to two new rays. | |
Destruction | |
~edge () | |
Basic properties | |
ray | get_first_ray () const |
Returns the first ray listed in this edge. | |
ray | get_second_ray () const |
Returns the second ray listed in this edge. | |
Modification | |
edge & | operator= (const edge &) |
Assignment operator. | |
Friends | |
Comparison | |
bool | operator== (const edge &e1, const edge &e2) |
Equal if and only if. More... | |
bool | operator< (const edge &, const edge &) |
Compares two edges lexicographically. More... | |
I/O | |
ostream & | operator<< (ostream &, const edge &) |
Output has the form \( \{ \mathbf{r}_1, \mathbf{r}_2 \} \) where \( \mathbf{r}_1 \) is the first ray in this edge, etc. | |
|
inline |
Does nothing beyond what the compiler would do.
Definition at line 76 of file skeleton.hpp.
Compares two edges lexicographically.
If the first ray in this
edge is smaller, then this
edge is smaller. Otherwise, if the first rays are equal, and the second ray in this
edge is smaller, then this
edge is smaller.
Definition at line 58 of file skeleton.cpp.
Equal if and only if.
e1 | an edge |
e2 | an edge |
true
if and only if the linked rays are identical Definition at line 100 of file skeleton.hpp.
class GLPK_Solver |
approximate skeleton of a polyhedral cone, using GLPK linear solver
This class serves as an interface to GLPK [8], which we can use to find an approximate skeleton to a polyhedral cone.
Definition at line 37 of file glpk_solver.hpp.
Public Member Functions | |
Construction | |
GLPK_Solver (NVAR_TYPE n) | |
initializes solver for \( n \) variables | |
GLPK_Solver (const GLPK_Solver &) | |
copy constructor (deep copy) | |
virtual bool | copy (const LP_Solver *) |
performs a deep copy, similar to a copy constructor More... | |
Destruction | |
virtual | ~GLPK_Solver () |
Basic properties | |
virtual NVAR_TYPE | get_dimension () const |
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 () |
Modification | |
virtual bool | solve (constraint &) |
Adds the indicated constraint (singular!) and re-computes the solution. More... | |
virtual bool | solve (vector< constraint > &) |
Adds the indicated constraints (plural!) and re-computes the solution. More... | |
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. | |
![]() | |
virtual | ~LP_Solver () |
the default destructor does nothing (this is an abstract class) | |
Additional Inherited Members | |
![]() | |
set< ray > | rays |
|
virtual |
performs a deep copy, similar to a copy constructor
true
iff copying was successful Implements LP_Solver.
Definition at line 58 of file glpk_solver.cpp.
|
virtual |
Adds the indicated constraint (singular!) and re-computes the solution.
true
if and only if the new constraint is consistent with the current constraintsfalse
, 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 116 of file glpk_solver.cpp.
|
virtual |
Adds the indicated constraints (plural!) and re-computes the solution.
true
if and only if the new constraints are consistent with the current constraintsfalse
, 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 85 of file glpk_solver.cpp.
class LP_Solver |
exact or approximate polyhedral cone solution, with methods allowing definition and refinement
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 \).
true
; for if it is not, then the cone is no longer be consistent. Please read the relevant documentation. Definition at line 504 of file lp_solver.hpp.
Public Member Functions | |
Construction | |
virtual bool | copy (const LP_Solver *)=0 |
performs a deep copy, similar to a copy constructor More... | |
Destruction | |
virtual | ~LP_Solver () |
the default destructor does nothing (this is an abstract class) | |
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< ray > | rays |
|
pure virtual |
performs a deep copy, similar to a copy constructor
true
iff copying was successful Implemented in skeleton, PPL_Solver, and GLPK_Solver.
|
pure virtual |
Adds the indicated constraint (singular!) and re-computes the solution.
true
if and only if the new constraint is consistent with the current constraintsfalse
, 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.
|
pure virtual |
Adds the indicated constraints (plural!) and re-computes the solution.
true
if and only if the new constraints are consistent with the current constraintsfalse
, 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.
|
protected |
the skeleton (may be approximate, depending on solver)
Definition at line 602 of file lp_solver.hpp.
class PPL_Solver |
approximate skeleton of a polyhedral cone, using PPL linear solver
This class serves as an interface to PPL [1], which we can use to find the skeleton to a polyhedral cone.
Definition at line 38 of file ppl_solver.hpp.
Public Member Functions | |
Construction | |
PPL_Solver (NVAR_TYPE n) | |
initializes solver for \( n \) variables | |
PPL_Solver (const PPL_Solver &) | |
copy constructor (deep copy) | |
virtual bool | copy (const LP_Solver *) |
performs a deep copy, similar to a copy constructor More... | |
Destruction | |
virtual | ~PPL_Solver () |
Basic properties | |
virtual NVAR_TYPE | get_dimension () const |
Returns the dimension of the underlying vector space. | |
virtual unsigned long | get_number_of_constraints () |
Modification | |
virtual bool | solve (constraint &) |
Adds the indicated constraint (singular!) and re-computes the solution. More... | |
virtual bool | solve (vector< constraint > &) |
Adds the indicated constraints (plural!) and re-computes the solution. More... | |
virtual void | setup_rays () |
clear the current set of rays and extracts the ones contained in lp | |
![]() | |
virtual | ~LP_Solver () |
the default destructor does nothing (this is an abstract class) | |
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. | |
Protected Attributes | |
PPL::NNC_Polyhedron * | lp |
PPL problem interface. | |
unsigned | m |
number of constraints | |
NVAR_TYPE | n |
number of variables | |
RAYENT_TYPE * | ray_data |
used to retrieve rays | |
PPL::Variable ** | X |
array of variables | |
![]() | |
set< ray > | rays |
Static Protected Attributes | |
static unsigned | instances = 0 |
number of PPL instances | |
|
virtual |
performs a deep copy, similar to a copy constructor
true
iff copying was successful Implements LP_Solver.
Definition at line 82 of file ppl_solver.cpp.
|
virtual |
Adds the indicated constraint (singular!) and re-computes the solution.
true
if and only if the new constraint is consistent with the current constraintsfalse
, 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 113 of file ppl_solver.cpp.
|
virtual |
Adds the indicated constraints (plural!) and re-computes the solution.
true
if and only if the new constraints are consistent with the current constraintsfalse
, 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 125 of file ppl_solver.cpp.
class ray |
a ray defined by nonnegative coordinates \((a_1,\ldots,a_n)\)
This class encapsulates a ray, one major part of the definition of a skeleton. Rays can be initialized to a particular set of coefficients, or to a particular axis (which is then translated into the corresponding coefficients).
A special feature is that a rays can track the constraints known to be active at the ray, allowing for more efficient computation in the double description method. Adding known constraints can be done with or without checking whether the constraint actually is active, so this should be done with care.
Definition at line 190 of file lp_solver.hpp.
Public Member Functions | |
Construction | |
ray (NVAR_TYPE, long=-1) | |
Creates a ray with the given number of variables, all set to 0. More... | |
ray (NVAR_TYPE, const RAYENT_TYPE []) | |
Creates a ray with the given number of variables, with coordinates set to the value of the array. More... | |
ray (NVAR_TYPE, const EXP_TYPE []) | |
Creates a ray with the given number of variables, with coordinates set to the value of the array. More... | |
ray (const vector< RAYENT_TYPE > &) | |
Creates a ray whose coordinates are given by the vector. More... | |
ray (const ray &) | |
Copies the coordinates of the other ray. More... | |
Destruction | |
~ray () | |
Deletes memory allocated by the constructor. More... | |
Basic properies | |
NVAR_TYPE | get_dimension () const |
Returns the dimension of this ray. | |
RAYENT_TYPE | operator[] (NVAR_TYPE index) const |
Returns the entry indicated. Numbering starts at 0. | |
const RAYENT_TYPE * | weights () const |
Returns the weights. | |
const RAYENT_TYPE | coordinate (NVAR_TYPE index) |
Synonym for []. I have no idea why I added this. | |
bool | is_active_at (const constraint &hyperplane) const |
Returns true if and only if the hyperplane is active at this ray. More... | |
bool | is_above (constraint &hyperplane) |
Returns true if and only if this ray is above the hyperplane. More... | |
bool | is_below (constraint &hyperplane) |
Returns true if and only if this ray is below the hyperplane. More... | |
Computation | |
DOTPROD_TYPE | obtain_dot_product (const constraint &) const |
Convenience function to compute dot product between ray and the given constraint. More... | |
Modification | |
void | simplify_ray () |
Simplifies the ray by dividing its components by the least common denominator. | |
ray & | operator= (const ray &) |
Assignment operator; assigns the value of other to this . More... | |
void | swap (ray &) |
Swap two rays of equal dimension by swapping their data, avoiding memory reallocation. More... | |
Friends | |
Comparison | |
bool | operator== (const ray &, const ray &) |
Indicates whether the two rays are equal. More... | |
bool | operator!= (const ray &, const ray &) |
Indicates whether the two rays are unequal. More... | |
bool | operator!= (ray &r, ray &s) |
Indicates whether the two rays are unequal. More... | |
bool | operator== (const ray &, const ray &) |
Returns true if and only if the coordinates of the two rays are equal. More... | |
bool | operator< (const ray &, const ray &) |
Lexicographic comparison of rays. More... | |
I/O | |
ostream & | operator<< (ostream &, const ray &) |
Output is of the form \((r_1, \ldots, r_n)\). | |
ray::ray | ( | NVAR_TYPE | dimension, |
long | direction = -1 |
||
) |
Creates a ray with the given number of variables, all set to 0.
The optional second argument specifies a direction, and sets that coordinate to 1. In this case, there is no need to set the ray's known active constraints, as this is known and populated automatically.
Definition at line 132 of file lp_solver.cpp.
ray::ray | ( | NVAR_TYPE | dimension, |
const RAYENT_TYPE | entries[] | ||
) |
Creates a ray with the given number of variables, with coordinates set to the value of the array.
Definition at line 143 of file lp_solver.cpp.
ray::ray | ( | NVAR_TYPE | dimension, |
const EXP_TYPE | entries[] | ||
) |
Creates a ray with the given number of variables, with coordinates set to the value of the array.
Definition at line 152 of file lp_solver.cpp.
ray::ray | ( | const vector< RAYENT_TYPE > & | entries | ) |
Creates a ray whose coordinates are given by the vector.
Definition at line 161 of file lp_solver.cpp.
ray::ray | ( | const ray & | old_ray | ) |
Copies the coordinates of the other ray.
Allocates new memory, and copies the active constraints.
Definition at line 170 of file lp_solver.cpp.
ray::~ray | ( | ) |
Deletes memory allocated by the constructor.
Currently, that means it deletes coords
.
Definition at line 180 of file lp_solver.cpp.
|
inline |
Returns true
if and only if this ray is above the hyperplane.
hyperplane | a constraint; we would like to know whether this is above it |
this
is above constraint
Practically speaking, if the hyperplane is defined by the vector \( \mathbf c \) and the ray is defined by \( \mathbf r \) , this function returns true if and only if \( c\cdot r > 0 \).
Definition at line 293 of file lp_solver.hpp.
|
inline |
Returns true
if and only if the hyperplane is active at this ray.
hyperplane | a constraint; we would like to know whether this lies on it |
this
lies on constraint
Practically speaking, if the hyperplane is defined by the vector \( \mathbf c \) and the ray is defined by \( \mathbf r \) , this function returns true if and only if \( c\cdot r = 0 \).
Definition at line 279 of file lp_solver.hpp.
|
inline |
Returns true
if and only if this ray is below the hyperplane.
hyperplane | a constraint; we would like to know whether this is below it |
this
is below constraint
Practically speaking, if the hyperplane is defined by the vector \( \mathbf c \) and the ray is defined by \( \mathbf r \) , this function returns true if and only if \( c\cdot r < 0 \).
Definition at line 307 of file lp_solver.hpp.
DOTPROD_TYPE ray::obtain_dot_product | ( | const constraint & | hyperplane | ) | const |
Convenience function to compute dot product between ray and the given constraint.
this
and constraint
Definition at line 212 of file lp_solver.cpp.
Assignment operator; assigns the value of other
to this
.
this
Definition at line 330 of file lp_solver.cpp.
void ray::swap | ( | ray & | other | ) |
Swap two rays of equal dimension by swapping their data, avoiding memory reallocation.
Definition at line 350 of file lp_solver.cpp.
Indicates whether the two rays are unequal.
Definition at line 312 of file lp_solver.cpp.
Indicates whether the two rays are unequal.
r | a ray |
s | a ray |
Definition at line 337 of file lp_solver.hpp.
Lexicographic comparison of rays.
Definition at line 361 of file lp_solver.cpp.
Indicates whether the two rays are equal.
Definition at line 304 of file lp_solver.cpp.
Returns true
if and only if the coordinates of the two rays are equal.
Definition at line 304 of file lp_solver.cpp.
class skeleton |
skeleton of a polyhedral cone, with methods allowing definition and refinement
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 [11]. 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 178 of file skeleton.hpp.
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 | |
virtual | ~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< edge > | get_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< edge > | adjacencies_by_graphs (set< ray >) |
Re-computes the edges in the skeleton using Zolotych's GraphAdj algorithm and returns the result. | |
skeleton & | operator= (const skeleton &) |
Assignment operator; empties current set & copies from other. | |
![]() | |
virtual | ~LP_Solver () |
the default destructor does nothing (this is an abstract class) | |
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 | |
![]() | |
set< ray > | rays |
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.
Definition at line 119 of file skeleton.cpp.
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.
u.size() == v.size()
for all u
, v
in the vector Definition at line 124 of file skeleton.cpp.
|
virtual |
performs a deep copy, similar to a copy constructor
true
iff copying was successful Implements LP_Solver.
Definition at line 140 of file skeleton.cpp.
|
virtual |
Adds the indicated constraints (plural!) and re-computes the skeleton.
true
if and only if the new constraints are consistent with the current constraintsfalse
, 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 270 of file skeleton.cpp.
|
virtual |
Adds the indicated constraint (singular!) and re-computes the skeleton.
true
if and only if the new constraint is consistent with the current constraintsfalse
, 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 162 of file skeleton.cpp.
vector<bool> intersections_of_active_constraints | ( | bool * | , |
bool * | , | ||
unsigned | |||
) |
bool is_first_subset_of_second | ( | bool * | , |
bool * | , | ||
unsigned | |||
) |
true
if and only if the first set is a subset of the second. Definition at line 330 of file skeleton.cpp.
int number_of_common_constraints | ( | bool * | , |
bool * | , | ||
unsigned | |||
) |
Definition at line 297 of file skeleton.cpp.
Multiply every coordinate in the given ray by the given scalar.
Definition at line 222 of file lp_solver.cpp.
Compute the dot product on the rays.
Definition at line 235 of file lp_solver.cpp.
|
inline |
Compute the dot product between the ray and the constraint.
r | a ray |
c | a constraint |
Definition at line 465 of file lp_solver.hpp.
|
inline |
Compute the dot product between the ray and the constraint.
c | a constraint |
r | a ray |
Definition at line 477 of file lp_solver.hpp.
Add the two rays.
Definition at line 259 of file lp_solver.cpp.
Subtract the two rays.
Definition at line 270 of file lp_solver.cpp.
Add all the rays in a set.
Definition at line 281 of file lp_solver.cpp.
Definition at line 342 of file skeleton.cpp.