All Classes Namespaces Files Functions Variables Typedefs Enumerations Friends Macros Pages
Public Types | Public Member Functions | Friends | List of all members
paal::lp::detail::lp_base< LP > Class Template Reference

The common LP solvers base class. Responsible for: More...

#include <lp_base.hpp>

Inheritance diagram for paal::lp::detail::lp_base< LP >:

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)
 

Detailed Description

template<typename LP>
class paal::lp::detail::lp_base< LP >

The common LP solvers base class. Responsible for:

Definition at line 55 of file lp_base.hpp.

Constructor & Destructor Documentation

template<typename LP >
paal::lp::detail::lp_base< LP >::lp_base ( const std::string  problem_name = "",
optimization_type  opt_type = MINIMIZE 
)
inline

Constructor.

Definition at line 69 of file lp_base.hpp.

Member Function Documentation

template<typename LP >
col_id paal::lp::detail::lp_base< LP >::add_column ( double  cost_coef = 0,
double  lb = 0.,
double  ub = lp_traits::PLUS_INF,
const std::string &  name = "" 
)
inline

Adds a new column to the LP.

Parameters
cost_coefcoefficient of the column in the objective function
lbcolumn lower bound value
ubcolumn upper bound value
namecolumn symbolic name
Returns
column identifier

Definition at line 92 of file lp_base.hpp.

template<typename LP >
row_id paal::lp::detail::lp_base< LP >::add_row ( const double_bounded_expression constraint = double_bounded_expression{},
const std::string &  name = "" 
)
inline

Adds a new row to the LP.

Parameters
constraintconstraint being added
namerow symbolic name
Returns
row identifier

Definition at line 109 of file lp_base.hpp.

template<typename LP >
void paal::lp::detail::lp_base< LP >::clear ( )
inline

Clears the LP instance.

Definition at line 199 of file lp_base.hpp.

template<typename LP >
int paal::lp::detail::lp_base< LP >::columns_number ( ) const
inline

Returns the number of columns in the instance.

Definition at line 121 of file lp_base.hpp.

template<typename LP >
ColIter paal::lp::detail::lp_base< LP >::delete_col ( ColIter  col)
inline

Removes a column from the LP.

Parameters
coliterator of the column to be removed
Returns
iterator following the removed column

Definition at line 153 of file lp_base.hpp.

template<typename LP >
void paal::lp::detail::lp_base< LP >::delete_col ( col_id  col)
inline

Removes a column from the LP.

Parameters
colID of the column to be removed

Definition at line 164 of file lp_base.hpp.

template<typename LP >
RowIter paal::lp::detail::lp_base< LP >::delete_row ( RowIter  row)
inline

Removes a row form the LP.

Parameters
rowiterator of the row to be removed
Returns
iterator following the removed row

Definition at line 178 of file lp_base.hpp.

template<typename LP >
void paal::lp::detail::lp_base< LP >::delete_row ( row_id  row)
inline

Removes a row from the LP.

Parameters
rowID of the column to be removed

Definition at line 189 of file lp_base.hpp.

template<typename LP >
int paal::lp::detail::lp_base< LP >::get_col_degree ( col_id  col) const
inline

Returns the number of non-zero coefficients in the given LP matrix column.

Definition at line 239 of file lp_base.hpp.

template<typename LP >
std::string paal::lp::detail::lp_base< LP >::get_col_name ( col_id  col) const
inline

Returns the column symbolic name.

Definition at line 131 of file lp_base.hpp.

template<typename LP >
double paal::lp::detail::lp_base< LP >::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 228 of file lp_base.hpp.

template<typename LP >
const ColSet& paal::lp::detail::lp_base< LP >::get_columns ( ) const
inline

Returns all columns (as an iterator range).

Definition at line 216 of file lp_base.hpp.

template<typename LP >
int paal::lp::detail::lp_base< LP >::get_row_degree ( row_id  row) const
inline

Returns the number of non-zero coefficients in the given LP matrix row.

Definition at line 246 of file lp_base.hpp.

template<typename LP >
std::string paal::lp::detail::lp_base< LP >::get_row_name ( row_id  row) const
inline

Returns the row symbolic name.

Definition at line 140 of file lp_base.hpp.

template<typename LP >
double paal::lp::detail::lp_base< LP >::get_row_sum ( row_id  row) const
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.

template<typename LP >
const RowSet& paal::lp::detail::lp_base< LP >::get_rows ( ) const
inline

Returns all rows (as an iterator range).

Definition at line 221 of file lp_base.hpp.

template<typename LP >
int paal::lp::detail::lp_base< LP >::rows_number ( ) const
inline

Returns the number of rows in the instance.

Definition at line 126 of file lp_base.hpp.

template<typename LP >
void paal::lp::detail::lp_base< LP >::set_lp_name ( const std::string  problem_name)
inline

Sets the problem name.

Definition at line 78 of file lp_base.hpp.

Friends And Related Function Documentation

template<typename LP >
template<typename ostream >
ostream& operator<< ( ostream &  o,
const lp_base< LP > &  lp 
)
friend

Output stream operator for printing debug information.

Definition at line 265 of file lp_base.hpp.


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