![]() |
aGrUM
0.20.3
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 86 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 93 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 104 of file LpInterface_tpl.h.
gum::credal::lp::LpInterface< GUM_SCALAR >::~LpInterface | ( | ) |
Default destructor.
Definition at line 112 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 160 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 169 of file LpInterface_tpl.h.
void gum::credal::lp::LpInterface< GUM_SCALAR >::addPositivity | ( | ) |
Add positivity constraints for all variables.
Definition at line 232 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 256 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 184 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 204 of file LpInterface_tpl.h.
void gum::credal::lp::LpInterface< GUM_SCALAR >::addSumIsOne | ( | ) |
Add sum of variables is 1 constraints.
Definition at line 242 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 334 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 352 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 310 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 121 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 143 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 284 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 315 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 154 of file LpInterface_tpl.h.
|
private |
Variables of the problem.
Definition at line 750 of file LpInterface.h.
|
private |
true
if addPositivity() has been called, false
otherwise.
Definition at line 754 of file LpInterface.h.
|
private |
Rows of the problem.
Definition at line 748 of file LpInterface.h.
|
private |
true
if addSumIsOne() has been called, false
otherwise.
Definition at line 757 of file LpInterface.h.