The common LP solvers base class. Responsible for: More...
#include <lp_base.hpp>
Public Types | |
using | RowIter = RowSet::const_iterator |
using | ColIter = ColSet::const_iterator |
Public Member Functions | |
lp_base (const std::string problem_name="", optimization_type opt_type=MINIMIZE) | |
void | set_lp_name (const std::string problem_name) |
col_id | add_column (double cost_coef=0, double lb=0., double ub=lp_traits::PLUS_INF, const std::string &name="") |
row_id | add_row (const double_bounded_expression &constraint=double_bounded_expression{}, const std::string &name="") |
int | columns_number () const |
int | rows_number () const |
std::string | get_col_name (col_id col) const |
std::string | get_row_name (row_id row) const |
ColIter | delete_col (ColIter col) |
void | delete_col (col_id col) |
RowIter | delete_row (RowIter row) |
void | delete_row (row_id row) |
void | clear () |
const ColSet & | get_columns () const |
const RowSet & | get_rows () const |
double | get_col_value (col_id col) const |
int | get_col_degree (col_id col) const |
int | get_row_degree (row_id row) const |
double | get_row_sum (row_id row) const |
Friends | |
template<typename ostream > | |
ostream & | operator<< (ostream &o, const lp_base< LP > &lp) |
The common LP solvers base class. Responsible for:
LP |
Definition at line 55 of file lp_base.hpp.
|
inline |
Constructor.
Definition at line 69 of file lp_base.hpp.
|
inline |
Adds a new column to the LP.
cost_coef | coefficient of the column in the objective function |
lb | column lower bound value |
ub | column upper bound value |
name | column symbolic name |
Definition at line 92 of file lp_base.hpp.
|
inline |
Adds a new row to the LP.
constraint | constraint being added |
name | row symbolic name |
Definition at line 109 of file lp_base.hpp.
|
inline |
Clears the LP instance.
Definition at line 199 of file lp_base.hpp.
|
inline |
Returns the number of columns in the instance.
Definition at line 121 of file lp_base.hpp.
|
inline |
Removes a column from the LP.
col | iterator of the column to be removed |
Definition at line 153 of file lp_base.hpp.
|
inline |
Removes a column from the LP.
col | ID of the column to be removed |
Definition at line 164 of file lp_base.hpp.
|
inline |
Removes a row form the LP.
row | iterator of the row to be removed |
Definition at line 178 of file lp_base.hpp.
|
inline |
Removes a row from the LP.
row | ID of the column to be removed |
Definition at line 189 of file lp_base.hpp.
|
inline |
Returns the number of non-zero coefficients in the given LP matrix column.
Definition at line 239 of file lp_base.hpp.
|
inline |
Returns the column symbolic name.
Definition at line 131 of file lp_base.hpp.
|
inline |
Returns column primal value. Should be called only after the LP has been solved and if it wasn't modified afterwards.
Definition at line 228 of file lp_base.hpp.
|
inline |
Returns all columns (as an iterator range).
Definition at line 216 of file lp_base.hpp.
|
inline |
Returns the number of non-zero coefficients in the given LP matrix row.
Definition at line 246 of file lp_base.hpp.
|
inline |
Returns the row symbolic name.
Definition at line 140 of file lp_base.hpp.
|
inline |
Returns the sum of the values of those columns multiplied by the coefficients in the given LP row.
Definition at line 255 of file lp_base.hpp.
|
inline |
Returns all rows (as an iterator range).
Definition at line 221 of file lp_base.hpp.
|
inline |
Returns the number of rows in the instance.
Definition at line 126 of file lp_base.hpp.
|
inline |
Sets the problem name.
Definition at line 78 of file lp_base.hpp.
|
friend |
Output stream operator for printing debug information.
Definition at line 265 of file lp_base.hpp.