aGrUM  0.16.0
gum::credal::lp::LpExpr Class Reference

Class representing a linear expression. More...

#include <agrum/CN/LpInterface.h>

+ Collaboration diagram for gum::credal::lp::LpExpr:

Public Member Functions

void clear ()
 Clear all data of the calling expression as if it was constructed. More...
 
std::string toString () const
 Get the string representation of a calling expression. More...
 
template<typename SCALAR >
INLINE LpExpr multiply (const SCALAR &lhs, const LpCol &rhs)
 
template<typename T1 , typename T2 >
INLINE LpExpr lessThan (T1 &&lhs, T2 &&rhs)
 
Constructors / Destructors
 LpExpr ()
 Default constructor. More...
 
 LpExpr (const LpExpr &expr)
 Copy constructor. More...
 
 LpExpr (const LpExpr &expr, bool copyLeft, bool copyMiddle, bool copyRight)
 Copy constructor. More...
 
 LpExpr (LpExpr &&expr)
 Move copy constructor from temporary. More...
 
 LpExpr (LpExpr &&expr, bool copyLeft, bool copyMiddle, bool copyRight)
 Move copy constructor from temporary. More...
 
 ~LpExpr ()
 Default destructor. More...
 
Assignment operators =
LpExproperator= (const LpCol &rhs)
 Assignment operator = with a variable. More...
 
LpExproperator= (const LpExpr &rhs)
 Assignment operator = with another expression, by copy. More...
 
LpExproperator= (LpExpr &&rhs)
 Assignment operator = with another expression, by move. More...
 
template<typename SCALAR >
LpExproperator= (const SCALAR &rhs)
 Assignment operator = with a scalar. More...
 
Compound assignment operators +=
LpExproperator+= (const LpCol &rhs)
 Compound assignment operator += with a variable. More...
 
LpExproperator+= (const LpExpr &rhs)
 Compound assignment operator += with another expression. More...
 
LpExproperator+= (LpExpr &&rhs)
 Compound assignment operator += with another temporary expression. More...
 
template<typename T >
LpExproperator+= (const T &rhs)
 Compound assignment operator += with a scalar. More...
 
Compound assignment operators -=
LpExproperator-= (const LpCol &rhs)
 Compound assignment operator -= with a variable. More...
 
LpExproperator-= (const LpExpr &rhs)
 Compound assignment operator -= with another expression. More...
 
template<typename T >
LpExproperator-= (const T &rhs)
 Compound assignment operator -= with a salar. More...
 

Static Public Member Functions

Helper static methods for operations
template<typename T1 , typename T2 >
static LpExpr lessThan (T1 &&lhs, T2 &&rhs)
 
template<typename SCALAR >
static LpExpr multiply (const SCALAR &lhs, const LpCol &rhs)
 

Friends

class LpRow
 
template<typename GUM_SCALAR >
class LpInterface
 

Detailed Description

Class representing a linear expression.

Author
Matthieu HOURBRACQ and Pierre-Henri WUILLEMIN

Definition at line 210 of file LpInterface.h.

Constructor & Destructor Documentation

◆ LpExpr() [1/5]

gum::credal::lp::LpExpr::LpExpr ( )

Default constructor.

class LpExpr

Definition at line 70 of file LpInterface_tpl.h.

70  :
71  __ileft(false), __imiddle(false), __iright(false), __lValue(0.),
72  __mValue(0.), __rValue(0.), __lCoeffs(new HashTable< LpCol, double >()),
73  __mCoeffs(new HashTable< LpCol, double >()),
74  __rCoeffs(new HashTable< LpCol, double >()) {
75  GUM_CONSTRUCTOR(LpExpr);
76  }
bool __ileft
True if this expression has a non-empty left side L : L <= M <= R .
Definition: LpInterface.h:415
bool __iright
True if this expression has a non-empty right side R : L <= M <= R .
Definition: LpInterface.h:423
HashTable< LpCol, double > * __mCoeffs
The coefficients of each variable on the middle side L : L <= M <= R.
Definition: LpInterface.h:439
double __mValue
The constant on the middle side L : L <= M <= R.
Definition: LpInterface.h:428
LpExpr()
Default constructor.
double __rValue
The constant on the right side L : L <= M <= R.
Definition: LpInterface.h:430
HashTable< LpCol, double > * __rCoeffs
The coefficients of each variable on the right side L : L <= M <= R.
Definition: LpInterface.h:443
double __lValue
The constant on the left side L : L <= M <= R.
Definition: LpInterface.h:426
HashTable< LpCol, double > * __lCoeffs
The coefficients of each variable on the left side L : L <= M <= R.
Definition: LpInterface.h:435
bool __imiddle
True if this expression has a non-empty middle side M ( the default ) : L <= M <= R ...
Definition: LpInterface.h:419

◆ LpExpr() [2/5]

gum::credal::lp::LpExpr::LpExpr ( const LpExpr expr)

Copy constructor.

Parameters
exprThe constant reference to the expression to copy.

Definition at line 78 of file LpInterface_tpl.h.

78  :
79  __ileft(expr.__ileft), __imiddle(expr.__imiddle),
80  __iright(expr.__iright), __lValue(expr.__lValue),
81  __mValue(expr.__mValue), __rValue(expr.__rValue),
82  __lCoeffs(new HashTable< LpCol, double >(*expr.__lCoeffs)),
83  __mCoeffs(new HashTable< LpCol, double >(*expr.__mCoeffs)),
84  __rCoeffs(new HashTable< LpCol, double >(*expr.__rCoeffs)) {
85  GUM_CONS_CPY(LpExpr);
86  }
bool __ileft
True if this expression has a non-empty left side L : L <= M <= R .
Definition: LpInterface.h:415
bool __iright
True if this expression has a non-empty right side R : L <= M <= R .
Definition: LpInterface.h:423
HashTable< LpCol, double > * __mCoeffs
The coefficients of each variable on the middle side L : L <= M <= R.
Definition: LpInterface.h:439
double __mValue
The constant on the middle side L : L <= M <= R.
Definition: LpInterface.h:428
LpExpr()
Default constructor.
double __rValue
The constant on the right side L : L <= M <= R.
Definition: LpInterface.h:430
HashTable< LpCol, double > * __rCoeffs
The coefficients of each variable on the right side L : L <= M <= R.
Definition: LpInterface.h:443
double __lValue
The constant on the left side L : L <= M <= R.
Definition: LpInterface.h:426
HashTable< LpCol, double > * __lCoeffs
The coefficients of each variable on the left side L : L <= M <= R.
Definition: LpInterface.h:435
bool __imiddle
True if this expression has a non-empty middle side M ( the default ) : L <= M <= R ...
Definition: LpInterface.h:419

◆ LpExpr() [3/5]

gum::credal::lp::LpExpr::LpExpr ( const LpExpr expr,
bool  copyLeft,
bool  copyMiddle,
bool  copyRight 
)

Copy constructor.

Makes a ( partial ) copy.

Parameters
exprThe constant reference to the expression to copy.
copyLeftTrue if we want to copy left side of expr, False otherwise.
copyMiddleTrue if we want to copy middle side of expr, False otherwise.
copyRightTrue if we want to copy right side of expr, False otherwise.

Definition at line 88 of file LpInterface_tpl.h.

References __ileft, __imiddle, __iright, __lCoeffs, __lValue, __mCoeffs, __mValue, __rCoeffs, and __rValue.

91  :
92  __ileft(false),
93  __imiddle(false), __iright(false), __lValue(0.), __mValue(0.),
94  __rValue(0.), __lCoeffs(nullptr), __mCoeffs(nullptr),
95  __rCoeffs(nullptr) {
96  if (copyLeft) {
97  __lCoeffs = new HashTable< LpCol, double >(*expr.__lCoeffs);
98  __lValue = expr.__lValue;
99  __ileft = true;
100  } else
101  __lCoeffs = new HashTable< LpCol, double >();
102 
103  if (copyMiddle) {
104  __mCoeffs = new HashTable< LpCol, double >(*expr.__mCoeffs);
105  __mValue = expr.__mValue;
106  __imiddle = true;
107  } else
108  __mCoeffs = new HashTable< LpCol, double >();
109 
110  if (copyRight) {
111  __rCoeffs = new HashTable< LpCol, double >(*expr.__rCoeffs);
112  __rValue = expr.__rValue;
113  __iright = true;
114  } else
115  __rCoeffs = new HashTable< LpCol, double >();
116 
117  GUM_CONS_CPY(LpExpr);
118  }
bool __ileft
True if this expression has a non-empty left side L : L <= M <= R .
Definition: LpInterface.h:415
bool __iright
True if this expression has a non-empty right side R : L <= M <= R .
Definition: LpInterface.h:423
HashTable< LpCol, double > * __mCoeffs
The coefficients of each variable on the middle side L : L <= M <= R.
Definition: LpInterface.h:439
double __mValue
The constant on the middle side L : L <= M <= R.
Definition: LpInterface.h:428
LpExpr()
Default constructor.
double __rValue
The constant on the right side L : L <= M <= R.
Definition: LpInterface.h:430
HashTable< LpCol, double > * __rCoeffs
The coefficients of each variable on the right side L : L <= M <= R.
Definition: LpInterface.h:443
double __lValue
The constant on the left side L : L <= M <= R.
Definition: LpInterface.h:426
HashTable< LpCol, double > * __lCoeffs
The coefficients of each variable on the left side L : L <= M <= R.
Definition: LpInterface.h:435
bool __imiddle
True if this expression has a non-empty middle side M ( the default ) : L <= M <= R ...
Definition: LpInterface.h:419

◆ LpExpr() [4/5]

gum::credal::lp::LpExpr::LpExpr ( LpExpr &&  expr)

Move copy constructor from temporary.

Swap ressources between the temporary expr and the caller instead of copying the temporary.

Parameters
exprThe temporary expression to move to this.

Definition at line 120 of file LpInterface_tpl.h.

120  :
121  __ileft(expr.__ileft), __imiddle(expr.__imiddle),
122  __iright(expr.__iright), __lValue(expr.__lValue),
123  __mValue(expr.__mValue), __rValue(expr.__rValue),
124  __lCoeffs(expr.__lCoeffs), __mCoeffs(expr.__mCoeffs),
125  __rCoeffs(expr.__rCoeffs) {
126  expr.__lCoeffs = nullptr;
127  expr.__mCoeffs = nullptr;
128  expr.__rCoeffs = nullptr;
129 
130  GUM_CONS_CPY(LpExpr);
131  }
bool __ileft
True if this expression has a non-empty left side L : L <= M <= R .
Definition: LpInterface.h:415
bool __iright
True if this expression has a non-empty right side R : L <= M <= R .
Definition: LpInterface.h:423
HashTable< LpCol, double > * __mCoeffs
The coefficients of each variable on the middle side L : L <= M <= R.
Definition: LpInterface.h:439
double __mValue
The constant on the middle side L : L <= M <= R.
Definition: LpInterface.h:428
LpExpr()
Default constructor.
double __rValue
The constant on the right side L : L <= M <= R.
Definition: LpInterface.h:430
HashTable< LpCol, double > * __rCoeffs
The coefficients of each variable on the right side L : L <= M <= R.
Definition: LpInterface.h:443
double __lValue
The constant on the left side L : L <= M <= R.
Definition: LpInterface.h:426
HashTable< LpCol, double > * __lCoeffs
The coefficients of each variable on the left side L : L <= M <= R.
Definition: LpInterface.h:435
bool __imiddle
True if this expression has a non-empty middle side M ( the default ) : L <= M <= R ...
Definition: LpInterface.h:419

◆ LpExpr() [5/5]

gum::credal::lp::LpExpr::LpExpr ( LpExpr &&  expr,
bool  copyLeft,
bool  copyMiddle,
bool  copyRight 
)

Move copy constructor from temporary.

Makes ( partial ) moves.

Warning
Proceed with care; partial moves are dangerous because the object being moved may still briefly exist after being moved and could be used afterward.
Parameters
exprThe temporary expression to ( partially ) move to this.
copyLeftTrue if we want to copy left side of expr, False otherwise.
copyMiddleTrue if we want to copy middle side of expr, False otherwise.
copyRightTrue if we want to copy right side of expr, False otherwise.

Definition at line 133 of file LpInterface_tpl.h.

References __ileft, __imiddle, __iright, __lCoeffs, __lValue, __mCoeffs, __mValue, __rCoeffs, __rValue, and gum::credal::lp::swap().

136  :
137  __ileft(false),
138  __imiddle(false), __iright(false), __lValue(0.), __mValue(0.),
139  __rValue(0.), __lCoeffs(nullptr), __mCoeffs(nullptr),
140  __rCoeffs(nullptr) {
141  if (copyLeft) {
142  swap(__lCoeffs, expr.__lCoeffs);
143  __lValue = expr.__lValue;
144  __ileft = true;
145  } else
146  __lCoeffs = new HashTable< LpCol, double >();
147 
148  if (copyMiddle) {
149  swap(__mCoeffs, expr.__mCoeffs);
150  __mValue = expr.__mValue;
151  __imiddle = true;
152  } else
153  __mCoeffs = new HashTable< LpCol, double >();
154 
155  if (copyRight) {
156  swap(__rCoeffs, expr.__rCoeffs);
157  __rValue = expr.__rValue;
158  __iright = true;
159  } else
160  __rCoeffs = new HashTable< LpCol, double >();
161 
162  GUM_CONS_CPY(LpExpr);
163  }
bool __ileft
True if this expression has a non-empty left side L : L <= M <= R .
Definition: LpInterface.h:415
bool __iright
True if this expression has a non-empty right side R : L <= M <= R .
Definition: LpInterface.h:423
HashTable< LpCol, double > * __mCoeffs
The coefficients of each variable on the middle side L : L <= M <= R.
Definition: LpInterface.h:439
void swap(HashTable< LpCol, double > *&a, HashTable< LpCol, double > *&b)
Swap the addresses of two pointers to hashTables.
double __mValue
The constant on the middle side L : L <= M <= R.
Definition: LpInterface.h:428
LpExpr()
Default constructor.
double __rValue
The constant on the right side L : L <= M <= R.
Definition: LpInterface.h:430
HashTable< LpCol, double > * __rCoeffs
The coefficients of each variable on the right side L : L <= M <= R.
Definition: LpInterface.h:443
double __lValue
The constant on the left side L : L <= M <= R.
Definition: LpInterface.h:426
HashTable< LpCol, double > * __lCoeffs
The coefficients of each variable on the left side L : L <= M <= R.
Definition: LpInterface.h:435
bool __imiddle
True if this expression has a non-empty middle side M ( the default ) : L <= M <= R ...
Definition: LpInterface.h:419
+ Here is the call graph for this function:

◆ ~LpExpr()

gum::credal::lp::LpExpr::~LpExpr ( )

Default destructor.

Definition at line 165 of file LpInterface_tpl.h.

References __lCoeffs, __mCoeffs, and __rCoeffs.

165  {
166  delete __lCoeffs;
167  delete __mCoeffs;
168  delete __rCoeffs;
169 
170  GUM_DESTRUCTOR(LpExpr);
171  }
HashTable< LpCol, double > * __mCoeffs
The coefficients of each variable on the middle side L : L <= M <= R.
Definition: LpInterface.h:439
LpExpr()
Default constructor.
HashTable< LpCol, double > * __rCoeffs
The coefficients of each variable on the right side L : L <= M <= R.
Definition: LpInterface.h:443
HashTable< LpCol, double > * __lCoeffs
The coefficients of each variable on the left side L : L <= M <= R.
Definition: LpInterface.h:435

Member Function Documentation

◆ __addSide() [1/4]

void gum::credal::lp::LpExpr::__addSide ( const LpCol from)
inlineprivate

Set the side of the calling expression, from LEFT TO RIGHT : L <= M <= R.

Parameters
fromthe constant reference to the variable ( the side ) to put on the first empty side met, starting at left.

Definition at line 341 of file LpInterface_tpl.h.

References __ileft, __imiddle, __iright, __lCoeffs, __mCoeffs, __rCoeffs, and GUM_ERROR.

Referenced by lessThan().

341  {
342  if (!__ileft) {
343  __lCoeffs->insert(from, 1.);
344  __ileft = true;
345  } else if (!__imiddle) {
346  __mCoeffs->insert(from, 1.);
347  __imiddle = true;
348  } else if (!__iright) {
349  __rCoeffs->insert(from, 1.);
350  __iright = true;
351  } else
352  GUM_ERROR(OperationNotAllowed,
353  "LpExpr::setSide ( const LpCol & from "
354  ") : too many <= ; no free side");
355  }
bool __ileft
True if this expression has a non-empty left side L : L <= M <= R .
Definition: LpInterface.h:415
bool __iright
True if this expression has a non-empty right side R : L <= M <= R .
Definition: LpInterface.h:423
HashTable< LpCol, double > * __mCoeffs
The coefficients of each variable on the middle side L : L <= M <= R.
Definition: LpInterface.h:439
HashTable< LpCol, double > * __rCoeffs
The coefficients of each variable on the right side L : L <= M <= R.
Definition: LpInterface.h:443
HashTable< LpCol, double > * __lCoeffs
The coefficients of each variable on the left side L : L <= M <= R.
Definition: LpInterface.h:435
bool __imiddle
True if this expression has a non-empty middle side M ( the default ) : L <= M <= R ...
Definition: LpInterface.h:419
#define GUM_ERROR(type, msg)
Definition: exceptions.h:55
+ Here is the caller graph for this function:

◆ __addSide() [2/4]

void gum::credal::lp::LpExpr::__addSide ( const LpExpr from)
inlineprivate

Copy an expression to a side of the calling expression, from LEFT TO RIGHT : L <= M <= R.

Parameters
fromthe constant reference to the expression ( the side ) to copy on the first empty side met, starting at left.

Definition at line 357 of file LpInterface_tpl.h.

References __ileft, __imiddle, __iright, __lCoeffs, __lValue, __mCoeffs, __mValue, __rCoeffs, __rValue, and GUM_ERROR.

357  {
358  if (__ileft && __iright && from.__imiddle)
359  GUM_ERROR(OperationNotAllowed,
360  "LpExpr::setSide ( const LpCol & from "
361  ") : too many <= ; no free side");
362 
364  if (!from.__imiddle) return;
365 
369  if (!from.__ileft && !from.__iright) {
370  if (!__ileft) {
371  *__lCoeffs = *from.__mCoeffs;
372  __lValue = from.__mValue;
373  __ileft = true;
374 
375  return;
376  } else if (!__imiddle) {
377  *__mCoeffs = *from.__mCoeffs;
378  __mValue = from.__mValue;
379  __imiddle = true;
380 
381  return;
382  } else if (!__iright) {
383  *__rCoeffs = *from.__mCoeffs;
384  __rValue = from.__mValue;
385  __iright = true;
386 
387  return;
388  } else
389  GUM_ERROR(OperationNotAllowed,
390  "LpExpr::setSide ( const LpCol & from ) "
391  ": too many <= ; no free side");
392  }
395  else if (from.__ileft && !from.__iright) {
396  if (!__ileft) {
397  *__lCoeffs = *from.__lCoeffs;
398  __lValue = from.__lValue;
399  __ileft = true;
400 
401  *__mCoeffs = *from.__mCoeffs;
402  __mValue = from.__mValue;
403  __imiddle = true;
404 
405  return;
406  } else if (!__imiddle && !__iright) {
407  *__mCoeffs = *from.__lCoeffs;
408  __mValue = from.__lValue;
409  __imiddle = true;
410 
411  *__rCoeffs = *from.__mCoeffs;
412  __rValue = from.__mValue;
413  __iright = true;
414 
415  return;
416  } else
417  GUM_ERROR(OperationNotAllowed,
418  "LpExpr::setSide ( const LpCol & from ) "
419  ": too many <= ; no free side");
420  }
423  else if (from.__ileft && from.__iright) {
424  if (__ileft || __imiddle || __iright)
425  GUM_ERROR(OperationNotAllowed,
426  "LpExpr::setSide ( const LpCol & from ) "
427  ": too many <= ; no free side");
428 
429  *this = from;
430 
431  return;
432  } else
433  GUM_ERROR(OperationNotAllowed,
434  "LpExpr::setSide ( const LpCol & from "
435  ") : too many <= ; no free side");
436  }
bool __ileft
True if this expression has a non-empty left side L : L <= M <= R .
Definition: LpInterface.h:415
bool __iright
True if this expression has a non-empty right side R : L <= M <= R .
Definition: LpInterface.h:423
HashTable< LpCol, double > * __mCoeffs
The coefficients of each variable on the middle side L : L <= M <= R.
Definition: LpInterface.h:439
double __mValue
The constant on the middle side L : L <= M <= R.
Definition: LpInterface.h:428
double __rValue
The constant on the right side L : L <= M <= R.
Definition: LpInterface.h:430
HashTable< LpCol, double > * __rCoeffs
The coefficients of each variable on the right side L : L <= M <= R.
Definition: LpInterface.h:443
double __lValue
The constant on the left side L : L <= M <= R.
Definition: LpInterface.h:426
HashTable< LpCol, double > * __lCoeffs
The coefficients of each variable on the left side L : L <= M <= R.
Definition: LpInterface.h:435
bool __imiddle
True if this expression has a non-empty middle side M ( the default ) : L <= M <= R ...
Definition: LpInterface.h:419
#define GUM_ERROR(type, msg)
Definition: exceptions.h:55

◆ __addSide() [3/4]

void gum::credal::lp::LpExpr::__addSide ( LpExpr &&  from)
inlineprivate

Move an expression to a side of the calling expression, from LEFT TO RIGHT : L <= M <= R.

Parameters
fromthe expression ( the side ) to move on the first empty side met, starting at left.

Definition at line 438 of file LpInterface_tpl.h.

References __ileft, __imiddle, __iright, __lCoeffs, __lValue, __mCoeffs, __mValue, __rCoeffs, __rValue, GUM_ERROR, and gum::credal::lp::swap().

438  {
440  if (__ileft && __iright && from.__imiddle)
441  GUM_ERROR(OperationNotAllowed,
442  "LpExpr::setSide ( const LpCol & from "
443  ") : too many <= ; no free side");
444 
446  if (!from.__imiddle) return;
447 
451  if (!from.__ileft && !from.__iright) {
452  if (!__ileft) {
454  swap(__lCoeffs, from.__mCoeffs);
455  __lValue = from.__mValue;
456  __ileft = true;
457 
458  return;
459  } else if (!__imiddle) {
461  swap(__mCoeffs, from.__mCoeffs);
462  __mValue = from.__mValue;
463  __imiddle = true;
464 
465  return;
466  } else if (!__iright) {
468  swap(__rCoeffs, from.__mCoeffs);
469  __rValue = from.__mValue;
470  __iright = true;
471 
472  return;
473  } else
474  GUM_ERROR(OperationNotAllowed,
475  "LpExpr::setSide ( const LpCol & from ) "
476  ": too many <= ; no free side");
477  }
480  else if (from.__ileft && !from.__iright) {
481  if (!__ileft) {
483  swap(__lCoeffs, from.__lCoeffs);
484  __lValue = from.__lValue;
485  __ileft = true;
486 
488  swap(__mCoeffs, from.__mCoeffs);
489  __mValue = from.__mValue;
490  __imiddle = true;
491 
492  return;
493  } else if (!__imiddle && !__iright) {
495  swap(__mCoeffs, from.__lCoeffs);
496  __mValue = from.__lValue;
497  __imiddle = true;
498 
500  swap(__rCoeffs, from.__mCoeffs);
501  __rValue = from.__mValue;
502  __iright = true;
503 
504  return;
505  } else
506  GUM_ERROR(OperationNotAllowed,
507  "LpExpr::setSide ( const LpCol & from ) "
508  ": too many <= ; no free side");
509  }
512  else if (from.__ileft && from.__iright) {
513  if (__ileft || __imiddle || __iright)
514  GUM_ERROR(OperationNotAllowed,
515  "LpExpr::setSide ( const LpCol & from ) "
516  ": too many <= ; no free side");
517 
518  *this = std::move(from);
519 
520  return;
521  } else
522  GUM_ERROR(OperationNotAllowed,
523  "LpExpr::setSide ( const LpCol & from "
524  ") : too many <= ; no free side");
525  }
bool __ileft
True if this expression has a non-empty left side L : L <= M <= R .
Definition: LpInterface.h:415
bool __iright
True if this expression has a non-empty right side R : L <= M <= R .
Definition: LpInterface.h:423
HashTable< LpCol, double > * __mCoeffs
The coefficients of each variable on the middle side L : L <= M <= R.
Definition: LpInterface.h:439
void swap(HashTable< LpCol, double > *&a, HashTable< LpCol, double > *&b)
Swap the addresses of two pointers to hashTables.
double __mValue
The constant on the middle side L : L <= M <= R.
Definition: LpInterface.h:428
double __rValue
The constant on the right side L : L <= M <= R.
Definition: LpInterface.h:430
HashTable< LpCol, double > * __rCoeffs
The coefficients of each variable on the right side L : L <= M <= R.
Definition: LpInterface.h:443
double __lValue
The constant on the left side L : L <= M <= R.
Definition: LpInterface.h:426
HashTable< LpCol, double > * __lCoeffs
The coefficients of each variable on the left side L : L <= M <= R.
Definition: LpInterface.h:435
bool __imiddle
True if this expression has a non-empty middle side M ( the default ) : L <= M <= R ...
Definition: LpInterface.h:419
#define GUM_ERROR(type, msg)
Definition: exceptions.h:55
+ Here is the call graph for this function:

◆ __addSide() [4/4]

template<typename SCALAR >
void gum::credal::lp::LpExpr::__addSide ( const SCALAR &  from)
inlineprivate

Set the side of the calling expression, from LEFT TO RIGHT : L <= M <= R.

Template Parameters
SCALARA scalar type ( integer or float ( any precision ) ).
Parameters
fromthe constant reference to the scalar ( the side ) to put on the first empty side met, starting at left.

Definition at line 528 of file LpInterface_tpl.h.

References __ileft, __imiddle, __iright, __lValue, __mValue, __rValue, and GUM_ERROR.

528  {
529  if (!__ileft) {
530  __lValue = from;
531  __ileft = true;
532  } else if (!__imiddle) {
533  __mValue = from;
534  __imiddle = true;
535  } else if (!__iright) {
536  __rValue = from;
537  __iright = true;
538  } else
539  GUM_ERROR(OperationNotAllowed,
540  "LpExpr::setSide ( const LpCol & from "
541  ") : too many <= ; no free side");
542  }
bool __ileft
True if this expression has a non-empty left side L : L <= M <= R .
Definition: LpInterface.h:415
bool __iright
True if this expression has a non-empty right side R : L <= M <= R .
Definition: LpInterface.h:423
double __mValue
The constant on the middle side L : L <= M <= R.
Definition: LpInterface.h:428
double __rValue
The constant on the right side L : L <= M <= R.
Definition: LpInterface.h:430
double __lValue
The constant on the left side L : L <= M <= R.
Definition: LpInterface.h:426
bool __imiddle
True if this expression has a non-empty middle side M ( the default ) : L <= M <= R ...
Definition: LpInterface.h:419
#define GUM_ERROR(type, msg)
Definition: exceptions.h:55

◆ clear()

void gum::credal::lp::LpExpr::clear ( )

Clear all data of the calling expression as if it was constructed.

Definition at line 544 of file LpInterface_tpl.h.

References __ileft, __imiddle, __iright, __lCoeffs, __lValue, __mCoeffs, __mValue, __rCoeffs, and __rValue.

Referenced by operator=().

544  {
545  __lCoeffs->clear();
546  __mCoeffs->clear();
547  __rCoeffs->clear();
548 
549  __lValue = 0.;
550  __mValue = 0.;
551  __rValue = 0.;
552 
553  __ileft = false;
554  __imiddle = false;
555  __iright = false;
556  }
bool __ileft
True if this expression has a non-empty left side L : L <= M <= R .
Definition: LpInterface.h:415
bool __iright
True if this expression has a non-empty right side R : L <= M <= R .
Definition: LpInterface.h:423
HashTable< LpCol, double > * __mCoeffs
The coefficients of each variable on the middle side L : L <= M <= R.
Definition: LpInterface.h:439
double __mValue
The constant on the middle side L : L <= M <= R.
Definition: LpInterface.h:428
double __rValue
The constant on the right side L : L <= M <= R.
Definition: LpInterface.h:430
HashTable< LpCol, double > * __rCoeffs
The coefficients of each variable on the right side L : L <= M <= R.
Definition: LpInterface.h:443
double __lValue
The constant on the left side L : L <= M <= R.
Definition: LpInterface.h:426
HashTable< LpCol, double > * __lCoeffs
The coefficients of each variable on the left side L : L <= M <= R.
Definition: LpInterface.h:435
bool __imiddle
True if this expression has a non-empty middle side M ( the default ) : L <= M <= R ...
Definition: LpInterface.h:419
+ Here is the caller graph for this function:

◆ lessThan() [1/2]

template<typename T1 , typename T2 >
static LpExpr gum::credal::lp::LpExpr::lessThan ( T1 &&  lhs,
T2 &&  rhs 
)
static

Referenced by gum::credal::lp::operator<=().

+ Here is the caller graph for this function:

◆ lessThan() [2/2]

template<typename T1 , typename T2 >
INLINE LpExpr gum::credal::lp::LpExpr::lessThan ( T1 &&  lhs,
T2 &&  rhs 
)

Definition at line 1172 of file LpInterface_tpl.h.

References __addSide().

1172  {
1173  LpExpr expr;
1174  expr.__addSide(std::forward< T1 >(lhs));
1175  expr.__addSide(std::forward< T2 >(rhs));
1176  return expr;
1177  }
LpExpr()
Default constructor.
+ Here is the call graph for this function:

◆ multiply() [1/2]

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

Referenced by gum::credal::lp::operator*().

+ Here is the caller graph for this function:

◆ multiply() [2/2]

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

Definition at line 1153 of file LpInterface_tpl.h.

References __imiddle, and __mCoeffs.

1153  {
1154  LpExpr expr;
1155  expr.__mCoeffs->insert(rhs, lhs);
1156  expr.__imiddle = true;
1157  return expr;
1158  }
LpExpr()
Default constructor.

◆ operator+=() [1/4]

LpExpr & gum::credal::lp::LpExpr::operator+= ( const LpCol rhs)

Compound assignment operator += with a variable.

Parameters
rhsthe constant reference to the variable to add to the calling expression.
Returns
The reference of the calling expression.

Definition at line 230 of file LpInterface_tpl.h.

References __ileft, __imiddle, __iright, __mCoeffs, and GUM_ERROR.

230  {
231  if (__ileft || __iright)
232  GUM_ERROR(OperationNotAllowed,
233  "expr::operator+= (expr) : <= present on one side of expr");
234 
235  if (!__imiddle) __imiddle = true;
236 
237  __mCoeffs->getWithDefault(rhs, 0.) += 1.;
238 
239  return *this;
240  }
bool __ileft
True if this expression has a non-empty left side L : L <= M <= R .
Definition: LpInterface.h:415
bool __iright
True if this expression has a non-empty right side R : L <= M <= R .
Definition: LpInterface.h:423
HashTable< LpCol, double > * __mCoeffs
The coefficients of each variable on the middle side L : L <= M <= R.
Definition: LpInterface.h:439
bool __imiddle
True if this expression has a non-empty middle side M ( the default ) : L <= M <= R ...
Definition: LpInterface.h:419
#define GUM_ERROR(type, msg)
Definition: exceptions.h:55

◆ operator+=() [2/4]

LpExpr & gum::credal::lp::LpExpr::operator+= ( const LpExpr rhs)

Compound assignment operator += with another expression.

Parameters
rhsthe constant reference to the expression to add to the calling expression.
Returns
The reference of the calling expression.

Definition at line 242 of file LpInterface_tpl.h.

References __ileft, __imiddle, __iright, __mCoeffs, __mValue, and GUM_ERROR.

242  {
243  if (__ileft || __iright || rhs.__ileft || rhs.__iright)
244  GUM_ERROR(OperationNotAllowed,
245  "expr::operator+= (rhs) : <= present "
246  "on one side of rhs and/or expr");
247 
248  if (!__imiddle) __imiddle = true;
249 
250  for (const auto& elt : *rhs.__mCoeffs)
251  __mCoeffs->getWithDefault(elt.first, 0.) += elt.second;
252 
253  __mValue += rhs.__mValue;
254 
255  return *this;
256  }
bool __ileft
True if this expression has a non-empty left side L : L <= M <= R .
Definition: LpInterface.h:415
bool __iright
True if this expression has a non-empty right side R : L <= M <= R .
Definition: LpInterface.h:423
HashTable< LpCol, double > * __mCoeffs
The coefficients of each variable on the middle side L : L <= M <= R.
Definition: LpInterface.h:439
double __mValue
The constant on the middle side L : L <= M <= R.
Definition: LpInterface.h:428
bool __imiddle
True if this expression has a non-empty middle side M ( the default ) : L <= M <= R ...
Definition: LpInterface.h:419
#define GUM_ERROR(type, msg)
Definition: exceptions.h:55

◆ operator+=() [3/4]

LpExpr & gum::credal::lp::LpExpr::operator+= ( LpExpr &&  rhs)

Compound assignment operator += with another temporary expression.

Parameters
rhsthe temporary expression to add to the calling expression.
Returns
The reference of the calling expression.

Definition at line 258 of file LpInterface_tpl.h.

References __ileft, __imiddle, __iright, __mCoeffs, __mValue, GUM_ERROR, and gum::credal::lp::swap().

258  {
259  if (__ileft || __iright || rhs.__ileft || rhs.__iright)
260  GUM_ERROR(OperationNotAllowed,
261  "expr::operator+= (rhs) : <= present "
262  "on one side of rhs and/or expr");
263 
264  if (!__imiddle) {
265  __imiddle = true;
266 
267  __mValue = rhs.__mValue;
268 
269  swap(__mCoeffs, rhs.__mCoeffs);
270 
271  return *this;
272  }
273 
274  for (const auto& elt : *rhs.__mCoeffs)
275  __mCoeffs->getWithDefault(elt.first, 0.) += elt.second;
276 
277  __mValue += rhs.__mValue;
278 
279  return *this;
280  }
bool __ileft
True if this expression has a non-empty left side L : L <= M <= R .
Definition: LpInterface.h:415
bool __iright
True if this expression has a non-empty right side R : L <= M <= R .
Definition: LpInterface.h:423
HashTable< LpCol, double > * __mCoeffs
The coefficients of each variable on the middle side L : L <= M <= R.
Definition: LpInterface.h:439
void swap(HashTable< LpCol, double > *&a, HashTable< LpCol, double > *&b)
Swap the addresses of two pointers to hashTables.
double __mValue
The constant on the middle side L : L <= M <= R.
Definition: LpInterface.h:428
bool __imiddle
True if this expression has a non-empty middle side M ( the default ) : L <= M <= R ...
Definition: LpInterface.h:419
#define GUM_ERROR(type, msg)
Definition: exceptions.h:55
+ Here is the call graph for this function:

◆ operator+=() [4/4]

template<typename T >
LpExpr & gum::credal::lp::LpExpr::operator+= ( const T &  rhs)

Compound assignment operator += with a scalar.

Template Parameters
SCALARA scalar type ( integer or float ( any precision ) ).
Parameters
rhsthe constant reference to the scalar to add to the calling expression.
Returns
The reference of the calling expression.

Definition at line 283 of file LpInterface_tpl.h.

References __ileft, __imiddle, __iright, __mValue, and GUM_ERROR.

283  {
284  if (__ileft || __iright)
285  GUM_ERROR(OperationNotAllowed,
286  "expr::operator+= (expr) : <= present on one side of expr");
287 
288  if (!__imiddle) __imiddle = true;
289 
290  __mValue += rhs;
291 
292  return *this;
293  }
bool __ileft
True if this expression has a non-empty left side L : L <= M <= R .
Definition: LpInterface.h:415
bool __iright
True if this expression has a non-empty right side R : L <= M <= R .
Definition: LpInterface.h:423
double __mValue
The constant on the middle side L : L <= M <= R.
Definition: LpInterface.h:428
bool __imiddle
True if this expression has a non-empty middle side M ( the default ) : L <= M <= R ...
Definition: LpInterface.h:419
#define GUM_ERROR(type, msg)
Definition: exceptions.h:55

◆ operator-=() [1/3]

LpExpr & gum::credal::lp::LpExpr::operator-= ( const LpCol rhs)

Compound assignment operator -= with a variable.

Parameters
rhsthe constant reference to the variable to substract from the calling expression.
Returns
The reference of the calling expression.

Definition at line 295 of file LpInterface_tpl.h.

References __ileft, __imiddle, __iright, __mCoeffs, and GUM_ERROR.

295  {
296  if (__ileft || __iright)
297  GUM_ERROR(OperationNotAllowed,
298  "expr::operator-= (rhs) : <= present in one of expr");
299 
300  if (!__imiddle) __imiddle = true;
301 
302  __mCoeffs->getWithDefault(rhs, 0.) -= 1.;
303 
304  return *this;
305  }
bool __ileft
True if this expression has a non-empty left side L : L <= M <= R .
Definition: LpInterface.h:415
bool __iright
True if this expression has a non-empty right side R : L <= M <= R .
Definition: LpInterface.h:423
HashTable< LpCol, double > * __mCoeffs
The coefficients of each variable on the middle side L : L <= M <= R.
Definition: LpInterface.h:439
bool __imiddle
True if this expression has a non-empty middle side M ( the default ) : L <= M <= R ...
Definition: LpInterface.h:419
#define GUM_ERROR(type, msg)
Definition: exceptions.h:55

◆ operator-=() [2/3]

LpExpr & gum::credal::lp::LpExpr::operator-= ( const LpExpr rhs)

Compound assignment operator -= with another expression.

Parameters
rhsthe constant reference to the expression to substract from the calling expression.
Returns
The reference of the calling expression.

Definition at line 307 of file LpInterface_tpl.h.

References __ileft, __imiddle, __iright, __mCoeffs, __mValue, and GUM_ERROR.

307  {
308  if (__ileft || __iright || rhs.__ileft || rhs.__iright)
309  GUM_ERROR(
310  OperationNotAllowed,
311  "expr::operator-= (rhs) : <= present in one of rhs and/or expr");
312 
313  if (!__imiddle) __imiddle = true;
314 
315  for (const auto& elt : *rhs.__mCoeffs)
316  __mCoeffs->getWithDefault(elt.first, 0.) -= elt.second;
317 
318  __mValue -= rhs.__mValue;
319 
320  return *this;
321  }
bool __ileft
True if this expression has a non-empty left side L : L <= M <= R .
Definition: LpInterface.h:415
bool __iright
True if this expression has a non-empty right side R : L <= M <= R .
Definition: LpInterface.h:423
HashTable< LpCol, double > * __mCoeffs
The coefficients of each variable on the middle side L : L <= M <= R.
Definition: LpInterface.h:439
double __mValue
The constant on the middle side L : L <= M <= R.
Definition: LpInterface.h:428
bool __imiddle
True if this expression has a non-empty middle side M ( the default ) : L <= M <= R ...
Definition: LpInterface.h:419
#define GUM_ERROR(type, msg)
Definition: exceptions.h:55

◆ operator-=() [3/3]

template<typename T >
LpExpr & gum::credal::lp::LpExpr::operator-= ( const T &  rhs)

Compound assignment operator -= with a salar.

Template Parameters
SCALARA scalar type ( integer or float ( any precision ) ).
Parameters
rhsthe constant reference to the scalar to substract from the calling expression.
Returns
The reference of the calling expression.

Definition at line 324 of file LpInterface_tpl.h.

References __ileft, __imiddle, __iright, __mValue, and GUM_ERROR.

324  {
325  if (__ileft || __iright)
326  GUM_ERROR(OperationNotAllowed,
327  "expr::operator-= (rhs) : <= present in one of expr");
328 
329  if (!__imiddle) __imiddle = true;
330 
331  __mValue -= rhs;
332 
333  return *this;
334  }
bool __ileft
True if this expression has a non-empty left side L : L <= M <= R .
Definition: LpInterface.h:415
bool __iright
True if this expression has a non-empty right side R : L <= M <= R .
Definition: LpInterface.h:423
double __mValue
The constant on the middle side L : L <= M <= R.
Definition: LpInterface.h:428
bool __imiddle
True if this expression has a non-empty middle side M ( the default ) : L <= M <= R ...
Definition: LpInterface.h:419
#define GUM_ERROR(type, msg)
Definition: exceptions.h:55

◆ operator=() [1/4]

LpExpr & gum::credal::lp::LpExpr::operator= ( const LpCol rhs)

Assignment operator = with a variable.

Parameters
rhsthe constant reference to the variable to form an expression with.
Returns
The address of the calling expression.

Definition at line 173 of file LpInterface_tpl.h.

References __imiddle, __mCoeffs, and clear().

173  {
174  clear();
175 
176  __mCoeffs->insert(rhs, 1.);
177  __imiddle = true;
178 
179  return *this;
180  }
HashTable< LpCol, double > * __mCoeffs
The coefficients of each variable on the middle side L : L <= M <= R.
Definition: LpInterface.h:439
void clear()
Clear all data of the calling expression as if it was constructed.
bool __imiddle
True if this expression has a non-empty middle side M ( the default ) : L <= M <= R ...
Definition: LpInterface.h:419
+ Here is the call graph for this function:

◆ operator=() [2/4]

LpExpr & gum::credal::lp::LpExpr::operator= ( const LpExpr rhs)

Assignment operator = with another expression, by copy.

Parameters
rhsthe constant reference to the expression to copy.
Returns
The address of the calling expression.

Definition at line 182 of file LpInterface_tpl.h.

References __ileft, __imiddle, __iright, __lCoeffs, __lValue, __mCoeffs, __mValue, __rCoeffs, and __rValue.

182  {
184  if (this == &rhs) return *this;
185 
186  *__lCoeffs = *rhs.__lCoeffs;
187  *__mCoeffs = *rhs.__mCoeffs;
188  *__rCoeffs = *rhs.__rCoeffs;
189 
190  __lValue = rhs.__lValue;
191  __mValue = rhs.__mValue;
192  __rValue = rhs.__rValue;
193 
194  __ileft = rhs.__ileft;
195  __imiddle = rhs.__imiddle;
196  __iright = rhs.__iright;
197 
198  return *this;
199  }
bool __ileft
True if this expression has a non-empty left side L : L <= M <= R .
Definition: LpInterface.h:415
bool __iright
True if this expression has a non-empty right side R : L <= M <= R .
Definition: LpInterface.h:423
HashTable< LpCol, double > * __mCoeffs
The coefficients of each variable on the middle side L : L <= M <= R.
Definition: LpInterface.h:439
double __mValue
The constant on the middle side L : L <= M <= R.
Definition: LpInterface.h:428
double __rValue
The constant on the right side L : L <= M <= R.
Definition: LpInterface.h:430
HashTable< LpCol, double > * __rCoeffs
The coefficients of each variable on the right side L : L <= M <= R.
Definition: LpInterface.h:443
double __lValue
The constant on the left side L : L <= M <= R.
Definition: LpInterface.h:426
HashTable< LpCol, double > * __lCoeffs
The coefficients of each variable on the left side L : L <= M <= R.
Definition: LpInterface.h:435
bool __imiddle
True if this expression has a non-empty middle side M ( the default ) : L <= M <= R ...
Definition: LpInterface.h:419

◆ operator=() [3/4]

LpExpr & gum::credal::lp::LpExpr::operator= ( LpExpr &&  rhs)

Assignment operator = with another expression, by move.

Parameters
rhsthe expression to move to this.
Returns
The address of the calling expression.

Definition at line 201 of file LpInterface_tpl.h.

References __ileft, __imiddle, __iright, __lCoeffs, __lValue, __mCoeffs, __mValue, __rCoeffs, __rValue, and gum::credal::lp::swap().

201  {
203  if (this == &rhs) return *this;
204 
205  swap(__lCoeffs, rhs.__lCoeffs);
206  swap(__mCoeffs, rhs.__mCoeffs);
207  swap(__rCoeffs, rhs.__rCoeffs);
208 
209  __lValue = rhs.__lValue;
210  __mValue = rhs.__mValue;
211  __rValue = rhs.__rValue;
212 
213  __ileft = rhs.__ileft;
214  __imiddle = rhs.__imiddle;
215  __iright = rhs.__iright;
216 
217  return *this;
218  }
bool __ileft
True if this expression has a non-empty left side L : L <= M <= R .
Definition: LpInterface.h:415
bool __iright
True if this expression has a non-empty right side R : L <= M <= R .
Definition: LpInterface.h:423
HashTable< LpCol, double > * __mCoeffs
The coefficients of each variable on the middle side L : L <= M <= R.
Definition: LpInterface.h:439
void swap(HashTable< LpCol, double > *&a, HashTable< LpCol, double > *&b)
Swap the addresses of two pointers to hashTables.
double __mValue
The constant on the middle side L : L <= M <= R.
Definition: LpInterface.h:428
double __rValue
The constant on the right side L : L <= M <= R.
Definition: LpInterface.h:430
HashTable< LpCol, double > * __rCoeffs
The coefficients of each variable on the right side L : L <= M <= R.
Definition: LpInterface.h:443
double __lValue
The constant on the left side L : L <= M <= R.
Definition: LpInterface.h:426
HashTable< LpCol, double > * __lCoeffs
The coefficients of each variable on the left side L : L <= M <= R.
Definition: LpInterface.h:435
bool __imiddle
True if this expression has a non-empty middle side M ( the default ) : L <= M <= R ...
Definition: LpInterface.h:419
+ Here is the call graph for this function:

◆ operator=() [4/4]

template<typename SCALAR >
LpExpr & gum::credal::lp::LpExpr::operator= ( const SCALAR &  rhs)

Assignment operator = with a scalar.

Template Parameters
SCALARA scalar type ( integer or float ( any precision ) ).
Parameters
rhsthe constant reference to the scalar to form an expression with.
Returns
The address of the calling expression.

Definition at line 221 of file LpInterface_tpl.h.

References __imiddle, __mValue, and clear().

221  {
222  clear();
223 
224  __mValue = rhs;
225  __imiddle = true;
226 
227  return *this;
228  }
double __mValue
The constant on the middle side L : L <= M <= R.
Definition: LpInterface.h:428
void clear()
Clear all data of the calling expression as if it was constructed.
bool __imiddle
True if this expression has a non-empty middle side M ( the default ) : L <= M <= R ...
Definition: LpInterface.h:419
+ Here is the call graph for this function:

◆ toString()

std::string gum::credal::lp::LpExpr::toString ( ) const

Get the string representation of a calling expression.

Returns
The string representation of the calling expression.

Definition at line 558 of file LpInterface_tpl.h.

References __lCoeffs, __lValue, __mCoeffs, __mValue, __rCoeffs, and __rValue.

Referenced by gum::credal::lp::LpInterface< GUM_SCALAR >::addRow(), gum::credal::lp::LpRow::LpRow(), and gum::credal::lp::operator<<().

558  {
559  std::ostringstream s;
560 
561  s << std::endl << "left side : " << std::endl;
562 
563  if (__lCoeffs != nullptr)
564  for (const auto& elt : *__lCoeffs)
565  s << elt.first.toString() << " " << elt.second << " | ";
566 
567  s << std::endl << "middle side : " << std::endl;
568 
569  if (__mCoeffs != nullptr)
570  for (const auto& elt : *__mCoeffs)
571  s << elt.first.toString() << " " << elt.second << " | ";
572 
573  s << std::endl << "right side : " << std::endl;
574 
575  if (__rCoeffs != nullptr)
576  for (const auto& elt : *__rCoeffs)
577  s << elt.first.toString() << " " << elt.second << " | ";
578 
579  s << std::endl
580  << "lvalue : " << __lValue << std::endl
581  << "mvalue : " << __mValue << std::endl
582  << "rvalue : " << __rValue << std::endl;
583 
584  s << std::endl;
585 
586  return s.str();
587  }
HashTable< LpCol, double > * __mCoeffs
The coefficients of each variable on the middle side L : L <= M <= R.
Definition: LpInterface.h:439
double __mValue
The constant on the middle side L : L <= M <= R.
Definition: LpInterface.h:428
double __rValue
The constant on the right side L : L <= M <= R.
Definition: LpInterface.h:430
HashTable< LpCol, double > * __rCoeffs
The coefficients of each variable on the right side L : L <= M <= R.
Definition: LpInterface.h:443
double __lValue
The constant on the left side L : L <= M <= R.
Definition: LpInterface.h:426
HashTable< LpCol, double > * __lCoeffs
The coefficients of each variable on the left side L : L <= M <= R.
Definition: LpInterface.h:435
+ Here is the caller graph for this function:

Friends And Related Function Documentation

◆ LpInterface

template<typename GUM_SCALAR >
friend class LpInterface
friend

Definition at line 213 of file LpInterface.h.

◆ LpRow

friend class LpRow
friend

Definition at line 211 of file LpInterface.h.

Member Data Documentation

◆ __ileft

bool gum::credal::lp::LpExpr::__ileft
private

True if this expression has a non-empty left side L : L <= M <= R .

False otherwise.

Definition at line 415 of file LpInterface.h.

Referenced by __addSide(), gum::credal::lp::LpInterface< GUM_SCALAR >::addRow(), clear(), LpExpr(), gum::credal::lp::LpRow::LpRow(), operator+=(), operator-=(), and operator=().

◆ __imiddle

bool gum::credal::lp::LpExpr::__imiddle
private

True if this expression has a non-empty middle side M ( the default ) : L <= M <= R .

False otherwise.

Definition at line 419 of file LpInterface.h.

Referenced by __addSide(), gum::credal::lp::LpInterface< GUM_SCALAR >::addRow(), clear(), LpExpr(), multiply(), operator+=(), operator-=(), and operator=().

◆ __iright

bool gum::credal::lp::LpExpr::__iright
private

True if this expression has a non-empty right side R : L <= M <= R .

False otherwise.

Definition at line 423 of file LpInterface.h.

Referenced by __addSide(), gum::credal::lp::LpInterface< GUM_SCALAR >::addRow(), clear(), LpExpr(), gum::credal::lp::LpRow::LpRow(), operator+=(), operator-=(), and operator=().

◆ __lCoeffs

HashTable< LpCol, double >* gum::credal::lp::LpExpr::__lCoeffs
private

The coefficients of each variable on the left side L : L <= M <= R.

If a variable is not present, it's coefficient is 0.

Definition at line 435 of file LpInterface.h.

Referenced by __addSide(), clear(), LpExpr(), gum::credal::lp::LpRow::LpRow(), operator=(), toString(), and ~LpExpr().

◆ __lValue

double gum::credal::lp::LpExpr::__lValue
private

The constant on the left side L : L <= M <= R.

Definition at line 426 of file LpInterface.h.

Referenced by __addSide(), clear(), LpExpr(), gum::credal::lp::LpRow::LpRow(), operator=(), and toString().

◆ __mCoeffs

HashTable< LpCol, double >* gum::credal::lp::LpExpr::__mCoeffs
private

The coefficients of each variable on the middle side L : L <= M <= R.

If a variable is not present, it's coefficient is 0.

Definition at line 439 of file LpInterface.h.

Referenced by __addSide(), gum::credal::lp::LpInterface< GUM_SCALAR >::addRow(), clear(), LpExpr(), gum::credal::lp::LpRow::LpRow(), multiply(), operator+=(), operator-=(), operator=(), toString(), and ~LpExpr().

◆ __mValue

double gum::credal::lp::LpExpr::__mValue
private

The constant on the middle side L : L <= M <= R.

Definition at line 428 of file LpInterface.h.

Referenced by __addSide(), gum::credal::lp::LpInterface< GUM_SCALAR >::addRow(), clear(), LpExpr(), gum::credal::lp::LpRow::LpRow(), operator+=(), operator-=(), operator=(), and toString().

◆ __rCoeffs

HashTable< LpCol, double >* gum::credal::lp::LpExpr::__rCoeffs
private

The coefficients of each variable on the right side L : L <= M <= R.

If a variable is not present, it's coefficient is 0.

Definition at line 443 of file LpInterface.h.

Referenced by __addSide(), clear(), LpExpr(), gum::credal::lp::LpRow::LpRow(), operator=(), toString(), and ~LpExpr().

◆ __rValue

double gum::credal::lp::LpExpr::__rValue
private

The constant on the right side L : L <= M <= R.

Definition at line 430 of file LpInterface.h.

Referenced by __addSide(), clear(), LpExpr(), gum::credal::lp::LpRow::LpRow(), operator=(), and toString().


The documentation for this class was generated from the following files: