aGrUM  0.20.3
a C++ library for (probabilistic) graphical models
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

std::ostream & operator<< (std::ostream &out, const LpRow &row)
 
void swap (HashTable< LpCol, double > *&a, HashTable< LpCol, double > *&b)
 Swap the addresses of two pointers to hashTables. More...
 
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

◆ operator*() [1/2]

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 479 of file LpInterface_tpl.h.

479  {
480  return LpExpr::multiply(lhs, rhs);
481  }

◆ operator*() [2/2]

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 484 of file LpInterface_tpl.h.

484  {
485  return LpExpr::multiply(rhs, lhs);
486  }

◆ operator+() [1/7]

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

Definition at line 373 of file LpInterface_tpl.h.

373  {
374  LpExpr expr(lhs);
375  expr += rhs;
376 
377  return expr;
378  }

◆ operator+() [2/7]

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 365 of file LpInterface_tpl.h.

365  {
366  LpExpr expr = std::move(lhs);
367  expr += rhs;
368 
369  return expr;
370  }

◆ operator+() [3/7]

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.

◆ operator+() [4/7]

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 381 of file LpInterface_tpl.h.

381  {
382  LpExpr expr = std::move(rhs);
383  ;
384  expr += lhs;
385 
386  return expr;
387  }

◆ operator+() [5/7]

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 390 of file LpInterface_tpl.h.

390  {
391  LpExpr expr(rhs);
392  expr += lhs;
393 
394  return expr;
395  }

◆ operator+() [6/7]

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 398 of file LpInterface_tpl.h.

398  {
399  LpExpr expr;
400  expr += lhs;
401  expr += rhs;
402 
403  return expr;
404  }

◆ operator+() [7/7]

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 407 of file LpInterface_tpl.h.

407  {
408  LpExpr expr;
409  expr += rhs;
410  expr += lhs;
411 
412  return expr;
413  }

◆ operator-() [1/7]

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

Definition at line 425 of file LpInterface_tpl.h.

425  {
426  LpExpr expr(lhs);
427  expr -= rhs;
428 
429  return expr;
430  }

◆ operator-() [2/7]

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 417 of file LpInterface_tpl.h.

417  {
418  LpExpr expr = std::move(lhs);
419  expr -= rhs;
420 
421  return expr;
422  }

◆ operator-() [3/7]

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.

◆ operator-() [4/7]

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 433 of file LpInterface_tpl.h.

433  {
434  LpExpr expr;
435  expr += std::move(rhs);
436  ;
437  expr -= lhs;
438 
439  return expr;
440  }

◆ operator-() [5/7]

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 443 of file LpInterface_tpl.h.

443  {
444  LpExpr expr;
445  expr += rhs;
446  expr -= lhs;
447 
448  return expr;
449  }

◆ operator-() [6/7]

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 452 of file LpInterface_tpl.h.

452  {
453  LpExpr expr;
454  expr += lhs;
455  expr -= rhs;
456 
457  return expr;
458  }

◆ operator-() [7/7]

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 461 of file LpInterface_tpl.h.

461  {
462  LpExpr expr;
463  expr += rhs;
464  expr -= lhs;
465 
466  return expr;
467  }

◆ operator<<() [1/2]

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 154 of file LpInterface_tpl.h.

154  {
155  out << lpi.toString();
156  return out;
157  }

◆ operator<<() [2/2]

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 624 of file LpInterface.cpp.

624  {
625  out << row.toString();
626  return out;
627  }

◆ operator<=() [1/8]

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 499 of file LpInterface_tpl.h.

499  {
500  return LpExpr::lessThan(lhs, std::forward< T2 >(rhs));
501  }

◆ operator<=() [2/8]

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 504 of file LpInterface_tpl.h.

504  {
505  return LpExpr::lessThan(lhs, std::forward< T2 >(rhs));
506  }

◆ operator<=() [3/8]

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 509 of file LpInterface_tpl.h.

509  {
510  return LpExpr::lessThan(std::forward< T1 >(lhs), rhs);
511  }

◆ operator<=() [4/8]

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 514 of file LpInterface_tpl.h.

514  {
515  return LpExpr::lessThan(std::forward< T1 >(lhs), rhs);
516  }

◆ operator<=() [5/8]

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 520 of file LpInterface_tpl.h.

520  {
521  return LpExpr::lessThan(std::move(lhs), std::forward< T2 >(rhs));
522  }

◆ operator<=() [6/8]

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 525 of file LpInterface_tpl.h.

525  {
526  return LpExpr::lessThan(std::move(lhs), std::forward< T2 >(rhs));
527  }

◆ operator<=() [7/8]

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 530 of file LpInterface_tpl.h.

530  {
531  return LpExpr::lessThan(std::forward< T1 >(lhs), std::move(rhs));
532  }

◆ operator<=() [8/8]

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 535 of file LpInterface_tpl.h.

535  {
536  return LpExpr::lessThan(std::forward< T1 >(lhs), std::move(rhs));
537  }

◆ swap()

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

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.