aGrUM 3.2.0
a C++ library for (probabilistic) graphical models
gum::credal::lp Namespace Reference

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

Classes

class  LpInterface
 Class representing a linear program. More...
class  LpCol
 Class representing a variable ( a column ) of a linear program, i.e. More...
class  LpExpr
 Class representing a linear expression. 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.
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.
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.
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.
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.
template<typename T2, forbidden_type< T2, LpExpr > = 0>
LpExpr operator+ (const LpCol &lhs, const T2 &rhs)
 operator+ between LpCol lhs and not LpExpr rhs
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
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.
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.
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.
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.
template<typename T2, forbidden_type< T2, LpExpr > = 0>
LpExpr operator- (const LpCol &lhs, const T2 &rhs)
 operator- between LpCol lhs and not LpExpr rhs
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
Non-members operators *
template<typename SCALAR>
LpExpr operator* (const SCALAR &lhs, const LpCol &rhs)
 Overload of operator * between a scalar and a variable.
template<typename SCALAR>
LpExpr operator* (const LpCol &lhs, const SCALAR &rhs)
 Overload of operator * between a variable and a scalar.
Non-members operators <=
template<typename T2>
LpExpr operator<= (const LpExpr &lhs, T2 &&rhs)
 Overload of operator <= between anything and anything.
template<typename T2>
LpExpr operator<= (const LpCol &lhs, T2 &&rhs)
 Overload of operator <= between anything and anything.
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.
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.
template<typename T2>
LpExpr operator<= (LpExpr &&lhs, T2 &&rhs)
 Overload of operator <= between anything and anything.
template<typename T2>
LpExpr operator<= (LpCol &&lhs, T2 &&rhs)
 Overload of operator <= between anything and anything.
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.
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.

Detailed Description

namespace for constraint-based description of credal sets

Function Documentation

◆ operator*() [1/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 508 of file LpInterface_tpl.h.

508 {
509 return LpExpr::multiply(rhs, lhs);
510 }
static LpExpr multiply(const SCALAR &lhs, const LpCol &rhs)

References gum::credal::lp::LpExpr::multiply(), and operator*().

Here is the call graph for this function:

◆ operator*() [2/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 503 of file LpInterface_tpl.h.

503 {
504 return LpExpr::multiply(lhs, rhs);
505 }

References gum::credal::lp::LpExpr::multiply(), and operator*().

Referenced by operator*(), operator*(), and operator-().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator+() [1/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 422 of file LpInterface_tpl.h.

422 {
423 LpExpr expr;
424 expr += lhs;
425 expr += rhs;
426
427 return expr;
428 }
Class representing a linear expression.

References operator+().

Here is the call graph for this function:

◆ operator+() [2/7]

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

Definition at line 397 of file LpInterface_tpl.h.

397 {
398 LpExpr expr(lhs);
399 expr += rhs;
400
401 return expr;
402 }

References operator+().

Here is the call graph for this function:

◆ operator+() [3/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 431 of file LpInterface_tpl.h.

431 {
432 LpExpr expr;
433 expr += rhs;
434 expr += lhs;
435
436 return expr;
437 }

References operator+().

Here is the call graph for this function:

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

405 {
406 LpExpr expr = std::move(rhs);
407 ;
408 expr += lhs;
409
410 return expr;
411 }

References operator+().

Here is the call graph for this function:

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

414 {
415 LpExpr expr(rhs);
416 expr += lhs;
417
418 return expr;
419 }

References operator+().

Here is the call graph for this function:

◆ operator+() [6/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 389 of file LpInterface_tpl.h.

389 {
390 LpExpr expr = std::move(lhs);
391 expr += rhs;
392
393 return expr;
394 }

References operator+().

Referenced by operator+(), operator+(), operator+(), operator+(), operator+(), operator+(), operator+(), and swap().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator+() [7/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.

References operator+(), and operator-().

Here is the call graph for this function:

◆ operator-() [1/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 476 of file LpInterface_tpl.h.

476 {
477 LpExpr expr;
478 expr += lhs;
479 expr -= rhs;
480
481 return expr;
482 }

References operator-().

Here is the call graph for this function:

◆ operator-() [2/7]

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

Definition at line 449 of file LpInterface_tpl.h.

449 {
450 LpExpr expr(lhs);
451 expr -= rhs;
452
453 return expr;
454 }

References operator-().

Here is the call graph for this function:

◆ operator-() [3/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 485 of file LpInterface_tpl.h.

485 {
486 LpExpr expr;
487 expr += rhs;
488 expr -= lhs;
489
490 return expr;
491 }

References operator-().

Here is the call graph for this function:

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

457 {
458 LpExpr expr;
459 expr += std::move(rhs);
460 ;
461 expr -= lhs;
462
463 return expr;
464 }

References operator-().

Here is the call graph for this function:

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

467 {
468 LpExpr expr;
469 expr += rhs;
470 expr -= lhs;
471
472 return expr;
473 }

References operator-().

Here is the call graph for this function:

◆ operator-() [6/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 441 of file LpInterface_tpl.h.

441 {
442 LpExpr expr = std::move(lhs);
443 expr -= rhs;
444
445 return expr;
446 }

References operator-().

Referenced by operator+(), operator-(), operator-(), operator-(), operator-(), operator-(), operator-(), and operator-().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator-() [7/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.

References operator*(), operator-(), and operator<=().

Here is the call graph for this function:

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

178 {
179 out << lpi.toString();
180 return out;
181 }
std::string toString() const
Get the string representation of a calling linear program.

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

630 {
631 out << row.toString();
632 return out;
633 }
std::string toString() const
Get the string representation of a calling row.

◆ operator<=() [1/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 528 of file LpInterface_tpl.h.

528 {
529 return LpExpr::lessThan(lhs, std::forward< T2 >(rhs));
530 }
static LpExpr lessThan(T1 &&lhs, T2 &&rhs)

References gum::credal::lp::LpExpr::lessThan(), and operator<=().

Here is the call graph for this function:

◆ operator<=() [2/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 523 of file LpInterface_tpl.h.

523 {
524 return LpExpr::lessThan(lhs, std::forward< T2 >(rhs));
525 }

References gum::credal::lp::LpExpr::lessThan(), and operator<=().

Referenced by operator-(), operator<=(), operator<=(), operator<=(), operator<=(), operator<=(), operator<=(), operator<=(), and operator<=().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator<=() [3/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 549 of file LpInterface_tpl.h.

549 {
550 return LpExpr::lessThan(std::move(lhs), std::forward< T2 >(rhs));
551 }

References gum::credal::lp::LpExpr::lessThan(), and operator<=().

Here is the call graph for this function:

◆ operator<=() [4/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 544 of file LpInterface_tpl.h.

544 {
545 return LpExpr::lessThan(std::move(lhs), std::forward< T2 >(rhs));
546 }

References gum::credal::lp::LpExpr::lessThan(), and operator<=().

Here is the call graph for this function:

◆ operator<=() [5/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 538 of file LpInterface_tpl.h.

538 {
539 return LpExpr::lessThan(std::forward< T1 >(lhs), rhs);
540 }

References gum::credal::lp::LpExpr::lessThan(), and operator<=().

Here is the call graph for this function:

◆ operator<=() [6/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 533 of file LpInterface_tpl.h.

533 {
534 return LpExpr::lessThan(std::forward< T1 >(lhs), rhs);
535 }

References gum::credal::lp::LpExpr::lessThan(), and operator<=().

Here is the call graph for this function:

◆ operator<=() [7/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 559 of file LpInterface_tpl.h.

559 {
560 return LpExpr::lessThan(std::forward< T1 >(lhs), std::move(rhs));
561 }

References gum::credal::lp::LpExpr::lessThan(), and operator<=().

Here is the call graph for this function:

◆ operator<=() [8/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 554 of file LpInterface_tpl.h.

554 {
555 return LpExpr::lessThan(std::forward< T1 >(lhs), std::move(rhs));
556 }

References gum::credal::lp::LpExpr::lessThan(), and operator<=().

Here is the call graph for this function:

◆ 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.

References operator+(), and swap().

Referenced by gum::credal::lp::LpExpr::LpExpr(), gum::credal::lp::LpExpr::_addSide_(), gum::credal::lp::LpExpr::operator+=(), gum::credal::lp::LpExpr::operator=(), gum::credal::lp::LpRow::operator=(), and swap().

Here is the call graph for this function:
Here is the caller graph for this function: