![]() |
aGrUM
0.20.2
a C++ library for (probabilistic) graphical models
|
Class representing a linear program. More...
#include <agrum/CN/LpInterface.h>
Public Member Functions | |
LpCol | addCol () |
Insert a new column, i.e. More... | |
std::vector< LpCol > | addCols (const unsigned int &cols) |
Insert new columns, i.e. More... | |
void | addRow (const LpExpr &expr) |
Add rows to the linear program according to a given expression ( which must be at least an inequality ). More... | |
void | addRow (LpExpr &&expr) |
Add rows to the linear program according to a given expression ( which must be at least an inequality ). More... | |
void | addPositivity () |
Add positivity constraints for all variables. More... | |
void | addSumIsOne () |
Add sum of variables is 1 constraints. More... | |
void | addProba () |
Add positivity constraints and sum of variables is 1 ( probability constraints ) More... | |
std::vector< std::vector< GUM_SCALAR > > | solve () |
Solve the linear program (H-representation of the polytope) by enumeration (of the polytope vertices) using lexicographic reverse search (lrs). More... | |
std::vector< LpCol > | getCols () const |
Get the variables of the LP. More... | |
std::string | toString () const |
Get the string representation of a calling linear program. More... | |
void | clear () |
Reset the rows (inequalities) and columns (variables) of the LP as if it was created. More... | |
void | clearRows () |
Reset the rows (inequalities) of the LP but not the columns (variables are kept). More... | |
Constructor / Destructor | |
LpInterface () | |
Default constructor, empty problem. More... | |
LpInterface (const LpInterface< GUM_SCALAR > &from) | |
Copy constructor. More... | |
LpInterface (LpInterface< GUM_SCALAR > &&from) | |
Move copy constructor. More... | |
~LpInterface () | |
Default destructor. More... | |
Compound assignment operator | |
LpInterface< GUM_SCALAR > & | operator= (const LpInterface< GUM_SCALAR > &from) |
Copy compound assignment. More... | |
LpInterface< GUM_SCALAR > & | operator= (LpInterface< GUM_SCALAR > &&from) |
Move coumpound assignment. More... | |
Friends | |
template<typename T > | |
std::ostream & | operator<< (std::ostream &out, const LpInterface< T > &lpi) |
Overload of << to use with output streams ( such as std::cout << ). More... | |
Class representing a linear program.
Definition at line 48 of file LpInterface.h.
gum::credal::lp::LpInterface< GUM_SCALAR >::LpInterface | ( | ) |
Default constructor, empty problem.
class LpInterface
Definition at line 88 of file LpInterface_tpl.h.
gum::credal::lp::LpInterface< GUM_SCALAR >::LpInterface | ( | const LpInterface< GUM_SCALAR > & | from | ) |
Copy constructor.
from | The LpInterface to be copied. |
Definition at line 95 of file LpInterface_tpl.h.
gum::credal::lp::LpInterface< GUM_SCALAR >::LpInterface | ( | LpInterface< GUM_SCALAR > && | from | ) |
Move copy constructor.
from | The temporary LpInterface to be moved. |
Definition at line 108 of file LpInterface_tpl.h.
gum::credal::lp::LpInterface< GUM_SCALAR >::~LpInterface | ( | ) |
Default destructor.
Definition at line 116 of file LpInterface_tpl.h.
LpCol gum::credal::lp::LpInterface< GUM_SCALAR >::addCol | ( | ) |
Insert a new column, i.e.
a new variable.
Definition at line 164 of file LpInterface_tpl.h.
std::vector< LpCol > gum::credal::lp::LpInterface< GUM_SCALAR >::addCols | ( | const unsigned int & | cols | ) |
Insert new columns, i.e.
new variables.
cols | the constant reference to the number of variables we want. |
Definition at line 174 of file LpInterface_tpl.h.
void gum::credal::lp::LpInterface< GUM_SCALAR >::addPositivity | ( | ) |
Add positivity constraints for all variables.
Definition at line 241 of file LpInterface_tpl.h.
void gum::credal::lp::LpInterface< GUM_SCALAR >::addProba | ( | ) |
Add positivity constraints and sum of variables is 1 ( probability constraints )
Definition at line 265 of file LpInterface_tpl.h.
void gum::credal::lp::LpInterface< GUM_SCALAR >::addRow | ( | const LpExpr & | expr | ) |
Add rows to the linear program according to a given expression ( which must be at least an inequality ).
expr | the constant reference to the expression to convert to rows. |
Definition at line 189 of file LpInterface_tpl.h.
void gum::credal::lp::LpInterface< GUM_SCALAR >::addRow | ( | LpExpr && | expr | ) |
Add rows to the linear program according to a given expression ( which must be at least an inequality ).
expr | the temporary expression to move to rows. |
Definition at line 211 of file LpInterface_tpl.h.
void gum::credal::lp::LpInterface< GUM_SCALAR >::addSumIsOne | ( | ) |
Add sum of variables is 1 constraints.
Definition at line 251 of file LpInterface_tpl.h.
void gum::credal::lp::LpInterface< GUM_SCALAR >::clear | ( | ) |
Reset the rows (inequalities) and columns (variables) of the LP as if it was created.
Definition at line 343 of file LpInterface_tpl.h.
void gum::credal::lp::LpInterface< GUM_SCALAR >::clearRows | ( | ) |
Reset the rows (inequalities) of the LP but not the columns (variables are kept).
Definition at line 361 of file LpInterface_tpl.h.
std::vector< LpCol > gum::credal::lp::LpInterface< GUM_SCALAR >::getCols | ( | ) | const |
Get the variables of the LP.
Definition at line 319 of file LpInterface_tpl.h.
LpInterface< GUM_SCALAR > & gum::credal::lp::LpInterface< GUM_SCALAR >::operator= | ( | const LpInterface< GUM_SCALAR > & | from | ) |
Copy compound assignment.
from | The LpInterface to be copied. |
Definition at line 124 of file LpInterface_tpl.h.
LpInterface< GUM_SCALAR > & gum::credal::lp::LpInterface< GUM_SCALAR >::operator= | ( | LpInterface< GUM_SCALAR > && | from | ) |
Move coumpound assignment.
from | The temporary LpInterface to be moved. |
Definition at line 147 of file LpInterface_tpl.h.
std::vector< std::vector< GUM_SCALAR > > gum::credal::lp::LpInterface< GUM_SCALAR >::solve | ( | ) |
Solve the linear program (H-representation of the polytope) by enumeration (of the polytope vertices) using lexicographic reverse search (lrs).
Only works with bounded polyhedron (polytopes) and not unbounded ones (i.e. defined by vertices and rays).
Definition at line 293 of file LpInterface_tpl.h.
std::string gum::credal::lp::LpInterface< GUM_SCALAR >::toString | ( | ) | const |
Get the string representation of a calling linear program.
Definition at line 324 of file LpInterface_tpl.h.
|
friend |
Overload of <<
to use with output streams ( such as std::cout << ).
out | the reference to the caller, i.e. left side of << . |
lpi | the constant reference to the linear program whose representation we want. |
Definition at line 158 of file LpInterface_tpl.h.
|
private |
Variables of the problem.
Definition at line 753 of file LpInterface.h.
|
private |
true
if addPositivity() has been called, false
otherwise.
Definition at line 757 of file LpInterface.h.
|
private |
Rows of the problem.
Definition at line 751 of file LpInterface.h.
|
private |
true
if addSumIsOne() has been called, false
otherwise.
Definition at line 760 of file LpInterface.h.