![]() |
aGrUM
0.20.3
a C++ library for (probabilistic) graphical models
|
Class representing a linear expression. More...
#include <agrum/CN/LpInterface.h>
Public Member Functions | |
void | clear () |
Clear all data of the calling expression as if it was constructed. More... | |
std::string | toString () const |
Get the string representation of a calling expression. More... | |
template<typename SCALAR > | |
INLINE LpExpr | multiply (const SCALAR &lhs, const LpCol &rhs) |
template<typename T1 , typename T2 > | |
INLINE LpExpr | lessThan (T1 &&lhs, T2 &&rhs) |
Constructors / Destructors | |
LpExpr () | |
Default constructor. More... | |
LpExpr (const LpExpr &expr) | |
Copy constructor. More... | |
LpExpr (const LpExpr &expr, bool copyLeft, bool copyMiddle, bool copyRight) | |
Copy constructor. More... | |
LpExpr (LpExpr &&expr) | |
Move copy constructor from temporary. More... | |
LpExpr (LpExpr &&expr, bool copyLeft, bool copyMiddle, bool copyRight) | |
Move copy constructor from temporary. More... | |
~LpExpr () | |
Default destructor. More... | |
Assignment operators = | |
LpExpr & | operator= (const LpCol &rhs) |
Assignment operator = with a variable. More... | |
LpExpr & | operator= (const LpExpr &rhs) |
Assignment operator = with another expression, by copy. More... | |
LpExpr & | operator= (LpExpr &&rhs) |
Assignment operator = with another expression, by move. More... | |
template<typename SCALAR > | |
LpExpr & | operator= (const SCALAR &rhs) |
Assignment operator = with a scalar. More... | |
Compound assignment operators += | |
LpExpr & | operator+= (const LpCol &rhs) |
Compound assignment operator += with a variable. More... | |
LpExpr & | operator+= (const LpExpr &rhs) |
Compound assignment operator += with another expression. More... | |
LpExpr & | operator+= (LpExpr &&rhs) |
Compound assignment operator += with another temporary expression. More... | |
template<typename T > | |
LpExpr & | operator+= (const T &rhs) |
Compound assignment operator += with a scalar. More... | |
Compound assignment operators -= | |
LpExpr & | operator-= (const LpCol &rhs) |
Compound assignment operator -= with a variable. More... | |
LpExpr & | operator-= (const LpExpr &rhs) |
Compound assignment operator -= with another expression. More... | |
template<typename T > | |
LpExpr & | operator-= (const T &rhs) |
Compound assignment operator -= with a salar. More... | |
Static Public Member Functions | |
Helper static methods for operations | |
template<typename T1 , typename T2 > | |
static LpExpr | lessThan (T1 &&lhs, T2 &&rhs) |
template<typename SCALAR > | |
static LpExpr | multiply (const SCALAR &lhs, const LpCol &rhs) |
Friends | |
class | LpRow |
template<typename GUM_SCALAR > | |
class | LpInterface |
Class representing a linear expression.
Definition at line 208 of file LpInterface.h.
gum::credal::lp::LpExpr::LpExpr | ( | ) |
Default constructor.
class LpExpr
Definition at line 63 of file LpInterface.cpp.
gum::credal::lp::LpExpr::LpExpr | ( | const LpExpr & | expr | ) |
Copy constructor.
expr | The constant reference to the expression to copy. |
Definition at line 70 of file LpInterface.cpp.
gum::credal::lp::LpExpr::LpExpr | ( | const LpExpr & | expr, |
bool | copyLeft, | ||
bool | copyMiddle, | ||
bool | copyRight | ||
) |
Copy constructor.
Makes a ( partial ) copy.
expr | The constant reference to the expression to copy. |
copyLeft | True if we want to copy left side of expr , False otherwise. |
copyMiddle | True if we want to copy middle side of expr , False otherwise. |
copyRight | True if we want to copy right side of expr , False otherwise. |
Definition at line 79 of file LpInterface.cpp.
gum::credal::lp::LpExpr::LpExpr | ( | LpExpr && | expr | ) |
Move copy constructor from temporary.
Swap ressources between the temporary expr
and the caller instead of copying the temporary.
expr | The temporary expression to move to this. |
Definition at line 106 of file LpInterface.cpp.
Move copy constructor from temporary.
Makes ( partial ) moves.
expr | The temporary expression to ( partially ) move to this. |
copyLeft | True if we want to copy left side of expr , False otherwise. |
copyMiddle | True if we want to copy middle side of expr , False otherwise. |
copyRight | True if we want to copy right side of expr , False otherwise. |
Definition at line 117 of file LpInterface.cpp.
gum::credal::lp::LpExpr::~LpExpr | ( | ) |
Default destructor.
Definition at line 144 of file LpInterface.cpp.
|
private |
Set the side of the calling expression, from LEFT TO RIGHT : L <= M <= R.
from | the constant reference to the variable ( the side ) to put on the first empty side met, starting at left. |
Definition at line 275 of file LpInterface.cpp.
|
private |
Copy an expression to a side of the calling expression, from LEFT TO RIGHT : L <= M <= R.
from | the constant reference to the expression ( the side ) to copy on the first empty side met, starting at left. |
Definition at line 291 of file LpInterface.cpp.
|
private |
Move an expression to a side of the calling expression, from LEFT TO RIGHT : L <= M <= R.
from | the expression ( the side ) to move on the first empty side met, starting at left. |
Definition at line 372 of file LpInterface.cpp.
|
private |
Set the side of the calling expression, from LEFT TO RIGHT : L <= M <= R.
SCALAR | A scalar type ( integer or float ( any precision ) ). |
from | the constant reference to the scalar ( the side ) to put on the first empty side met, starting at left. |
Definition at line 66 of file LpInterface_tpl.h.
void gum::credal::lp::LpExpr::clear | ( | ) |
Clear all data of the calling expression as if it was constructed.
Definition at line 462 of file LpInterface.cpp.
|
static |
INLINE LpExpr gum::credal::lp::LpExpr::lessThan | ( | T1 && | lhs, |
T2 && | rhs | ||
) |
Definition at line 490 of file LpInterface_tpl.h.
|
static |
INLINE LpExpr gum::credal::lp::LpExpr::multiply | ( | const SCALAR & | lhs, |
const LpCol & | rhs | ||
) |
Definition at line 471 of file LpInterface_tpl.h.
Compound assignment operator +=
with a variable.
rhs | the constant reference to the variable to add to the calling expression. |
Definition at line 200 of file LpInterface.cpp.
Compound assignment operator +=
with another expression.
rhs | the constant reference to the expression to add to the calling expression. |
Definition at line 211 of file LpInterface.cpp.
Compound assignment operator +=
with another temporary expression.
rhs | the temporary expression to add to the calling expression. |
Definition at line 227 of file LpInterface.cpp.
LpExpr & gum::credal::lp::LpExpr::operator+= | ( | const T & | rhs | ) |
Compound assignment operator +=
with a scalar.
SCALAR | A scalar type ( integer or float ( any precision ) ). |
rhs | the constant reference to the scalar to add to the calling expression. |
Definition at line 42 of file LpInterface_tpl.h.
Compound assignment operator -=
with a variable.
rhs | the constant reference to the variable to substract from the calling expression. |
Definition at line 248 of file LpInterface.cpp.
Compound assignment operator -=
with another expression.
rhs | the constant reference to the expression to substract from the calling expression. |
Definition at line 259 of file LpInterface.cpp.
LpExpr & gum::credal::lp::LpExpr::operator-= | ( | const T & | rhs | ) |
Compound assignment operator -=
with a salar.
SCALAR | A scalar type ( integer or float ( any precision ) ). |
rhs | the constant reference to the scalar to substract from the calling expression. |
Definition at line 54 of file LpInterface_tpl.h.
Assignment operator =
with a variable.
rhs | the constant reference to the variable to form an expression with. |
Definition at line 152 of file LpInterface.cpp.
Assignment operator =
with another expression, by copy.
rhs | the constant reference to the expression to copy. |
Definition at line 161 of file LpInterface.cpp.
Assignment operator =
with another expression, by move.
rhs | the expression to move to this. |
Definition at line 180 of file LpInterface.cpp.
LpExpr & gum::credal::lp::LpExpr::operator= | ( | const SCALAR & | rhs | ) |
Assignment operator =
with a scalar.
class LpExpr
SCALAR | A scalar type ( integer or float ( any precision ) ). |
rhs | the constant reference to the scalar to form an expression with. |
Definition at line 32 of file LpInterface_tpl.h.
std::string gum::credal::lp::LpExpr::toString | ( | ) | const |
Get the string representation of a calling expression.
Definition at line 476 of file LpInterface.cpp.
|
friend |
Definition at line 211 of file LpInterface.h.
|
friend |
Definition at line 209 of file LpInterface.h.
|
private |
True
if this expression has a non-empty left side L : L <= M <= R .
False
otherwise.
Definition at line 413 of file LpInterface.h.
|
private |
True
if this expression has a non-empty middle side M ( the default ) : L <= M <= R .
False
otherwise.
Definition at line 417 of file LpInterface.h.
|
private |
True
if this expression has a non-empty right side R : L <= M <= R .
False
otherwise.
Definition at line 421 of file LpInterface.h.
The coefficients of each variable on the left side L : L <= M <= R.
If a variable is not present, it's coefficient is 0.
Definition at line 433 of file LpInterface.h.
|
private |
The constant on the left side L : L <= M <= R.
Definition at line 424 of file LpInterface.h.
The coefficients of each variable on the middle side L : L <= M <= R.
If a variable is not present, it's coefficient is 0.
Definition at line 437 of file LpInterface.h.
|
private |
The constant on the middle side L : L <= M <= R.
Definition at line 426 of file LpInterface.h.
The coefficients of each variable on the right side L : L <= M <= R.
If a variable is not present, it's coefficient is 0.
Definition at line 441 of file LpInterface.h.
|
private |
The constant on the right side L : L <= M <= R.
Definition at line 428 of file LpInterface.h.