aGrUM  0.18.1
a C++ library for (probabilistic) graphical models
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  }
double mValue__
The constant on the middle side L : L <= M <= R.
Definition: LpInterface.h:428
HashTable< LpCol, double > * mCoeffs__
The coefficients of each variable on the middle side L : L <= M <= R.
Definition: LpInterface.h:439
bool iright__
True if this expression has a non-empty right side R : L <= M <= R .
Definition: LpInterface.h:423
LpExpr()
Default constructor.
double rValue__
The constant on the right side L : L <= M <= R.
Definition: LpInterface.h:430
HashTable< LpCol, double > * lCoeffs__
The coefficients of each variable on the left side L : L <= M <= R.
Definition: LpInterface.h:435
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
bool ileft__
True if this expression has a non-empty left side L : L <= M <= R .
Definition: LpInterface.h:415
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  }
double mValue__
The constant on the middle side L : L <= M <= R.
Definition: LpInterface.h:428
HashTable< LpCol, double > * mCoeffs__
The coefficients of each variable on the middle side L : L <= M <= R.
Definition: LpInterface.h:439
bool iright__
True if this expression has a non-empty right side R : L <= M <= R .
Definition: LpInterface.h:423
LpExpr()
Default constructor.
double rValue__
The constant on the right side L : L <= M <= R.
Definition: LpInterface.h:430
HashTable< LpCol, double > * lCoeffs__
The coefficients of each variable on the left side L : L <= M <= R.
Definition: LpInterface.h:435
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
bool ileft__
True if this expression has a non-empty left side L : L <= M <= R .
Definition: LpInterface.h:415
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  }
double mValue__
The constant on the middle side L : L <= M <= R.
Definition: LpInterface.h:428
HashTable< LpCol, double > * mCoeffs__
The coefficients of each variable on the middle side L : L <= M <= R.
Definition: LpInterface.h:439
bool iright__
True if this expression has a non-empty right side R : L <= M <= R .
Definition: LpInterface.h:423
LpExpr()
Default constructor.
double rValue__
The constant on the right side L : L <= M <= R.
Definition: LpInterface.h:430
HashTable< LpCol, double > * lCoeffs__
The coefficients of each variable on the left side L : L <= M <= R.
Definition: LpInterface.h:435
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
bool ileft__
True if this expression has a non-empty left side L : L <= M <= R .
Definition: LpInterface.h:415
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  }
double mValue__
The constant on the middle side L : L <= M <= R.
Definition: LpInterface.h:428
HashTable< LpCol, double > * mCoeffs__
The coefficients of each variable on the middle side L : L <= M <= R.
Definition: LpInterface.h:439
bool iright__
True if this expression has a non-empty right side R : L <= M <= R .
Definition: LpInterface.h:423
LpExpr()
Default constructor.
double rValue__
The constant on the right side L : L <= M <= R.
Definition: LpInterface.h:430
HashTable< LpCol, double > * lCoeffs__
The coefficients of each variable on the left side L : L <= M <= R.
Definition: LpInterface.h:435
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
bool ileft__
True if this expression has a non-empty left side L : L <= M <= R .
Definition: LpInterface.h:415
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  }
double mValue__
The constant on the middle side L : L <= M <= R.
Definition: LpInterface.h:428
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.
bool iright__
True if this expression has a non-empty right side R : L <= M <= R .
Definition: LpInterface.h:423
LpExpr()
Default constructor.
double rValue__
The constant on the right side L : L <= M <= R.
Definition: LpInterface.h:430
HashTable< LpCol, double > * lCoeffs__
The coefficients of each variable on the left side L : L <= M <= R.
Definition: LpInterface.h:435
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
bool ileft__
True if this expression has a non-empty left side L : L <= M <= R .
Definition: LpInterface.h:415
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 > * lCoeffs__
The coefficients of each variable on the left side L : L <= M <= R.
Definition: LpInterface.h:435
HashTable< LpCol, double > * rCoeffs__
The coefficients of each variable on the right side L : L <= M <= R.
Definition: LpInterface.h:443

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 GUM_ERROR, ileft__, imiddle__, iright__, lCoeffs__, mCoeffs__, and rCoeffs__.

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  }
HashTable< LpCol, double > * mCoeffs__
The coefficients of each variable on the middle side L : L <= M <= R.
Definition: LpInterface.h:439
bool iright__
True if this expression has a non-empty right side R : L <= M <= R .
Definition: LpInterface.h:423
HashTable< LpCol, double > * lCoeffs__
The coefficients of each variable on the left side L : L <= M <= R.
Definition: LpInterface.h:435
HashTable< LpCol, double > * rCoeffs__
The coefficients of each variable on the right side L : L <= M <= R.
Definition: LpInterface.h:443
bool ileft__
True if this expression has a non-empty left side L : L <= M <= R .
Definition: LpInterface.h:415
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 GUM_ERROR, ileft__, imiddle__, iright__, lCoeffs__, lValue__, mCoeffs__, mValue__, rCoeffs__, and rValue__.

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  }
double mValue__
The constant on the middle side L : L <= M <= R.
Definition: LpInterface.h:428
HashTable< LpCol, double > * mCoeffs__
The coefficients of each variable on the middle side L : L <= M <= R.
Definition: LpInterface.h:439
bool iright__
True if this expression has a non-empty right side R : L <= M <= R .
Definition: LpInterface.h:423
double rValue__
The constant on the right side L : L <= M <= R.
Definition: LpInterface.h:430
HashTable< LpCol, double > * lCoeffs__
The coefficients of each variable on the left side L : L <= M <= R.
Definition: LpInterface.h:435
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
bool ileft__
True if this expression has a non-empty left side L : L <= M <= R .
Definition: LpInterface.h:415
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 GUM_ERROR, ileft__, imiddle__, iright__, lCoeffs__, lValue__, mCoeffs__, mValue__, rCoeffs__, rValue__, 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  }
double mValue__
The constant on the middle side L : L <= M <= R.
Definition: LpInterface.h:428
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.
bool iright__
True if this expression has a non-empty right side R : L <= M <= R .
Definition: LpInterface.h:423
double rValue__
The constant on the right side L : L <= M <= R.
Definition: LpInterface.h:430
HashTable< LpCol, double > * lCoeffs__
The coefficients of each variable on the left side L : L <= M <= R.
Definition: LpInterface.h:435
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
bool ileft__
True if this expression has a non-empty left side L : L <= M <= R .
Definition: LpInterface.h:415
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 GUM_ERROR, ileft__, imiddle__, iright__, lValue__, mValue__, and rValue__.

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  }
double mValue__
The constant on the middle side L : L <= M <= R.
Definition: LpInterface.h:428
bool iright__
True if this expression has a non-empty right side R : L <= M <= R .
Definition: LpInterface.h:423
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 ileft__
True if this expression has a non-empty left side L : L <= M <= R .
Definition: LpInterface.h:415
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  }
double mValue__
The constant on the middle side L : L <= M <= R.
Definition: LpInterface.h:428
HashTable< LpCol, double > * mCoeffs__
The coefficients of each variable on the middle side L : L <= M <= R.
Definition: LpInterface.h:439
bool iright__
True if this expression has a non-empty right side R : L <= M <= R .
Definition: LpInterface.h:423
double rValue__
The constant on the right side L : L <= M <= R.
Definition: LpInterface.h:430
HashTable< LpCol, double > * lCoeffs__
The coefficients of each variable on the left side L : L <= M <= R.
Definition: LpInterface.h:435
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
bool ileft__
True if this expression has a non-empty left side L : L <= M <= R .
Definition: LpInterface.h:415
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 GUM_ERROR, ileft__, imiddle__, iright__, and mCoeffs__.

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  }
HashTable< LpCol, double > * mCoeffs__
The coefficients of each variable on the middle side L : L <= M <= R.
Definition: LpInterface.h:439
bool iright__
True if this expression has a non-empty right side R : L <= M <= R .
Definition: LpInterface.h:423
bool ileft__
True if this expression has a non-empty left side L : L <= M <= R .
Definition: LpInterface.h:415
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 GUM_ERROR, ileft__, imiddle__, iright__, mCoeffs__, and mValue__.

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  }
double mValue__
The constant on the middle side L : L <= M <= R.
Definition: LpInterface.h:428
HashTable< LpCol, double > * mCoeffs__
The coefficients of each variable on the middle side L : L <= M <= R.
Definition: LpInterface.h:439
bool iright__
True if this expression has a non-empty right side R : L <= M <= R .
Definition: LpInterface.h:423
bool ileft__
True if this expression has a non-empty left side L : L <= M <= R .
Definition: LpInterface.h:415
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 GUM_ERROR, ileft__, imiddle__, iright__, mCoeffs__, mValue__, 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  }
double mValue__
The constant on the middle side L : L <= M <= R.
Definition: LpInterface.h:428
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.
bool iright__
True if this expression has a non-empty right side R : L <= M <= R .
Definition: LpInterface.h:423
bool ileft__
True if this expression has a non-empty left side L : L <= M <= R .
Definition: LpInterface.h:415
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 GUM_ERROR, ileft__, imiddle__, iright__, and mValue__.

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  }
double mValue__
The constant on the middle side L : L <= M <= R.
Definition: LpInterface.h:428
bool iright__
True if this expression has a non-empty right side R : L <= M <= R .
Definition: LpInterface.h:423
bool ileft__
True if this expression has a non-empty left side L : L <= M <= R .
Definition: LpInterface.h:415
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 GUM_ERROR, ileft__, imiddle__, iright__, and mCoeffs__.

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  }
HashTable< LpCol, double > * mCoeffs__
The coefficients of each variable on the middle side L : L <= M <= R.
Definition: LpInterface.h:439
bool iright__
True if this expression has a non-empty right side R : L <= M <= R .
Definition: LpInterface.h:423
bool ileft__
True if this expression has a non-empty left side L : L <= M <= R .
Definition: LpInterface.h:415
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 GUM_ERROR, ileft__, imiddle__, iright__, mCoeffs__, and mValue__.

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  }
double mValue__
The constant on the middle side L : L <= M <= R.
Definition: LpInterface.h:428
HashTable< LpCol, double > * mCoeffs__
The coefficients of each variable on the middle side L : L <= M <= R.
Definition: LpInterface.h:439
bool iright__
True if this expression has a non-empty right side R : L <= M <= R .
Definition: LpInterface.h:423
bool ileft__
True if this expression has a non-empty left side L : L <= M <= R .
Definition: LpInterface.h:415
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 GUM_ERROR, ileft__, imiddle__, iright__, and mValue__.

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  }
double mValue__
The constant on the middle side L : L <= M <= R.
Definition: LpInterface.h:428
bool iright__
True if this expression has a non-empty right side R : L <= M <= R .
Definition: LpInterface.h:423
bool ileft__
True if this expression has a non-empty left side L : L <= M <= R .
Definition: LpInterface.h:415
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 clear(), imiddle__, and mCoeffs__.

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  }
double mValue__
The constant on the middle side L : L <= M <= R.
Definition: LpInterface.h:428
HashTable< LpCol, double > * mCoeffs__
The coefficients of each variable on the middle side L : L <= M <= R.
Definition: LpInterface.h:439
bool iright__
True if this expression has a non-empty right side R : L <= M <= R .
Definition: LpInterface.h:423
double rValue__
The constant on the right side L : L <= M <= R.
Definition: LpInterface.h:430
HashTable< LpCol, double > * lCoeffs__
The coefficients of each variable on the left side L : L <= M <= R.
Definition: LpInterface.h:435
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
bool ileft__
True if this expression has a non-empty left side L : L <= M <= R .
Definition: LpInterface.h:415
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  }
double mValue__
The constant on the middle side L : L <= M <= R.
Definition: LpInterface.h:428
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.
bool iright__
True if this expression has a non-empty right side R : L <= M <= R .
Definition: LpInterface.h:423
double rValue__
The constant on the right side L : L <= M <= R.
Definition: LpInterface.h:430
HashTable< LpCol, double > * lCoeffs__
The coefficients of each variable on the left side L : L <= M <= R.
Definition: LpInterface.h:435
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
bool ileft__
True if this expression has a non-empty left side L : L <= M <= R .
Definition: LpInterface.h:415
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 clear(), imiddle__, and mValue__.

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  }
double mValue__
The constant on the middle side L : L <= M <= R.
Definition: LpInterface.h:428
HashTable< LpCol, double > * mCoeffs__
The coefficients of each variable on the middle side L : L <= M <= R.
Definition: LpInterface.h:439
double rValue__
The constant on the right side L : L <= M <= R.
Definition: LpInterface.h:430
HashTable< LpCol, double > * lCoeffs__
The coefficients of each variable on the left side L : L <= M <= R.
Definition: LpInterface.h:435
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
+ 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 gum::credal::lp::LpInterface< GUM_SCALAR >::addRow(), addSide__(), 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 gum::credal::lp::LpInterface< GUM_SCALAR >::addRow(), addSide__(), 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 gum::credal::lp::LpInterface< GUM_SCALAR >::addRow(), addSide__(), 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 gum::credal::lp::LpInterface< GUM_SCALAR >::addRow(), addSide__(), 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 gum::credal::lp::LpInterface< GUM_SCALAR >::addRow(), addSide__(), 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: