LP implementation using GLPK.
More...
#include <glp.hpp>
LP implementation using GLPK.
Definition at line 39 of file glp.hpp.
paal::lp::detail::glp_impl::glp_impl |
( |
| ) |
|
|
inline |
Constructor.
Definition at line 49 of file glp.hpp.
paal::lp::detail::glp_impl::~glp_impl |
( |
| ) |
|
|
inline |
Destructor.
Definition at line 62 of file glp.hpp.
col_id paal::lp::detail::glp_impl::add_column |
( |
double |
cost_coef, |
|
|
double |
lb, |
|
|
double |
ub |
|
) |
| |
|
inline |
Adds a new column to the LP.
- Parameters
-
cost_coef | coefficient of the column in the objective function |
lb | column lower bound value |
ub | column upper bound value |
- Returns
- column identifier
Definition at line 86 of file glp.hpp.
Adds a new row to the LP.
- Parameters
-
constraint | constraint being added |
- Returns
- row identifier
Definition at line 106 of file glp.hpp.
void paal::lp::detail::glp_impl::delete_col |
( |
col_id |
col | ) |
|
|
inline |
Removes a column form the LP.
- Parameters
-
col | ID of the column to be removed |
Definition at line 204 of file glp.hpp.
void paal::lp::detail::glp_impl::delete_row |
( |
row_id |
row | ) |
|
|
inline |
Removes a row form the LP.
- Parameters
-
row | ID of the row to be removed |
Definition at line 216 of file glp.hpp.
static void paal::lp::detail::glp_impl::free_env |
( |
| ) |
|
|
inlinestatic |
Frees GLPK resources, common for all LP instances. Should be called after all LP instances are destructed.
Definition at line 68 of file glp.hpp.
double paal::lp::detail::glp_impl::get_col_coef |
( |
col_id |
col | ) |
const |
|
inline |
Returns the column cost function coefficient.
Definition at line 265 of file glp.hpp.
double paal::lp::detail::glp_impl::get_col_lower_bound |
( |
col_id |
col | ) |
const |
|
inline |
Returns the column lower bound.
Definition at line 272 of file glp.hpp.
double paal::lp::detail::glp_impl::get_col_upper_bound |
( |
col_id |
col | ) |
const |
|
inline |
Returns the column upper bound.
Definition at line 279 of file glp.hpp.
double paal::lp::detail::glp_impl::get_col_value |
( |
col_id |
col | ) |
const |
|
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 258 of file glp.hpp.
double paal::lp::detail::glp_impl::get_obj_value |
( |
| ) |
const |
|
inline |
Returns the found objective function value. Should be called only after the LP has been solved and if it wasn't modified afterwards.
Definition at line 251 of file glp.hpp.
double paal::lp::detail::glp_impl::get_row_dual_value |
( |
row_id |
row | ) |
const |
|
inline |
Returns row dual value. Should be called only after the LP has been solved and if it wasn't modified afterwards.
Definition at line 288 of file glp.hpp.
Returns the expression of an existing row.
Definition at line 309 of file glp.hpp.
double paal::lp::detail::glp_impl::get_row_lower_bound |
( |
row_id |
row | ) |
const |
|
inline |
Returns the row lower bound.
Definition at line 295 of file glp.hpp.
double paal::lp::detail::glp_impl::get_row_upper_bound |
( |
row_id |
row | ) |
const |
|
inline |
Returns the row upper bound.
Definition at line 302 of file glp.hpp.
boost::iterator_range<RowsInColumnIterator> paal::lp::detail::glp_impl::get_rows_in_column |
( |
col_id |
col | ) |
const |
|
inline |
Returns the identifiers and coefficients of all rows in a given column, which constraint matrix coefficient is non-zero (as an iterator range).
Definition at line 324 of file glp.hpp.
Resolves the LP (starting from the previously found solution) using the primal simplex method.
- Parameters
-
type | simplex type (primal / dual) |
- Returns
- solution status
Definition at line 242 of file glp.hpp.
void paal::lp::detail::glp_impl::set_col_cost |
( |
col_id |
col, |
|
|
double |
cost_coef |
|
) |
| |
|
inline |
Sets the cost coefficient of an existing LP column.
- Parameters
-
col | column identifier |
cost_coef | new cost coefficient |
Definition at line 152 of file glp.hpp.
void paal::lp::detail::glp_impl::set_col_lower_bound |
( |
col_id |
col, |
|
|
double |
lb |
|
) |
| |
|
inline |
Sets the lower bound of an existing LP column.
- Parameters
-
col | column identifier |
lb | row lower bound value |
Definition at line 128 of file glp.hpp.
void paal::lp::detail::glp_impl::set_col_upper_bound |
( |
col_id |
col, |
|
|
double |
ub |
|
) |
| |
|
inline |
Sets the upper bound of an existing LP column.
- Parameters
-
col | column identifier |
ub | row upper bound value |
Definition at line 140 of file glp.hpp.
Sets the problem optimization type (min/max).
Definition at line 73 of file glp.hpp.
Sets the expression of an existing row.
- Parameters
-
row | row identifier |
expr | new expression |
Definition at line 186 of file glp.hpp.
void paal::lp::detail::glp_impl::set_row_lower_bound |
( |
row_id |
row, |
|
|
double |
lb |
|
) |
| |
|
inline |
Sets the lower bound of an existing LP row.
- Parameters
-
row | row identifier |
lb | row lower bound value |
Definition at line 162 of file glp.hpp.
void paal::lp::detail::glp_impl::set_row_upper_bound |
( |
row_id |
row, |
|
|
double |
ub |
|
) |
| |
|
inline |
Sets the upper bound of an existing LP row.
- Parameters
-
row | row identifier |
ub | row upper bound value |
Definition at line 174 of file glp.hpp.
Solves the LP using the primal simplex method.
- Parameters
-
type | simplex type (primal / dual) |
- Returns
- solution status
Definition at line 230 of file glp.hpp.
The documentation for this class was generated from the following file: