aGrUM  0.13.2
gum::credal::lp Namespace Reference

namespace for constraint-based description of credal sets More...

Classes

class  LpCol
 Class representing a variable ( a column ) of a linear program, i.e. More...
 
class  LpExpr
 Class representing a linear expression. More...
 
class  LpInterface
 Class representing a linear program. More...
 
class  LpRow
 Class representing a row of the linear program, i.e. More...
 

Functions

void swap (HashTable< LpCol, double > *&a, HashTable< LpCol, double > *&b)
 Swap the addresses of two pointers to hashTables. More...
 
std::ostream & operator<< (std::ostream &out, const LpCol &col)
 
std::ostream & operator<< (std::ostream &out, const LpExpr &expr)
 
std::ostream & operator<< (std::ostream &out, const LpRow &row)
 
template<typename T >
std::ostream & operator<< (std::ostream &out, const LpInterface< T > &lpi)
 
template<typename T2 >
LpExpr operator+ (const LpExpr &lhs, const T2 &rhs)
 
template<typename T2 >
LpExpr operator- (const LpExpr &lhs, const T2 &rhs)
 
Non-members operators +
template<typename T2 >
LpExpr operator+ (LpExpr &&lhs, const T2 &rhs)
 Overload of operator + between anything ( a scalar, a variable or an expression ) and anything except a temporary expression. More...
 
template<typename T2 >
LpExpr operator+ (LpExpr &lhs, const T2 &rhs)
 Overload of operator + between anything ( a scalar, a variable or an expression ) and anything except a temporary expression. More...
 
template<typename T1 , forbidden_type< T1, LpExpr > = 0>
LpExpr operator+ (const T1 &lhs, LpExpr &&rhs)
 Overload of operator + between anything ( a scalar, a variable or an expression ) and a temporary expression. More...
 
template<typename T1 , forbidden_type< T1, LpExpr > = 0>
LpExpr operator+ (const T1 &lhs, LpExpr &rhs)
 Overload of operator + between anything ( a scalar, a variable or an expression ) and anything except a temporary expression. More...
 
template<typename T2 , forbidden_type< T2, LpExpr > = 0>
LpExpr operator+ (const LpCol &lhs, const T2 &rhs)
 operator+ between LpCol lhs and not LpExpr rhs More...
 
template<typename T1 , forbidden_type< T1, LpExpr > = 0, forbidden_type< T1, LpCol > = 0>
LpExpr operator+ (const T1 &lhs, const LpCol &rhs)
 operator+ between neither LpExpr nor LpCol lhs and LpCol rhs More...
 
Non-members operators -
template<typename T2 >
LpExpr operator- (LpExpr &&lhs, const T2 &rhs)
 Overload of operator - between anything ( a scalar, a variable or an expression ) and anything except a temporary expression. More...
 
template<typename T2 >
LpExpr operator- (LpExpr &lhs, const T2 &rhs)
 Overload of operator - between anything ( a scalar, a variable or an expression ) and anything except a temporary expression. More...
 
template<typename T1 , forbidden_type< T1, LpExpr > = 0>
LpExpr operator- (const T1 &lhs, LpExpr &&rhs)
 Overload of operator - between anything ( a scalar, a variable or an expression ) and a temporary expression. More...
 
template<typename T1 , forbidden_type< T1, LpExpr > = 0>
LpExpr operator- (const T1 &lhs, LpExpr &rhs)
 Overload of operator - between anything ( a scalar, a variable or an expression ) and anything except a temporary expression. More...
 
template<typename T2 , forbidden_type< T2, LpExpr > = 0>
LpExpr operator- (const LpCol &lhs, const T2 &rhs)
 operator- between LpCol lhs and not LpExpr rhs More...
 
template<typename T1 , forbidden_type< T1, LpExpr > = 0, forbidden_type< T1, LpCol > = 0>
LpExpr operator- (const T1 &lhs, const LpCol &rhs)
 operator- between neither LpExpr nor LpCol lhs and LpCol rhs More...
 
Non-members operators *
template<typename SCALAR >
LpExpr operator* (const SCALAR &lhs, const LpCol &rhs)
 Overload of operator * between a scalar and a variable. More...
 
template<typename SCALAR >
LpExpr operator* (const LpCol &lhs, const SCALAR &rhs)
 Overload of operator * between a variable and a scalar. More...
 
Non-members operators <=
template<typename T2 >
LpExpr operator<= (const LpExpr &lhs, T2 &&rhs)
 Overload of operator <= between anything and anything. More...
 
template<typename T2 >
LpExpr operator<= (const LpCol &lhs, T2 &&rhs)
 Overload of operator <= between anything and anything. More...
 
template<typename T1 , forbidden_type< T1, LpExpr & > = 0, forbidden_type< T1, LpCol & > = 0>
LpExpr operator<= (T1 &&lhs, const LpExpr &rhs)
 Overload of operator <= between anything and anything. More...
 
template<typename T1 , forbidden_type< T1, LpExpr & > = 0, forbidden_type< T1, LpCol & > = 0>
LpExpr operator<= (T1 &&lhs, const LpCol &rhs)
 Overload of operator <= between anything and anything. More...
 
template<typename T2 >
LpExpr operator<= (LpExpr &&lhs, T2 &&rhs)
 Overload of operator <= between anything and anything. More...
 
template<typename T2 >
LpExpr operator<= (LpCol &&lhs, T2 &&rhs)
 Overload of operator <= between anything and anything. More...
 
template<typename T1 , forbidden_type< T1, LpExpr > = 0, forbidden_type< T1, LpCol > = 0>
LpExpr operator<= (T1 &&lhs, LpExpr &&rhs)
 Overload of operator <= between anything and anything. More...
 
template<typename T1 , forbidden_type< T1, LpExpr > = 0, forbidden_type< T1, LpCol > = 0>
LpExpr operator<= (T1 &&lhs, LpCol &&rhs)
 Overload of operator <= between anything and anything. More...
 

Detailed Description

namespace for constraint-based description of credal sets

Function Documentation

template<typename SCALAR >
LpExpr gum::credal::lp::operator* ( const SCALAR &  lhs,
const LpCol rhs 
)

Overload of operator * between a scalar and a variable.

Parameters
lhsthe constant reference to the scalar on the left hand side of the operator.
rhsthe constant reference to the variable on the right hand side of the operator.
Template Parameters
SCALARA scalar type ( integer or float ( any precision ) ) or a LpCol or a LpExpr.
Returns
An expression which yields the result of lhs * rhs.

Definition at line 1165 of file LpInterface_tpl.h.

References gum::credal::lp::LpExpr::multiply().

1165  {
1166  return LpExpr::multiply(lhs, rhs);
1167  }

+ Here is the call graph for this function:

template<typename SCALAR >
LpExpr gum::credal::lp::operator* ( const LpCol lhs,
const SCALAR &  rhs 
)

Overload of operator * between a variable and a scalar.

Parameters
lhsthe constant reference to the variable on the left hand side of the operator.
rhsthe constant reference to the scalar on the right hand side of the operator.
Template Parameters
SCALARA scalar type ( integer or float ( any precision ) ) or a LpCol or a LpExpr.
Returns
An expression which yields the result of lhs * rhs.

Definition at line 1170 of file LpInterface_tpl.h.

References gum::credal::lp::LpExpr::multiply().

1170  {
1171  return LpExpr::multiply(rhs, lhs);
1172  }

+ Here is the call graph for this function:

template<typename T2 >
LpExpr gum::credal::lp::operator+ ( LpExpr &&  lhs,
const T2 &  rhs 
)

Overload of operator + between anything ( a scalar, a variable or an expression ) and anything except a temporary expression.

Implements both the copy operator + and move operator + because operator + is implemented on top of operators +=. Because of template type deduction both lhs and rhs are "universal references", i.e. either an lvalue or an rvalue reference. Therefor std::forward must be used to forward the type of lhs and rhs.

Parameters
lhsthe rvalue reference to the temporary expression on the right hand side of the operator.
rhsthe universal reference to either a scalar, a variable or a lvalue expression on the right hand side of the operator.
Template Parameters
T2A scalar type ( integer or float ( any precision ) ) or a LpCol or a LpExpr.
Returns
An expression which yields the result of lhs + rhs.

Definition at line 1047 of file LpInterface_tpl.h.

1047  {
1048  LpExpr expr = std::move(lhs);
1049  expr += rhs;
1050 
1051  return expr;
1052  }
template<typename T2 >
LpExpr gum::credal::lp::operator+ ( LpExpr lhs,
const T2 &  rhs 
)

Overload of operator + between anything ( a scalar, a variable or an expression ) and anything except a temporary expression.

Implements both the copy operator + and move operator + because operator + is implemented on top of operators +=. Because of template type deduction both lhs and rhs are "universal references", i.e. either an lvalue or an rvalue reference. Therefor std::forward must be used to forward the type of lhs and rhs.

Parameters
lhsthe rvalue reference to the temporary expression on the right hand side of the operator.
rhsthe universal reference to either a scalar, a variable or a lvalue expression on the right hand side of the operator.
Template Parameters
T2A scalar type ( integer or float ( any precision ) ) or a LpCol or a LpExpr.
Returns
An expression which yields the result of lhs + rhs.
template<typename T1 , forbidden_type< T1, LpExpr > = 0>
LpExpr gum::credal::lp::operator+ ( const T1 &  lhs,
LpExpr &&  rhs 
)

Overload of operator + between anything ( a scalar, a variable or an expression ) and a temporary expression.

This overload is used because only one side of the operator profit from move operation; the one with a temporary expression. If the expression if on the right hand side, we always add it first to profit from move operation. Otherwise another overload is used.

Implements both the copy operator + and move operator + because operator + is implemented on top of operators +=. Because of template type deduction lhs is a "universal reference", i.e. either an lvalue or an rvalue reference. To force rvalue reference with template deduction one should use const : const T&& lhs : lhs is an rvalue reference and WILL be modified ( not intuitive const ). Therefor std::forward must be used to forward the type of lhs. rhs is an rvalue reference and std::move must be used to forward it's type.

Parameters
lhsthe universal reference to either a scalar, a variable or an expression on the left hand side of the operator.
rhsthe rvalue reference to the temporary expression on the right hand side of the operator.
Template Parameters
T1A scalar type ( integer or float ( any precision ) ) or a LpCol or a LpExpr.
Warning
T1 can not be LpExpr (to avoid ambiguity with previous functions)
Returns
An expression which yields the result of lhs + rhs.

Definition at line 1063 of file LpInterface_tpl.h.

1063  {
1064  LpExpr expr = std::move(rhs);
1065  ;
1066  expr += lhs;
1067 
1068  return expr;
1069  }
template<typename T1 , forbidden_type< T1, LpExpr > = 0>
LpExpr gum::credal::lp::operator+ ( const T1 &  lhs,
LpExpr rhs 
)

Overload of operator + between anything ( a scalar, a variable or an expression ) and anything except a temporary expression.

Implements both the copy operator + and move operator + because operator + is implemented on top of operators +=. Because of template type deduction both lhs and rhs are "universal references", i.e. either an lvalue or an rvalue reference. Therefor std::forward must be used to forward the type of lhs and rhs.

Parameters
lhsthe rvalue reference to the temporary expression on the right hand side of the operator.
rhsthe universal reference to either a scalar, a variable or a lvalue expression on the right hand side of the operator.
Template Parameters
T2A scalar type ( integer or float ( any precision ) ) or a LpCol or a LpExpr.
Returns
An expression which yields the result of lhs + rhs.

Definition at line 1072 of file LpInterface_tpl.h.

1072  {
1073  LpExpr expr(rhs);
1074  expr += lhs;
1075 
1076  return expr;
1077  }
template<typename T2 , forbidden_type< T2, LpExpr > = 0>
LpExpr gum::credal::lp::operator+ ( const LpCol lhs,
const T2 &  rhs 
)

operator+ between LpCol lhs and not LpExpr rhs

Definition at line 1080 of file LpInterface_tpl.h.

1080  {
1081  LpExpr expr;
1082  expr += lhs;
1083  expr += rhs;
1084 
1085  return expr;
1086  }
template<typename T1 , forbidden_type< T1, LpExpr > = 0, forbidden_type< T1, LpCol > = 0>
LpExpr gum::credal::lp::operator+ ( const T1 &  lhs,
const LpCol rhs 
)

operator+ between neither LpExpr nor LpCol lhs and LpCol rhs

Definition at line 1091 of file LpInterface_tpl.h.

1091  {
1092  LpExpr expr;
1093  expr += rhs;
1094  expr += lhs;
1095 
1096  return expr;
1097  }
template<typename T2 >
LpExpr gum::credal::lp::operator+ ( const LpExpr lhs,
const T2 &  rhs 
)

Definition at line 1055 of file LpInterface_tpl.h.

1055  {
1056  LpExpr expr(lhs);
1057  expr += rhs;
1058 
1059  return expr;
1060  }
template<typename T2 >
LpExpr gum::credal::lp::operator- ( LpExpr &&  lhs,
const T2 &  rhs 
)

Overload of operator - between anything ( a scalar, a variable or an expression ) and anything except a temporary expression.

Implements both the copy operator - and move operator - because operator - is implemented on top of operators -=. Because of template type deduction both lhs and rhs are "universal references", i.e. either an lvalue or an rvalue reference. Therefor std::forward must be used to forward the type of lhs and rhs.

Parameters
lhsthe rvalue reference to the temporary expression on the right hand side of the operator.
rhsthe universal reference to either a scalar, a variable or a lvalue expression on the right hand side of the operator.
Template Parameters
T2A scalar type ( integer or float ( any precision ) ) or a LpCol or a LpExpr.
Returns
An expression which yields the result of lhs -rhs.

Definition at line 1101 of file LpInterface_tpl.h.

1101  {
1102  LpExpr expr = std::move(lhs);
1103  expr -= rhs;
1104 
1105  return expr;
1106  }
template<typename T2 >
LpExpr gum::credal::lp::operator- ( LpExpr lhs,
const T2 &  rhs 
)

Overload of operator - between anything ( a scalar, a variable or an expression ) and anything except a temporary expression.

Implements both the copy operator - and move operator - because operator - is implemented on top of operators -=. Because of template type deduction both lhs and rhs are "universal references", i.e. either an lvalue or an rvalue reference. Therefor std::forward must be used to forward the type of lhs and rhs.

Parameters
lhsthe rvalue reference to the temporary expression on the right hand side of the operator.
rhsthe universal reference to either a scalar, a variable or a lvalue expression on the right hand side of the operator.
Template Parameters
T2A scalar type ( integer or float ( any precision ) ) or a LpCol or a LpExpr.
Returns
An expression which yields the result of lhs -rhs.
template<typename T1 , forbidden_type< T1, LpExpr > = 0>
LpExpr gum::credal::lp::operator- ( const T1 &  lhs,
LpExpr &&  rhs 
)

Overload of operator - between anything ( a scalar, a variable or an expression ) and a temporary expression.

This overload is used because only one side of the operator profit from move operation; the one with a temporary expression. If the expression if on the right hand side, we always add it first to profit from move operation. Otherwise another overload is used.

Implements both the copy operator - and move operator - because operator - is implemented on top of operators -=. Because of template type deduction lhs is a "universal reference", i.e. either an lvalue or an rvalue reference. To force rvalue reference with template deduction one should use const : const T&& lhs : lhs is an rvalue reference and WILL be modified ( not intuitive const ). Therefor std::forward must be used to forward the type of lhs. rhs is an rvalue reference and std::move must be used to forward it's type.

Parameters
lhsthe universal reference to either a scalar, a variable or an expression on the left hand side of the operator.
rhsthe rvalue reference to the temporary expression on the right hand side of the operator.
Template Parameters
T1A scalar type ( integer or float ( any precision ) ) or a LpCol or a LpExpr.
Warning
T1 can not be LpExpr (to avoid ambiguity with previous functions)
Returns
An expression which yields the result of lhs - rhs.

Definition at line 1117 of file LpInterface_tpl.h.

1117  {
1118  LpExpr expr;
1119  expr += std::move(rhs);
1120  ;
1121  expr -= lhs;
1122 
1123  return expr;
1124  }
template<typename T1 , forbidden_type< T1, LpExpr > = 0>
LpExpr gum::credal::lp::operator- ( const T1 &  lhs,
LpExpr rhs 
)

Overload of operator - between anything ( a scalar, a variable or an expression ) and anything except a temporary expression.

Implements both the copy operator - and move operator - because operator - is implemented on top of operators -=. Because of template type deduction both lhs and rhs are "universal references", i.e. either an lvalue or an rvalue reference. Therefor std::forward must be used to forward the type of lhs and rhs.

Parameters
lhsthe rvalue reference to the temporary expression on the right hand side of the operator.
rhsthe universal reference to either a scalar, a variable or a lvalue expression on the right hand side of the operator.
Template Parameters
T2A scalar type ( integer or float ( any precision ) ) or a LpCol or a LpExpr.
Returns
An expression which yields the result of lhs -rhs.

Definition at line 1127 of file LpInterface_tpl.h.

1127  {
1128  LpExpr expr;
1129  expr += rhs;
1130  expr -= lhs;
1131 
1132  return expr;
1133  }
template<typename T2 , forbidden_type< T2, LpExpr > = 0>
LpExpr gum::credal::lp::operator- ( const LpCol lhs,
const T2 &  rhs 
)

operator- between LpCol lhs and not LpExpr rhs

Parameters
lhsthe universal reference to either a scalar, a variable or an expression on the left hand side of the operator.
rhsthe rvalue reference to the temporary expression on the right hand side of the operator.
Template Parameters
T2A scalar type ( integer or float ( any precision ) ) or a LpCol or a LpExpr.

Definition at line 1136 of file LpInterface_tpl.h.

1136  {
1137  LpExpr expr;
1138  expr += lhs;
1139  expr -= rhs;
1140 
1141  return expr;
1142  }
template<typename T1 , forbidden_type< T1, LpExpr > = 0, forbidden_type< T1, LpCol > = 0>
LpExpr gum::credal::lp::operator- ( const T1 &  lhs,
const LpCol rhs 
)

operator- between neither LpExpr nor LpCol lhs and LpCol rhs

Parameters
lhsthe universal reference to either a scalar, a variable or an expression on the left hand side of the operator.
rhsthe rvalue reference to the temporary expression on the right hand side of the operator.
Template Parameters
T1A scalar type ( integer or float ( any precision ) ) or a LpCol or a LpExpr.

Definition at line 1147 of file LpInterface_tpl.h.

1147  {
1148  LpExpr expr;
1149  expr += rhs;
1150  expr -= lhs;
1151 
1152  return expr;
1153  }
template<typename T2 >
LpExpr gum::credal::lp::operator- ( const LpExpr lhs,
const T2 &  rhs 
)

Definition at line 1109 of file LpInterface_tpl.h.

1109  {
1110  LpExpr expr(lhs);
1111  expr -= rhs;
1112 
1113  return expr;
1114  }
std::ostream& gum::credal::lp::operator<< ( std::ostream &  out,
const LpCol col 
)
Parameters
outThe reference to the caller, i.e. left side of <<.
colThe constant reference to the variable whose representation we want.
Returns
The address of the caller.

Definition at line 52 of file LpInterface_tpl.h.

References gum::credal::lp::LpCol::toString().

52  {
53  out << col.toString();
54  return out;
55  }

+ Here is the call graph for this function:

std::ostream& gum::credal::lp::operator<< ( std::ostream &  out,
const LpExpr expr 
)

Definition at line 340 of file LpInterface_tpl.h.

References gum::credal::lp::LpExpr::toString().

340  {
341  out << expr.toString();
342  return out;
343  }

+ Here is the call graph for this function:

std::ostream& gum::credal::lp::operator<< ( std::ostream &  out,
const LpRow row 
)
Parameters
outthe reference to the caller, i.e. left side of <<.
rowthe constant reference to the row whose representation we want.
Returns
The address of the caller.

Definition at line 717 of file LpInterface_tpl.h.

References gum::credal::lp::LpRow::toString().

717  {
718  out << row.toString();
719  return out;
720  }

+ Here is the call graph for this function:

template<typename T >
std::ostream& gum::credal::lp::operator<< ( std::ostream &  out,
const LpInterface< T > &  lpi 
)
Parameters
outthe reference to the caller, i.e. left side of <<.
lpithe constant reference to the linear program whose representation we want.
Returns
The address of the caller.

Definition at line 824 of file LpInterface_tpl.h.

824  {
825  out << lpi.toString();
826  return out;
827  }
template<typename T2 >
LpExpr gum::credal::lp::operator<= ( const LpExpr lhs,
T2 &&  rhs 
)

Overload of operator <= between anything and anything.

Implements both the copy operator <= and move operator <=. Because of template type deduction both lhs and rhs are "universal references", i.e. either an lvalue or an rvalue reference. Therefor std::forward must be used to forward the type of lhs and rhs.

Parameters
lhsthe universal reference to either a ( temporary ) scalar, a ( temporary ) variable or a ( temporary ) expression on the left hand side of the operator.
rhsthe universal reference to either a ( temporary ) scalar, a ( temporary ) variable or a ( temporary ) expression on the right hand side of the operator.
Template Parameters
T1A scalar type ( integer or float ( any precision ) ) or a LpCol or a LpExpr.
T2A scalar type ( integer or float ( any precision ) ) or a LpCol or a LpExpr.
Returns
An expression which yields the result of lhs <= rhs.

Definition at line 1185 of file LpInterface_tpl.h.

References gum::credal::lp::LpExpr::lessThan().

1185  {
1186  return LpExpr::lessThan(lhs, std::forward< T2 >(rhs));
1187  }

+ Here is the call graph for this function:

template<typename T2 >
LpExpr gum::credal::lp::operator<= ( const LpCol lhs,
T2 &&  rhs 
)

Overload of operator <= between anything and anything.

Implements both the copy operator <= and move operator <=. Because of template type deduction both lhs and rhs are "universal references", i.e. either an lvalue or an rvalue reference. Therefor std::forward must be used to forward the type of lhs and rhs.

Parameters
lhsthe universal reference to either a ( temporary ) scalar, a ( temporary ) variable or a ( temporary ) expression on the left hand side of the operator.
rhsthe universal reference to either a ( temporary ) scalar, a ( temporary ) variable or a ( temporary ) expression on the right hand side of the operator.
Template Parameters
T1A scalar type ( integer or float ( any precision ) ) or a LpCol or a LpExpr.
T2A scalar type ( integer or float ( any precision ) ) or a LpCol or a LpExpr.
Returns
An expression which yields the result of lhs <= rhs.

Definition at line 1190 of file LpInterface_tpl.h.

References gum::credal::lp::LpExpr::lessThan().

1190  {
1191  return LpExpr::lessThan(lhs, std::forward< T2 >(rhs));
1192  }

+ Here is the call graph for this function:

template<typename T1 , forbidden_type< T1, LpExpr & > = 0, forbidden_type< T1, LpCol & > = 0>
LpExpr gum::credal::lp::operator<= ( T1 &&  lhs,
const LpExpr rhs 
)

Overload of operator <= between anything and anything.

Implements both the copy operator <= and move operator <=. Because of template type deduction both lhs and rhs are "universal references", i.e. either an lvalue or an rvalue reference. Therefor std::forward must be used to forward the type of lhs and rhs.

Parameters
lhsthe universal reference to either a ( temporary ) scalar, a ( temporary ) variable or a ( temporary ) expression on the left hand side of the operator.
rhsthe universal reference to either a ( temporary ) scalar, a ( temporary ) variable or a ( temporary ) expression on the right hand side of the operator.
Template Parameters
T1A scalar type ( integer or float ( any precision ) ) or a LpCol or a LpExpr.
T2A scalar type ( integer or float ( any precision ) ) or a LpCol or a LpExpr.
Returns
An expression which yields the result of lhs <= rhs.

Definition at line 1197 of file LpInterface_tpl.h.

References gum::credal::lp::LpExpr::lessThan().

1197  {
1198  return LpExpr::lessThan(std::forward< T1 >(lhs), rhs);
1199  }

+ Here is the call graph for this function:

template<typename T1 , forbidden_type< T1, LpExpr & > = 0, forbidden_type< T1, LpCol & > = 0>
LpExpr gum::credal::lp::operator<= ( T1 &&  lhs,
const LpCol rhs 
)

Overload of operator <= between anything and anything.

Implements both the copy operator <= and move operator <=. Because of template type deduction both lhs and rhs are "universal references", i.e. either an lvalue or an rvalue reference. Therefor std::forward must be used to forward the type of lhs and rhs.

Parameters
lhsthe universal reference to either a ( temporary ) scalar, a ( temporary ) variable or a ( temporary ) expression on the left hand side of the operator.
rhsthe universal reference to either a ( temporary ) scalar, a ( temporary ) variable or a ( temporary ) expression on the right hand side of the operator.
Template Parameters
T1A scalar type ( integer or float ( any precision ) ) or a LpCol or a LpExpr.
T2A scalar type ( integer or float ( any precision ) ) or a LpCol or a LpExpr.
Returns
An expression which yields the result of lhs <= rhs.

Definition at line 1204 of file LpInterface_tpl.h.

References gum::credal::lp::LpExpr::lessThan().

1204  {
1205  return LpExpr::lessThan(std::forward< T1 >(lhs), rhs);
1206  }

+ Here is the call graph for this function:

template<typename T2 >
LpExpr gum::credal::lp::operator<= ( LpExpr &&  lhs,
T2 &&  rhs 
)

Overload of operator <= between anything and anything.

Implements both the copy operator <= and move operator <=. Because of template type deduction both lhs and rhs are "universal references", i.e. either an lvalue or an rvalue reference. Therefor std::forward must be used to forward the type of lhs and rhs.

Parameters
lhsthe universal reference to either a ( temporary ) scalar, a ( temporary ) variable or a ( temporary ) expression on the left hand side of the operator.
rhsthe universal reference to either a ( temporary ) scalar, a ( temporary ) variable or a ( temporary ) expression on the right hand side of the operator.
Template Parameters
T1A scalar type ( integer or float ( any precision ) ) or a LpCol or a LpExpr.
T2A scalar type ( integer or float ( any precision ) ) or a LpCol or a LpExpr.
Returns
An expression which yields the result of lhs <= rhs.

Definition at line 1210 of file LpInterface_tpl.h.

References gum::credal::lp::LpExpr::lessThan().

1210  {
1211  return LpExpr::lessThan(std::move(lhs), std::forward< T2 >(rhs));
1212  }

+ Here is the call graph for this function:

template<typename T2 >
LpExpr gum::credal::lp::operator<= ( LpCol &&  lhs,
T2 &&  rhs 
)

Overload of operator <= between anything and anything.

Implements both the copy operator <= and move operator <=. Because of template type deduction both lhs and rhs are "universal references", i.e. either an lvalue or an rvalue reference. Therefor std::forward must be used to forward the type of lhs and rhs.

Parameters
lhsthe universal reference to either a ( temporary ) scalar, a ( temporary ) variable or a ( temporary ) expression on the left hand side of the operator.
rhsthe universal reference to either a ( temporary ) scalar, a ( temporary ) variable or a ( temporary ) expression on the right hand side of the operator.
Template Parameters
T1A scalar type ( integer or float ( any precision ) ) or a LpCol or a LpExpr.
T2A scalar type ( integer or float ( any precision ) ) or a LpCol or a LpExpr.
Returns
An expression which yields the result of lhs <= rhs.

Definition at line 1215 of file LpInterface_tpl.h.

References gum::credal::lp::LpExpr::lessThan().

1215  {
1216  return LpExpr::lessThan(std::move(lhs), std::forward< T2 >(rhs));
1217  }

+ Here is the call graph for this function:

template<typename T1 , forbidden_type< T1, LpExpr > = 0, forbidden_type< T1, LpCol > = 0>
LpExpr gum::credal::lp::operator<= ( T1 &&  lhs,
LpExpr &&  rhs 
)

Overload of operator <= between anything and anything.

Implements both the copy operator <= and move operator <=. Because of template type deduction both lhs and rhs are "universal references", i.e. either an lvalue or an rvalue reference. Therefor std::forward must be used to forward the type of lhs and rhs.

Parameters
lhsthe universal reference to either a ( temporary ) scalar, a ( temporary ) variable or a ( temporary ) expression on the left hand side of the operator.
rhsthe universal reference to either a ( temporary ) scalar, a ( temporary ) variable or a ( temporary ) expression on the right hand side of the operator.
Template Parameters
T1A scalar type ( integer or float ( any precision ) ) or a LpCol or a LpExpr.
T2A scalar type ( integer or float ( any precision ) ) or a LpCol or a LpExpr.
Returns
An expression which yields the result of lhs <= rhs.

Definition at line 1222 of file LpInterface_tpl.h.

References gum::credal::lp::LpExpr::lessThan().

1222  {
1223  return LpExpr::lessThan(std::forward< T1 >(lhs), std::move(rhs));
1224  }

+ Here is the call graph for this function:

template<typename T1 , forbidden_type< T1, LpExpr > = 0, forbidden_type< T1, LpCol > = 0>
LpExpr gum::credal::lp::operator<= ( T1 &&  lhs,
LpCol &&  rhs 
)

Overload of operator <= between anything and anything.

Implements both the copy operator <= and move operator <=. Because of template type deduction both lhs and rhs are "universal references", i.e. either an lvalue or an rvalue reference. Therefor std::forward must be used to forward the type of lhs and rhs.

Parameters
lhsthe universal reference to either a ( temporary ) scalar, a ( temporary ) variable or a ( temporary ) expression on the left hand side of the operator.
rhsthe universal reference to either a ( temporary ) scalar, a ( temporary ) variable or a ( temporary ) expression on the right hand side of the operator.
Template Parameters
T1A scalar type ( integer or float ( any precision ) ) or a LpCol or a LpExpr.
T2A scalar type ( integer or float ( any precision ) ) or a LpCol or a LpExpr.
Returns
An expression which yields the result of lhs <= rhs.

Definition at line 1229 of file LpInterface_tpl.h.

References gum::credal::lp::LpExpr::lessThan().

1229  {
1230  return LpExpr::lessThan(std::forward< T1 >(lhs), std::move(rhs));
1231  }

+ Here is the call graph for this function:

void gum::credal::lp::swap ( HashTable< LpCol, double > *&  a,
HashTable< LpCol, double > *&  b 
)
inline

Swap the addresses of two pointers to hashTables.

Used by move operations as the temporary will take care of the delete operations.

Warning
DO NOT call this directly ( one of the object owning a pointer must be a temporary, i.e. an "rvalue reference" ).
Parameters
athe address of the first pointer.
bthe address of the second pointer.

Definition at line 1039 of file LpInterface_tpl.h.

Referenced by gum::credal::lp::LpExpr::__addSide(), gum::credal::CNLoopyPropagation< GUM_SCALAR >::_makeInferenceByRandomOrder(), gum::credal::lp::LpExpr::LpExpr(), gum::credal::lp::LpRow::LpRow(), gum::credal::lp::LpExpr::operator+=(), gum::credal::lp::LpExpr::operator=(), gum::credal::lp::LpRow::operator=(), gum::HashTable< Key, Val, Alloc >::resize(), and gum::List< Val, Alloc >::swap().

1039  {
1040  HashTable< LpCol, double >* tmp(a);
1041  a = b;
1042  b = tmp;
1043  }

+ Here is the caller graph for this function: