aGrUM  0.13.2
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 201 of file LpInterface.h.

Constructor & Destructor Documentation

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

Default constructor.

class LpExpr

Definition at line 74 of file LpInterface_tpl.h.

74  :
75  __ileft(false), __imiddle(false), __iright(false), __lValue(0.),
76  __mValue(0.), __rValue(0.), __lCoeffs(new HashTable< LpCol, double >()),
77  __mCoeffs(new HashTable< LpCol, double >()),
78  __rCoeffs(new HashTable< LpCol, double >()) {
79  GUM_CONSTRUCTOR(LpExpr);
80  }
bool __ileft
True if this expression has a non-empty left side L : L <= M <= R .
Definition: LpInterface.h:406
bool __iright
True if this expression has a non-empty right side R : L <= M <= R .
Definition: LpInterface.h:414
HashTable< LpCol, double > * __mCoeffs
The coefficients of each variable on the middle side L : L <= M <= R.
Definition: LpInterface.h:430
double __mValue
The constant on the middle side L : L <= M <= R.
Definition: LpInterface.h:419
LpExpr()
Default constructor.
double __rValue
The constant on the right side L : L <= M <= R.
Definition: LpInterface.h:421
HashTable< LpCol, double > * __rCoeffs
The coefficients of each variable on the right side L : L <= M <= R.
Definition: LpInterface.h:434
double __lValue
The constant on the left side L : L <= M <= R.
Definition: LpInterface.h:417
HashTable< LpCol, double > * __lCoeffs
The coefficients of each variable 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:410
gum::credal::lp::LpExpr::LpExpr ( const LpExpr expr)

Copy constructor.

Parameters
exprThe constant reference to the expression to copy.

Definition at line 82 of file LpInterface_tpl.h.

82  :
83  __ileft(expr.__ileft), __imiddle(expr.__imiddle),
84  __iright(expr.__iright), __lValue(expr.__lValue),
85  __mValue(expr.__mValue), __rValue(expr.__rValue),
86  __lCoeffs(new HashTable< LpCol, double >(*expr.__lCoeffs)),
87  __mCoeffs(new HashTable< LpCol, double >(*expr.__mCoeffs)),
88  __rCoeffs(new HashTable< LpCol, double >(*expr.__rCoeffs)) {
89  GUM_CONS_CPY(LpExpr);
90  }
bool __ileft
True if this expression has a non-empty left side L : L <= M <= R .
Definition: LpInterface.h:406
bool __iright
True if this expression has a non-empty right side R : L <= M <= R .
Definition: LpInterface.h:414
HashTable< LpCol, double > * __mCoeffs
The coefficients of each variable on the middle side L : L <= M <= R.
Definition: LpInterface.h:430
double __mValue
The constant on the middle side L : L <= M <= R.
Definition: LpInterface.h:419
LpExpr()
Default constructor.
double __rValue
The constant on the right side L : L <= M <= R.
Definition: LpInterface.h:421
HashTable< LpCol, double > * __rCoeffs
The coefficients of each variable on the right side L : L <= M <= R.
Definition: LpInterface.h:434
double __lValue
The constant on the left side L : L <= M <= R.
Definition: LpInterface.h:417
HashTable< LpCol, double > * __lCoeffs
The coefficients of each variable 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:410
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 92 of file LpInterface_tpl.h.

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

95  :
96  __ileft(false),
97  __imiddle(false), __iright(false), __lValue(0.), __mValue(0.),
98  __rValue(0.), __lCoeffs(nullptr), __mCoeffs(nullptr),
99  __rCoeffs(nullptr) {
100  if (copyLeft) {
101  __lCoeffs = new HashTable< LpCol, double >(*expr.__lCoeffs);
102  __lValue = expr.__lValue;
103  __ileft = true;
104  } else
105  __lCoeffs = new HashTable< LpCol, double >();
106 
107  if (copyMiddle) {
108  __mCoeffs = new HashTable< LpCol, double >(*expr.__mCoeffs);
109  __mValue = expr.__mValue;
110  __imiddle = true;
111  } else
112  __mCoeffs = new HashTable< LpCol, double >();
113 
114  if (copyRight) {
115  __rCoeffs = new HashTable< LpCol, double >(*expr.__rCoeffs);
116  __rValue = expr.__rValue;
117  __iright = true;
118  } else
119  __rCoeffs = new HashTable< LpCol, double >();
120 
121  GUM_CONS_CPY(LpExpr);
122  }
bool __ileft
True if this expression has a non-empty left side L : L <= M <= R .
Definition: LpInterface.h:406
bool __iright
True if this expression has a non-empty right side R : L <= M <= R .
Definition: LpInterface.h:414
HashTable< LpCol, double > * __mCoeffs
The coefficients of each variable on the middle side L : L <= M <= R.
Definition: LpInterface.h:430
double __mValue
The constant on the middle side L : L <= M <= R.
Definition: LpInterface.h:419
LpExpr()
Default constructor.
double __rValue
The constant on the right side L : L <= M <= R.
Definition: LpInterface.h:421
HashTable< LpCol, double > * __rCoeffs
The coefficients of each variable on the right side L : L <= M <= R.
Definition: LpInterface.h:434
double __lValue
The constant on the left side L : L <= M <= R.
Definition: LpInterface.h:417
HashTable< LpCol, double > * __lCoeffs
The coefficients of each variable 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:410
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 124 of file LpInterface_tpl.h.

124  :
125  __ileft(expr.__ileft), __imiddle(expr.__imiddle),
126  __iright(expr.__iright), __lValue(expr.__lValue),
127  __mValue(expr.__mValue), __rValue(expr.__rValue),
128  __lCoeffs(expr.__lCoeffs), __mCoeffs(expr.__mCoeffs),
129  __rCoeffs(expr.__rCoeffs) {
130  expr.__lCoeffs = nullptr;
131  expr.__mCoeffs = nullptr;
132  expr.__rCoeffs = nullptr;
133 
134  GUM_CONS_CPY(LpExpr);
135  }
bool __ileft
True if this expression has a non-empty left side L : L <= M <= R .
Definition: LpInterface.h:406
bool __iright
True if this expression has a non-empty right side R : L <= M <= R .
Definition: LpInterface.h:414
HashTable< LpCol, double > * __mCoeffs
The coefficients of each variable on the middle side L : L <= M <= R.
Definition: LpInterface.h:430
double __mValue
The constant on the middle side L : L <= M <= R.
Definition: LpInterface.h:419
LpExpr()
Default constructor.
double __rValue
The constant on the right side L : L <= M <= R.
Definition: LpInterface.h:421
HashTable< LpCol, double > * __rCoeffs
The coefficients of each variable on the right side L : L <= M <= R.
Definition: LpInterface.h:434
double __lValue
The constant on the left side L : L <= M <= R.
Definition: LpInterface.h:417
HashTable< LpCol, double > * __lCoeffs
The coefficients of each variable 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:410
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 137 of file LpInterface_tpl.h.

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

140  :
141  __ileft(false),
142  __imiddle(false), __iright(false), __lValue(0.), __mValue(0.),
143  __rValue(0.), __lCoeffs(nullptr), __mCoeffs(nullptr),
144  __rCoeffs(nullptr) {
145  if (copyLeft) {
146  swap(__lCoeffs, expr.__lCoeffs);
147  __lValue = expr.__lValue;
148  __ileft = true;
149  } else
150  __lCoeffs = new HashTable< LpCol, double >();
151 
152  if (copyMiddle) {
153  swap(__mCoeffs, expr.__mCoeffs);
154  __mValue = expr.__mValue;
155  __imiddle = true;
156  } else
157  __mCoeffs = new HashTable< LpCol, double >();
158 
159  if (copyRight) {
160  swap(__rCoeffs, expr.__rCoeffs);
161  __rValue = expr.__rValue;
162  __iright = true;
163  } else
164  __rCoeffs = new HashTable< LpCol, double >();
165 
166  GUM_CONS_CPY(LpExpr);
167  }
bool __ileft
True if this expression has a non-empty left side L : L <= M <= R .
Definition: LpInterface.h:406
bool __iright
True if this expression has a non-empty right side R : L <= M <= R .
Definition: LpInterface.h:414
HashTable< LpCol, double > * __mCoeffs
The coefficients of each variable on the middle side L : L <= M <= R.
Definition: LpInterface.h:430
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:419
LpExpr()
Default constructor.
double __rValue
The constant on the right side L : L <= M <= R.
Definition: LpInterface.h:421
HashTable< LpCol, double > * __rCoeffs
The coefficients of each variable on the right side L : L <= M <= R.
Definition: LpInterface.h:434
double __lValue
The constant on the left side L : L <= M <= R.
Definition: LpInterface.h:417
HashTable< LpCol, double > * __lCoeffs
The coefficients of each variable 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:410

+ Here is the call graph for this function:

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

Default destructor.

Definition at line 169 of file LpInterface_tpl.h.

References __lCoeffs, __mCoeffs, and __rCoeffs.

169  {
170  delete __lCoeffs;
171  delete __mCoeffs;
172  delete __rCoeffs;
173 
174  GUM_DESTRUCTOR(LpExpr);
175  }
HashTable< LpCol, double > * __mCoeffs
The coefficients of each variable on the middle side L : L <= M <= R.
Definition: LpInterface.h:430
LpExpr()
Default constructor.
HashTable< LpCol, double > * __rCoeffs
The coefficients of each variable on the right side L : L <= M <= R.
Definition: LpInterface.h:434
HashTable< LpCol, double > * __lCoeffs
The coefficients of each variable on the left side L : L <= M <= R.
Definition: LpInterface.h:426

Member Function Documentation

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

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

Referenced by lessThan().

345  {
346  if (!__ileft) {
347  __lCoeffs->insert(from, 1.);
348  __ileft = true;
349  } else if (!__imiddle) {
350  __mCoeffs->insert(from, 1.);
351  __imiddle = true;
352  } else if (!__iright) {
353  __rCoeffs->insert(from, 1.);
354  __iright = true;
355  } else
356  GUM_ERROR(OperationNotAllowed,
357  "LpExpr::setSide ( const LpCol & from "
358  ") : too many <= ; no free side");
359  }
bool __ileft
True if this expression has a non-empty left side L : L <= M <= R .
Definition: LpInterface.h:406
bool __iright
True if this expression has a non-empty right side R : L <= M <= R .
Definition: LpInterface.h:414
HashTable< LpCol, double > * __mCoeffs
The coefficients of each variable on the middle 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:434
HashTable< LpCol, double > * __lCoeffs
The coefficients of each variable 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:410
#define GUM_ERROR(type, msg)
Definition: exceptions.h:66

+ Here is the caller graph for this function:

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

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

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

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

442  {
444  if (__ileft && __iright && from.__imiddle)
445  GUM_ERROR(OperationNotAllowed,
446  "LpExpr::setSide ( const LpCol & from "
447  ") : too many <= ; no free side");
448 
450  if (!from.__imiddle) return;
451 
455  if (!from.__ileft && !from.__iright) {
456  if (!__ileft) {
458  swap(__lCoeffs, from.__mCoeffs);
459  __lValue = from.__mValue;
460  __ileft = true;
461 
462  return;
463  } else if (!__imiddle) {
465  swap(__mCoeffs, from.__mCoeffs);
466  __mValue = from.__mValue;
467  __imiddle = true;
468 
469  return;
470  } else if (!__iright) {
472  swap(__rCoeffs, from.__mCoeffs);
473  __rValue = from.__mValue;
474  __iright = true;
475 
476  return;
477  } else
478  GUM_ERROR(OperationNotAllowed,
479  "LpExpr::setSide ( const LpCol & from ) "
480  ": too many <= ; no free side");
481  }
484  else if (from.__ileft && !from.__iright) {
485  if (!__ileft) {
487  swap(__lCoeffs, from.__lCoeffs);
488  __lValue = from.__lValue;
489  __ileft = true;
490 
492  swap(__mCoeffs, from.__mCoeffs);
493  __mValue = from.__mValue;
494  __imiddle = true;
495 
496  return;
497  } else if (!__imiddle && !__iright) {
499  swap(__mCoeffs, from.__lCoeffs);
500  __mValue = from.__lValue;
501  __imiddle = true;
502 
504  swap(__rCoeffs, from.__mCoeffs);
505  __rValue = from.__mValue;
506  __iright = true;
507 
508  return;
509  } else
510  GUM_ERROR(OperationNotAllowed,
511  "LpExpr::setSide ( const LpCol & from ) "
512  ": too many <= ; no free side");
513  }
516  else if (from.__ileft && from.__iright) {
517  if (__ileft || __imiddle || __iright)
518  GUM_ERROR(OperationNotAllowed,
519  "LpExpr::setSide ( const LpCol & from ) "
520  ": too many <= ; no free side");
521 
522  *this = std::move(from);
523 
524  return;
525  } else
526  GUM_ERROR(OperationNotAllowed,
527  "LpExpr::setSide ( const LpCol & from "
528  ") : too many <= ; no free side");
529  }
bool __ileft
True if this expression has a non-empty left side L : L <= M <= R .
Definition: LpInterface.h:406
bool __iright
True if this expression has a non-empty right side R : L <= M <= R .
Definition: LpInterface.h:414
HashTable< LpCol, double > * __mCoeffs
The coefficients of each variable on the middle side L : L <= M <= R.
Definition: LpInterface.h:430
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:419
double __rValue
The constant on the right side L : L <= M <= R.
Definition: LpInterface.h:421
HashTable< LpCol, double > * __rCoeffs
The coefficients of each variable on the right side L : L <= M <= R.
Definition: LpInterface.h:434
double __lValue
The constant on the left side L : L <= M <= R.
Definition: LpInterface.h:417
HashTable< LpCol, double > * __lCoeffs
The coefficients of each variable 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:410
#define GUM_ERROR(type, msg)
Definition: exceptions.h:66

+ Here is the call graph for this function:

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

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

532  {
533  if (!__ileft) {
534  __lValue = from;
535  __ileft = true;
536  } else if (!__imiddle) {
537  __mValue = from;
538  __imiddle = true;
539  } else if (!__iright) {
540  __rValue = from;
541  __iright = true;
542  } else
543  GUM_ERROR(OperationNotAllowed,
544  "LpExpr::setSide ( const LpCol & from "
545  ") : too many <= ; no free side");
546  }
bool __ileft
True if this expression has a non-empty left side L : L <= M <= R .
Definition: LpInterface.h:406
bool __iright
True if this expression has a non-empty right side R : L <= M <= R .
Definition: LpInterface.h:414
double __mValue
The constant on the middle side L : L <= M <= R.
Definition: LpInterface.h:419
double __rValue
The constant on the right side L : L <= M <= R.
Definition: LpInterface.h:421
double __lValue
The constant on the left side L : L <= M <= R.
Definition: LpInterface.h:417
bool __imiddle
True if this expression has a non-empty middle side M ( the default ) : L <= M <= R ...
Definition: LpInterface.h:410
#define GUM_ERROR(type, msg)
Definition: exceptions.h:66
void gum::credal::lp::LpExpr::clear ( )

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

Definition at line 548 of file LpInterface_tpl.h.

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

Referenced by operator=().

548  {
549  __lCoeffs->clear();
550  __mCoeffs->clear();
551  __rCoeffs->clear();
552 
553  __lValue = 0.;
554  __mValue = 0.;
555  __rValue = 0.;
556 
557  __ileft = false;
558  __imiddle = false;
559  __iright = false;
560  }
bool __ileft
True if this expression has a non-empty left side L : L <= M <= R .
Definition: LpInterface.h:406
bool __iright
True if this expression has a non-empty right side R : L <= M <= R .
Definition: LpInterface.h:414
HashTable< LpCol, double > * __mCoeffs
The coefficients of each variable on the middle side L : L <= M <= R.
Definition: LpInterface.h:430
double __mValue
The constant on the middle side L : L <= M <= R.
Definition: LpInterface.h:419
double __rValue
The constant on the right side L : L <= M <= R.
Definition: LpInterface.h:421
HashTable< LpCol, double > * __rCoeffs
The coefficients of each variable on the right side L : L <= M <= R.
Definition: LpInterface.h:434
double __lValue
The constant on the left side L : L <= M <= R.
Definition: LpInterface.h:417
HashTable< LpCol, double > * __lCoeffs
The coefficients of each variable 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:410

+ Here is the caller graph for this function:

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:

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

Definition at line 1176 of file LpInterface_tpl.h.

References __addSide().

1176  {
1177  LpExpr expr;
1178  expr.__addSide(std::forward< T1 >(lhs));
1179  expr.__addSide(std::forward< T2 >(rhs));
1180  return expr;
1181  }
LpExpr()
Default constructor.

+ Here is the call graph for this function:

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:

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

Definition at line 1157 of file LpInterface_tpl.h.

References __imiddle, and __mCoeffs.

1157  {
1158  LpExpr expr;
1159  expr.__mCoeffs->insert(rhs, lhs);
1160  expr.__imiddle = true;
1161  return expr;
1162  }
LpExpr()
Default constructor.
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 234 of file LpInterface_tpl.h.

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

234  {
235  if (__ileft || __iright)
236  GUM_ERROR(OperationNotAllowed,
237  "expr::operator+= (expr) : <= present on one side of expr");
238 
239  if (!__imiddle) __imiddle = true;
240 
241  __mCoeffs->getWithDefault(rhs, 0.) += 1.;
242 
243  return *this;
244  }
bool __ileft
True if this expression has a non-empty left side L : L <= M <= R .
Definition: LpInterface.h:406
bool __iright
True if this expression has a non-empty right side R : L <= M <= R .
Definition: LpInterface.h:414
HashTable< LpCol, double > * __mCoeffs
The coefficients of each variable on the middle side L : L <= M <= R.
Definition: LpInterface.h:430
bool __imiddle
True if this expression has a non-empty middle side M ( the default ) : L <= M <= R ...
Definition: LpInterface.h:410
#define GUM_ERROR(type, msg)
Definition: exceptions.h:66
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 246 of file LpInterface_tpl.h.

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

246  {
247  if (__ileft || __iright || rhs.__ileft || rhs.__iright)
248  GUM_ERROR(OperationNotAllowed,
249  "expr::operator+= (rhs) : <= present "
250  "on one side of rhs and/or expr");
251 
252  if (!__imiddle) __imiddle = true;
253 
254  for (const auto& elt : *rhs.__mCoeffs)
255  __mCoeffs->getWithDefault(elt.first, 0.) += elt.second;
256 
257  __mValue += rhs.__mValue;
258 
259  return *this;
260  }
bool __ileft
True if this expression has a non-empty left side L : L <= M <= R .
Definition: LpInterface.h:406
bool __iright
True if this expression has a non-empty right side R : L <= M <= R .
Definition: LpInterface.h:414
HashTable< LpCol, double > * __mCoeffs
The coefficients of each variable on the middle side L : L <= M <= R.
Definition: LpInterface.h:430
double __mValue
The constant on the middle side L : L <= M <= R.
Definition: LpInterface.h:419
bool __imiddle
True if this expression has a non-empty middle side M ( the default ) : L <= M <= R ...
Definition: LpInterface.h:410
#define GUM_ERROR(type, msg)
Definition: exceptions.h:66
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 262 of file LpInterface_tpl.h.

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

262  {
263  if (__ileft || __iright || rhs.__ileft || rhs.__iright)
264  GUM_ERROR(OperationNotAllowed,
265  "expr::operator+= (rhs) : <= present "
266  "on one side of rhs and/or expr");
267 
268  if (!__imiddle) {
269  __imiddle = true;
270 
271  __mValue = rhs.__mValue;
272 
273  swap(__mCoeffs, rhs.__mCoeffs);
274 
275  return *this;
276  }
277 
278  for (const auto& elt : *rhs.__mCoeffs)
279  __mCoeffs->getWithDefault(elt.first, 0.) += elt.second;
280 
281  __mValue += rhs.__mValue;
282 
283  return *this;
284  }
bool __ileft
True if this expression has a non-empty left side L : L <= M <= R .
Definition: LpInterface.h:406
bool __iright
True if this expression has a non-empty right side R : L <= M <= R .
Definition: LpInterface.h:414
HashTable< LpCol, double > * __mCoeffs
The coefficients of each variable on the middle side L : L <= M <= R.
Definition: LpInterface.h:430
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:419
bool __imiddle
True if this expression has a non-empty middle side M ( the default ) : L <= M <= R ...
Definition: LpInterface.h:410
#define GUM_ERROR(type, msg)
Definition: exceptions.h:66

+ Here is the call graph for this function:

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

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

287  {
288  if (__ileft || __iright)
289  GUM_ERROR(OperationNotAllowed,
290  "expr::operator+= (expr) : <= present on one side of expr");
291 
292  if (!__imiddle) __imiddle = true;
293 
294  __mValue += rhs;
295 
296  return *this;
297  }
bool __ileft
True if this expression has a non-empty left side L : L <= M <= R .
Definition: LpInterface.h:406
bool __iright
True if this expression has a non-empty right side R : L <= M <= R .
Definition: LpInterface.h:414
double __mValue
The constant on the middle side L : L <= M <= R.
Definition: LpInterface.h:419
bool __imiddle
True if this expression has a non-empty middle side M ( the default ) : L <= M <= R ...
Definition: LpInterface.h:410
#define GUM_ERROR(type, msg)
Definition: exceptions.h:66
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 299 of file LpInterface_tpl.h.

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

299  {
300  if (__ileft || __iright)
301  GUM_ERROR(OperationNotAllowed,
302  "expr::operator-= (rhs) : <= present in one of expr");
303 
304  if (!__imiddle) __imiddle = true;
305 
306  __mCoeffs->getWithDefault(rhs, 0.) -= 1.;
307 
308  return *this;
309  }
bool __ileft
True if this expression has a non-empty left side L : L <= M <= R .
Definition: LpInterface.h:406
bool __iright
True if this expression has a non-empty right side R : L <= M <= R .
Definition: LpInterface.h:414
HashTable< LpCol, double > * __mCoeffs
The coefficients of each variable on the middle side L : L <= M <= R.
Definition: LpInterface.h:430
bool __imiddle
True if this expression has a non-empty middle side M ( the default ) : L <= M <= R ...
Definition: LpInterface.h:410
#define GUM_ERROR(type, msg)
Definition: exceptions.h:66
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 311 of file LpInterface_tpl.h.

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

311  {
312  if (__ileft || __iright || rhs.__ileft || rhs.__iright)
313  GUM_ERROR(
314  OperationNotAllowed,
315  "expr::operator-= (rhs) : <= present in one of rhs and/or expr");
316 
317  if (!__imiddle) __imiddle = true;
318 
319  for (const auto& elt : *rhs.__mCoeffs)
320  __mCoeffs->getWithDefault(elt.first, 0.) -= elt.second;
321 
322  __mValue -= rhs.__mValue;
323 
324  return *this;
325  }
bool __ileft
True if this expression has a non-empty left side L : L <= M <= R .
Definition: LpInterface.h:406
bool __iright
True if this expression has a non-empty right side R : L <= M <= R .
Definition: LpInterface.h:414
HashTable< LpCol, double > * __mCoeffs
The coefficients of each variable on the middle side L : L <= M <= R.
Definition: LpInterface.h:430
double __mValue
The constant on the middle side L : L <= M <= R.
Definition: LpInterface.h:419
bool __imiddle
True if this expression has a non-empty middle side M ( the default ) : L <= M <= R ...
Definition: LpInterface.h:410
#define GUM_ERROR(type, msg)
Definition: exceptions.h:66
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 328 of file LpInterface_tpl.h.

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

328  {
329  if (__ileft || __iright)
330  GUM_ERROR(OperationNotAllowed,
331  "expr::operator-= (rhs) : <= present in one of expr");
332 
333  if (!__imiddle) __imiddle = true;
334 
335  __mValue -= rhs;
336 
337  return *this;
338  }
bool __ileft
True if this expression has a non-empty left side L : L <= M <= R .
Definition: LpInterface.h:406
bool __iright
True if this expression has a non-empty right side R : L <= M <= R .
Definition: LpInterface.h:414
double __mValue
The constant on the middle side L : L <= M <= R.
Definition: LpInterface.h:419
bool __imiddle
True if this expression has a non-empty middle side M ( the default ) : L <= M <= R ...
Definition: LpInterface.h:410
#define GUM_ERROR(type, msg)
Definition: exceptions.h:66
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 177 of file LpInterface_tpl.h.

References __imiddle, __mCoeffs, and clear().

177  {
178  clear();
179 
180  __mCoeffs->insert(rhs, 1.);
181  __imiddle = true;
182 
183  return *this;
184  }
HashTable< LpCol, double > * __mCoeffs
The coefficients of each variable on the middle side L : L <= M <= R.
Definition: LpInterface.h:430
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:410

+ Here is the call graph for this function:

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

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

186  {
188  if (this == &rhs) return *this;
189 
190  *__lCoeffs = *rhs.__lCoeffs;
191  *__mCoeffs = *rhs.__mCoeffs;
192  *__rCoeffs = *rhs.__rCoeffs;
193 
194  __lValue = rhs.__lValue;
195  __mValue = rhs.__mValue;
196  __rValue = rhs.__rValue;
197 
198  __ileft = rhs.__ileft;
199  __imiddle = rhs.__imiddle;
200  __iright = rhs.__iright;
201 
202  return *this;
203  }
bool __ileft
True if this expression has a non-empty left side L : L <= M <= R .
Definition: LpInterface.h:406
bool __iright
True if this expression has a non-empty right side R : L <= M <= R .
Definition: LpInterface.h:414
HashTable< LpCol, double > * __mCoeffs
The coefficients of each variable on the middle side L : L <= M <= R.
Definition: LpInterface.h:430
double __mValue
The constant on the middle side L : L <= M <= R.
Definition: LpInterface.h:419
double __rValue
The constant on the right side L : L <= M <= R.
Definition: LpInterface.h:421
HashTable< LpCol, double > * __rCoeffs
The coefficients of each variable on the right side L : L <= M <= R.
Definition: LpInterface.h:434
double __lValue
The constant on the left side L : L <= M <= R.
Definition: LpInterface.h:417
HashTable< LpCol, double > * __lCoeffs
The coefficients of each variable 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:410
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 205 of file LpInterface_tpl.h.

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

205  {
207  if (this == &rhs) return *this;
208 
209  swap(__lCoeffs, rhs.__lCoeffs);
210  swap(__mCoeffs, rhs.__mCoeffs);
211  swap(__rCoeffs, rhs.__rCoeffs);
212 
213  __lValue = rhs.__lValue;
214  __mValue = rhs.__mValue;
215  __rValue = rhs.__rValue;
216 
217  __ileft = rhs.__ileft;
218  __imiddle = rhs.__imiddle;
219  __iright = rhs.__iright;
220 
221  return *this;
222  }
bool __ileft
True if this expression has a non-empty left side L : L <= M <= R .
Definition: LpInterface.h:406
bool __iright
True if this expression has a non-empty right side R : L <= M <= R .
Definition: LpInterface.h:414
HashTable< LpCol, double > * __mCoeffs
The coefficients of each variable on the middle side L : L <= M <= R.
Definition: LpInterface.h:430
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:419
double __rValue
The constant on the right side L : L <= M <= R.
Definition: LpInterface.h:421
HashTable< LpCol, double > * __rCoeffs
The coefficients of each variable on the right side L : L <= M <= R.
Definition: LpInterface.h:434
double __lValue
The constant on the left side L : L <= M <= R.
Definition: LpInterface.h:417
HashTable< LpCol, double > * __lCoeffs
The coefficients of each variable 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:410

+ Here is the call graph for this function:

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

References __imiddle, __mValue, and clear().

225  {
226  clear();
227 
228  __mValue = rhs;
229  __imiddle = true;
230 
231  return *this;
232  }
double __mValue
The constant on the middle side L : L <= M <= R.
Definition: LpInterface.h:419
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:410

+ Here is the call graph for this function:

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 562 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<<().

562  {
563  std::ostringstream s;
564 
565  s << std::endl << "left side : " << std::endl;
566 
567  if (__lCoeffs != nullptr)
568  for (const auto& elt : *__lCoeffs)
569  s << elt.first.toString() << " " << elt.second << " | ";
570 
571  s << std::endl << "middle side : " << std::endl;
572 
573  if (__mCoeffs != nullptr)
574  for (const auto& elt : *__mCoeffs)
575  s << elt.first.toString() << " " << elt.second << " | ";
576 
577  s << std::endl << "right side : " << std::endl;
578 
579  if (__rCoeffs != nullptr)
580  for (const auto& elt : *__rCoeffs)
581  s << elt.first.toString() << " " << elt.second << " | ";
582 
583  s << std::endl
584  << "lvalue : " << __lValue << std::endl
585  << "mvalue : " << __mValue << std::endl
586  << "rvalue : " << __rValue << std::endl;
587 
588  s << std::endl;
589 
590  return s.str();
591  }
HashTable< LpCol, double > * __mCoeffs
The coefficients of each variable on the middle side L : L <= M <= R.
Definition: LpInterface.h:430
double __mValue
The constant on the middle side L : L <= M <= R.
Definition: LpInterface.h:419
double __rValue
The constant on the right side L : L <= M <= R.
Definition: LpInterface.h:421
HashTable< LpCol, double > * __rCoeffs
The coefficients of each variable on the right side L : L <= M <= R.
Definition: LpInterface.h:434
double __lValue
The constant on the left side L : L <= M <= R.
Definition: LpInterface.h:417
HashTable< LpCol, double > * __lCoeffs
The coefficients of each variable on the left side L : L <= M <= R.
Definition: LpInterface.h:426

+ Here is the caller graph for this function:

Friends And Related Function Documentation

template<typename GUM_SCALAR >
friend class LpInterface
friend

Definition at line 204 of file LpInterface.h.

friend class LpRow
friend

Definition at line 202 of file LpInterface.h.

Member Data Documentation

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 406 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=().

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 410 of file LpInterface.h.

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

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 414 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=().

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 426 of file LpInterface.h.

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

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

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

Definition at line 417 of file LpInterface.h.

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

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 430 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().

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

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

Definition at line 419 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().

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 434 of file LpInterface.h.

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

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

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

Definition at line 421 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: