Gröbner basis project
Codebase for research into Gröbner basis computation
|
a constraint \( c_1 x_1 + \ldots + c_n x_n \geq 0 \) More...
#include <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... | |
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 36 of file lp_solver.hpp.
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 6 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 14 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 94 of file lp_solver.cpp.
|
friend |
check for constraint inequality
|
friend |
check for constraint inequality
Definition at line 54 of file lp_solver.cpp.
|
friend |
Lexicographic comparison of constraints.
Definition at line 31 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 64 of file lp_solver.cpp.
|
friend |
check for constraint equality
Definition at line 44 of file lp_solver.cpp.