aGrUM  0.20.2
a C++ library for (probabilistic) graphical models
gum::credal::LRSWrapper< GUM_SCALAR > Class Template Reference

Class template acting as a wrapper for Lexicographic Reverse Search by David Avis. More...

#include <agrum/CN/LrsWrapper.h>

+ Collaboration diagram for gum::credal::LRSWrapper< GUM_SCALAR >:

Public Member Functions

Constructors / Destructors
 LRSWrapper ()
 Default Constructor. More...
 
 ~LRSWrapper ()
 Default Destructor. More...
 
Getters and setters
const matrixgetInput () const
 Get the intput matrix of the problem. More...
 
const matrixgetOutput () const
 Get the output matrix solution of the problem. More...
 
const unsigned int & getVerticesNumber () const
 Get the number of vertices of this polytope. More...
 
const GUM_SCALAR & getVolume () const
 Get the volume of the polytope that has been computed. More...
 
setUp / tearDown
void setUpH (const Size &card)
 Sets up an H-representation. More...
 
void setUpV (const Size &card, const Size &vertices)
 Sets up a V-representation. More...
 
void tearDown ()
 Reset the wrapper as if it was built. More...
 
void nextHInput ()
 Reset the wrapper for next computation for a H-representation with the same variable cardinality and number of inequalities. More...
 
Input filling methods
void fillH (const GUM_SCALAR &min, const GUM_SCALAR &max, const Size &modal)
 Creates the H-representation of min <= p(X=modal | .) <= max and add it to the problem input input__. More...
 
void fillMatrix (const std::vector< std::vector< GUM_SCALAR > > &matrix)
 Fill the H-representation from the matrix given in argument. More...
 
void fillV (const std::vector< GUM_SCALAR > &vertex)
 Creates the V-representation of a polytope by adding a vertex to the problem input input__. More...
 
lrs algorithms
void H2V ()
 H-representation to V-representation. More...
 
void V2H ()
 V-representation to H-representation. More...
 
void computeVolume ()
 Computes a polytope ( pseudo ) volume from it's V-representation. More...
 
void elimRedundVrep ()
 V-Redundancy elimination. More...
 

Detailed Description

template<typename GUM_SCALAR>
class gum::credal::LRSWrapper< GUM_SCALAR >

Class template acting as a wrapper for Lexicographic Reverse Search by David Avis.

Template Parameters
GUM_SCALARA floating type ( float, double, long double ... ).
Author
Matthieu HOURBRACQ and Pierre-Henri WUILLEMIN()

Definition at line 106 of file LrsWrapper.h.

Member Typedef Documentation

◆ matrix

template<typename GUM_SCALAR >
using gum::credal::LRSWrapper< GUM_SCALAR >::matrix = typename std::vector< std::vector< GUM_SCALAR > >
private

Shortcut for dynamic matrix using vectors.

Definition at line 109 of file LrsWrapper.h.

Member Enumeration Documentation

◆ states__

template<typename GUM_SCALAR >
enum gum::credal::LRSWrapper::states__ : char
strongprivate

The possible states of the LrsWrapper.

Some functions will throw an exception if the state is not correct. It allows the user to avoid making - invisible - mistakes.

Enumerator
none 
Hup 
Vup 
H2Vready 
V2Hready 

Definition at line 143 of file LrsWrapper.h.

143  : char
144  {
145  none = char(0),
146  Hup = char(1),
147  Vup = char(2),
148  H2Vready = char(3),
149  V2Hready = char(4),
150  };

Constructor & Destructor Documentation

◆ LRSWrapper()

template<typename GUM_SCALAR >
gum::credal::LRSWrapper< GUM_SCALAR >::LRSWrapper ( )

Default Constructor.

Definition at line 31 of file LrsWrapper_tpl.h.

31  {
33 
34  vertices__ = 0;
35  card__ = 0;
36 
37  volume__ = 0;
38 
39  getVolume__ = false;
40  hull__ = false;
41  polytope__ = false;
42 
43  GUM_CONSTRUCTOR(LRSWrapper);
44  }
GUM_SCALAR volume__
The volume of the polytope, if computed, 0 otherwise.
Definition: LrsWrapper.h:156
states__ state__
The current state of the LrsWrapper.
Definition: LrsWrapper.h:153
unsigned int card__
Cardinality of the variable.
Definition: LrsWrapper.h:120
unsigned int vertices__
The number of vertices of the polytope.
Definition: LrsWrapper.h:127
LRSWrapper()
Default Constructor.

◆ ~LRSWrapper()

template<typename GUM_SCALAR >
gum::credal::LRSWrapper< GUM_SCALAR >::~LRSWrapper ( )

Default Destructor.

Definition at line 47 of file LrsWrapper_tpl.h.

47  {
48  GUM_DESTRUCTOR(LRSWrapper);
49  }
LRSWrapper()
Default Constructor.

Member Function Documentation

◆ computeVolume()

template<typename GUM_SCALAR >
void gum::credal::LRSWrapper< GUM_SCALAR >::computeVolume ( )

Computes a polytope ( pseudo ) volume from it's V-representation.

Warning
Volume can only be computed using V-representation. H-representation volume computation is not predictable.
Probabilistic polytopes are not full dimensional : they lie in the simplex' hyper plane, therefor a pseudo-volume will be computed by projecting the polytope. The projection used is the lexicographically smallest coordinate subspace.

Definition at line 370 of file LrsWrapper_tpl.h.

370  {
371  if (!state__ == states__::V2Hready)
372  GUM_ERROR(OperationNotAllowed,
373  "LRSWrapper< GUM_SCALAR >::computeVolume : "
374  "volume is only for V-representation or "
375  "fillV has not been called with all "
376  "vertices, current state is still : "
378 
379  // coutOff__();
380 
381  getVolume__ = true;
382 
383  initLrs__();
384 
385  do {
386  for (decltype(dic__->d) col = 0, end = dic__->d; col <= end; col++)
387  lrs_getsolution(dic__, dat__, lrsOutput__, col);
388  } while (lrs_getnextbasis(&dic__, dat__, 0L));
389 
390  int64_t Nsize
391  = (dat__->Nvolume[0] > 0) ? dat__->Nvolume[0] : -dat__->Nvolume[0];
392  int64_t Dsize
393  = (dat__->Dvolume[0] > 0) ? dat__->Dvolume[0] : -dat__->Dvolume[0];
394 
395  int64_t num = 0L, den = 0L;
396  int64_t tmp;
397 
398  for (decltype(Nsize) i = Nsize - 1; i > 0; i--) {
399  tmp = dat__->Nvolume[i];
400 
401  for (decltype(i) j = 1; j < i; j++)
402  tmp *= BASE;
403 
404  num += tmp;
405  }
406 
407  for (decltype(Dsize) i = Dsize - 1; i > 0; i--) {
408  tmp = dat__->Dvolume[i];
409 
410  for (decltype(i) j = 1; j < i; j++)
411  tmp *= BASE;
412 
413  den += tmp;
414  }
415 
416  volume__ = num * 1.0 / den;
417 
418  freeLrs__();
419 
420  // coutOn__();
421  }
void initLrs__()
Initialize lrs structs and first basis according to flags.
lrs_dat * dat__
Structure for holding static problem data of lrs.
Definition: LrsWrapper.h:185
lrs_mp_vector lrsOutput__
One line of output of lrs : aither a ray, a vertex, a facet or a linearity.
Definition: LrsWrapper.h:190
lrs_dic * dic__
Structure for holding current dictionary and indices of lrs.
Definition: LrsWrapper.h:182
GUM_SCALAR volume__
The volume of the polytope, if computed, 0 otherwise.
Definition: LrsWrapper.h:156
states__ state__
The current state of the LrsWrapper.
Definition: LrsWrapper.h:153
#define BASE
Definition: LrsWrapper.h:73
void freeLrs__()
Free lrs space.
#define GUM_ERROR(type, msg)
Definition: exceptions.h:54
const char * setUpStateNames__[5]
To print an enum field name instead of it&#39;s value.
Definition: LrsWrapper.h:160

◆ coutOff__()

template<typename GUM_SCALAR >
void gum::credal::LRSWrapper< GUM_SCALAR >::coutOff__ ( ) const
private

The function that redirects standard cout to /dev/null.

Definition at line 724 of file LrsWrapper_tpl.h.

724  {
725  fflush(stdout);
726 #ifdef _MSC_VER
727  freopen("NUL", "w", stdout);
728 #else // _MSC_VER
729  oldCout__ = dup(1);
730 
731  int new_cout = open("/dev/null", O_WRONLY);
732  dup2(new_cout, 1);
733  close(new_cout);
734 #endif // _MSC_VER
735  }
int oldCout__
File descriptor of standard cout.
Definition: LrsWrapper.h:176

◆ coutOn__()

template<typename GUM_SCALAR >
void gum::credal::LRSWrapper< GUM_SCALAR >::coutOn__ ( ) const
private

The function that restores standard cout.

Definition at line 738 of file LrsWrapper_tpl.h.

738  {
739  fflush(stdout);
740 #ifdef _MSC_VER
741  freopen("CON", "w", stdout);
742 #else // _MSC_VER
743  dup2(oldCout__, 1);
744  close(oldCout__);
745 #endif // _MSC_VER
746  }
int oldCout__
File descriptor of standard cout.
Definition: LrsWrapper.h:176

◆ elimRedundVrep()

template<typename GUM_SCALAR >
void gum::credal::LRSWrapper< GUM_SCALAR >::elimRedundVrep ( )

V-Redundancy elimination.

Eliminates redundant vertices from a polytope V-representation input input__.

Definition at line 424 of file LrsWrapper_tpl.h.

424  {
426  GUM_ERROR(
427  OperationNotAllowed,
428  "LRSWrapper< GUM_SCALAR >::elimRedundVrep : only for "
429  "V-representation or fillV has not been called with all vertices, "
430  "current state is still : "
431  << setUpStateNames__[static_cast< int >(state__)]);
432 
433  // coutOff__();
434 
435  initLrs__();
436 
437  int64_t* redineq; /* redineq[i]=0 if ineq i non-red,1 if red,2 linearity */
438 
439  /*********************************************************************************/
440  /* Test each row of the dictionary to see if it is redundant */
441  /*********************************************************************************/
442 
443  /* note some of these may have been changed in getting initial dictionary
444  */
445  auto m = dic__->m_A;
446  auto d = dic__->d;
447  /* number of linearities in input */ /* should be 0 ! */
448  auto nlinearity = dat__->nlinearity;
449  auto lastdv = dat__->lastdv;
450 
451  /* linearities are not considered for redundancy */
452  redineq = (int64_t*)calloc(std::size_t(m + 1), sizeof(int64_t));
453 
454  for (decltype(nlinearity) i = 0; i < nlinearity; i++)
455  redineq[dat__->linearity[i]] = 2L;
456 
457  /* rows 0..lastdv are cost, decision variables, or linearities */
458  /* other rows need to be tested */
459 
460  for (decltype(m + d) index = lastdv + 1, end = m + d; index <= end;
461  index++) {
462  /* input inequality number of current index */
463  auto ineq
464  = dat__->inequality[index - lastdv]; /* the input inequality number
465  corr. to this index */
466 
467  redineq[ineq] = checkindex(dic__, dat__, index);
468  }
469 
470  /* linearities */
471  if (nlinearity > 0)
472  GUM_ERROR(FatalError,
473  "LRSWrapper< GUM_SCALAR >::elimRedundVrep : not "
474  "reading a vertex but a linearity !");
475 
476  /* count number of non-redundant inequalities */
477  /*
478  auto nredund = nlinearity;
479  for ( decltype ( m ) i = 1; i <= m; i++ )
480  if ( redineq[ i ] == 0 )
481  nredund++;
482  */
483 
484  //__vertices = nredund;
485  //__output = std::vector< std::vector< GUM_SCALAR > > ( nredund,
486  // std::vector<
487  // GUM_SCALAR > ( dat__->n - 1 ) );
488 
489  for (decltype(m) i = 1; i <= m; i++)
490  if (redineq[i] == 0)
491  output__.push_back(
492  std::vector< GUM_SCALAR >(++input__[std::size_t(i - 1)].begin(),
493  input__[std::size_t(i - 1)].end()));
494 
495  vertices__ = (unsigned int)output__.size();
496 
497  freeLrs__();
498 
499  // coutOn__();
500  }
void initLrs__()
Initialize lrs structs and first basis according to flags.
lrs_dat * dat__
Structure for holding static problem data of lrs.
Definition: LrsWrapper.h:185
lrs_dic * dic__
Structure for holding current dictionary and indices of lrs.
Definition: LrsWrapper.h:182
states__ state__
The current state of the LrsWrapper.
Definition: LrsWrapper.h:153
unsigned int vertices__
The number of vertices of the polytope.
Definition: LrsWrapper.h:127
matrix input__
Input matrix - either a V-representation or an H-representation.
Definition: LrsWrapper.h:113
matrix output__
Output matrix - either a V-representation or an H-representation.
Definition: LrsWrapper.h:117
void freeLrs__()
Free lrs space.
#define GUM_ERROR(type, msg)
Definition: exceptions.h:54
const char * setUpStateNames__[5]
To print an enum field name instead of it&#39;s value.
Definition: LrsWrapper.h:160

◆ fill__()

template<typename GUM_SCALAR >
void gum::credal::LRSWrapper< GUM_SCALAR >::fill__ ( ) const
private

Fill lrs_dictionnary and datas from input__ using integer rationals.

Build polyhedron constraints and objective. Rational< GUM_SCALAR >::continuedFrac is the default algorithm used to approximate reals by integer rationals.

Definition at line 562 of file LrsWrapper_tpl.h.

562  {
563  std::size_t cols = input__[0].size();
564 
565  int64_t* num = new int64_t[cols]; // ISO C++ forbids variable length array,
566  // we need to do this instead
567  int64_t* den = new int64_t[cols];
568 
569  int64_t rows = int64_t(input__.size());
570 
571  int64_t numerator, denominator;
572 
573  for (int64_t row = 0; row < rows; row++) {
574  for (std::size_t col = 0; col < cols; col++) {
576  numerator,
577  denominator,
578  input__[std::size_t(row)][col]);
579 
580  num[col] = numerator;
581  den[col] = denominator;
582  }
583 
584  /* GE is inequality, EQ is equation */
585  /* 1L, 0L respectively */
586  lrs_set_row(dic__,
587  dat__,
588  int64_t(row + 1),
589  num,
590  den,
591  1L); // do NOT forget this + 1 on row
592  }
593 
594  delete[] num;
595  delete[] den;
596  }
lrs_dat * dat__
Structure for holding static problem data of lrs.
Definition: LrsWrapper.h:185
lrs_dic * dic__
Structure for holding current dictionary and indices of lrs.
Definition: LrsWrapper.h:182
static void continuedFracFirst(int64_t &numerator, int64_t &denominator, const GUM_SCALAR &number, const double &zero=1e-6)
Find the first best rational approximation.
Definition: rational_tpl.h:94
matrix input__
Input matrix - either a V-representation or an H-representation.
Definition: LrsWrapper.h:113

◆ fillH()

template<typename GUM_SCALAR >
void gum::credal::LRSWrapper< GUM_SCALAR >::fillH ( const GUM_SCALAR &  min,
const GUM_SCALAR &  max,
const Size modal 
)

Creates the H-representation of min <= p(X=modal | .) <= max and add it to the problem input input__.

Parameters
minThe lower value of p(X=modal | .).
maxThe upper value of p(X=modal | .).
modalThe modality on which we put constraints.

Definition at line 185 of file LrsWrapper_tpl.h.

187  {
188  if (state__ != states__::Hup)
189  GUM_ERROR(
190  OperationNotAllowed,
191  "LRSWrapper< GUM_SCALAR >::fillH : setUpH or nextInput has not "
192  "been called or H-representation is complete, current state is : "
193  << setUpStateNames__[static_cast< int >(state__)]);
194 
195  if (modal >= card__)
196  GUM_ERROR(OutOfBounds,
197  "LRSWrapper< GUM_SCALAR >::fillH : modality is "
198  "greater or equal than cardinality : "
199  << modal << " >= " << card__);
200 
201  input__[modal * 2][0] = -min;
202  input__[modal * 2][modal + 1] = 1;
203 
204  input__[modal * 2 + 1][0] = max;
205  input__[modal * 2 + 1][modal + 1] = -1;
206 
207  vertex__[modal] = max;
208 
209  insertedModals__.insert(int(modal));
210 
212  }
states__ state__
The current state of the LrsWrapper.
Definition: LrsWrapper.h:153
std::vector< GUM_SCALAR > vertex__
In case we have lower = upper for all modalities, a point probability, there is no need to use lrs...
Definition: LrsWrapper.h:136
std::unordered_set< int > insertedModals__
To keep track of which constraints over modalities have been inserted.
Definition: LrsWrapper.h:124
unsigned int card__
Cardinality of the variable.
Definition: LrsWrapper.h:120
matrix input__
Input matrix - either a V-representation or an H-representation.
Definition: LrsWrapper.h:113
#define GUM_ERROR(type, msg)
Definition: exceptions.h:54
const char * setUpStateNames__[5]
To print an enum field name instead of it&#39;s value.
Definition: LrsWrapper.h:160

◆ fillMatrix()

template<typename GUM_SCALAR >
void gum::credal::LRSWrapper< GUM_SCALAR >::fillMatrix ( const std::vector< std::vector< GUM_SCALAR > > &  matrix)

Fill the H-representation from the matrix given in argument.

Parameters
matrixThe H-representation of the polytope of the form 0 <= -b
  • Ax, A is the matrix, each column the coefficient of the variable in x.

Definition at line 215 of file LrsWrapper_tpl.h.

216  {
217  if (state__ != states__::Hup)
218  GUM_ERROR(
219  OperationNotAllowed,
220  "LRSWrapper< GUM_SCALAR >::fillH : setUpH or nextInput has not "
221  "been called or H-representation is complete, current state is : "
222  << setUpStateNames__[static_cast< int >(state__)]);
223 
224  if (matrix[0].size() - 1 != card__)
225  GUM_ERROR(OutOfBounds,
226  "LRSWrapper< GUM_SCALAR >::fillMatrix : size is "
227  "different than cardinality : "
228  << (matrix[0].size() - 1) << " != " << card__);
229 
230  input__ = matrix;
231 
232  for (unsigned int modal = 0; modal < card__; modal++) {
233  insertedModals__.insert(modal);
234  }
235 
237  }
states__ state__
The current state of the LrsWrapper.
Definition: LrsWrapper.h:153
typename std::vector< std::vector< GUM_SCALAR > > matrix
Shortcut for dynamic matrix using vectors.
Definition: LrsWrapper.h:109
std::unordered_set< int > insertedModals__
To keep track of which constraints over modalities have been inserted.
Definition: LrsWrapper.h:124
unsigned int card__
Cardinality of the variable.
Definition: LrsWrapper.h:120
matrix input__
Input matrix - either a V-representation or an H-representation.
Definition: LrsWrapper.h:113
#define GUM_ERROR(type, msg)
Definition: exceptions.h:54
const char * setUpStateNames__[5]
To print an enum field name instead of it&#39;s value.
Definition: LrsWrapper.h:160

◆ fillV()

template<typename GUM_SCALAR >
void gum::credal::LRSWrapper< GUM_SCALAR >::fillV ( const std::vector< GUM_SCALAR > &  vertex)

Creates the V-representation of a polytope by adding a vertex to the problem input input__.

Parameters
vertexThe vertex we wish to add to the V-representation of the polytope.

Definition at line 240 of file LrsWrapper_tpl.h.

240  {
241  if (state__ != states__::Vup)
242  GUM_ERROR(
243  OperationNotAllowed,
244  "LRSWrapper< GUM_SCALAR >::fillV : setUpV or nextInput has not "
245  "been called or V-representation is complete, current state is : "
246  << setUpStateNames__[static_cast< int >(state__)]);
247 
248  if (insertedVertices__.size() == vertices__)
249  GUM_ERROR(OutOfBounds,
250  "LRSWrapper< GUM_SCALAR >::fillV : input is already full with "
251  << vertices__ << " vertices.");
252 
253  bool eq = true;
254 
255  for (const auto& v: insertedVertices__) {
256  eq = true;
257 
258  for (decltype(card__) mod = 0; mod < card__; mod++)
259  if (std::fabs(v[mod] - vertex[mod]) > 1e-6) {
260  eq = false;
261  break;
262  }
263 
264  if (eq) {
265  vertices__--;
266  return;
267  // GUM_ERROR ( DuplicateElement, "LRSWrapper< GUM_SCALAR >::fillV :
268  // vertex
269  // already present : " << vertex );
270  }
271  }
272 
273  auto row = insertedVertices__.size();
274 
275  for (decltype(card__) mod = 0; mod < card__; mod++)
276  input__[row][mod + 1] = vertex[mod];
277 
278  insertedVertices__.push_back(vertex);
279 
280  if (insertedVertices__.size() == vertices__) state__ = states__::V2Hready;
281  }
states__ state__
The current state of the LrsWrapper.
Definition: LrsWrapper.h:153
unsigned int card__
Cardinality of the variable.
Definition: LrsWrapper.h:120
std::vector< std::vector< GUM_SCALAR > > insertedVertices__
To keep track of inserted vertices and total.
Definition: LrsWrapper.h:132
unsigned int vertices__
The number of vertices of the polytope.
Definition: LrsWrapper.h:127
matrix input__
Input matrix - either a V-representation or an H-representation.
Definition: LrsWrapper.h:113
#define GUM_ERROR(type, msg)
Definition: exceptions.h:54
const char * setUpStateNames__[5]
To print an enum field name instead of it&#39;s value.
Definition: LrsWrapper.h:160

◆ freeLrs__()

template<typename GUM_SCALAR >
void gum::credal::LRSWrapper< GUM_SCALAR >::freeLrs__ ( )
private

Free lrs space.

Definition at line 695 of file LrsWrapper_tpl.h.

695  {
696  /* free space : do not change order of next lines! */
697 
698  lrs_clear_mp_vector(lrsOutput__, dat__->n);
699 
700  if (dat__->nredundcol > 0)
701  lrs_clear_mp_matrix(Lin__, dat__->nredundcol, dat__->n);
702 
703  if (dat__->runs > 0) {
704  free(dat__->isave);
705  free(dat__->jsave);
706  }
707 
708  auto savem = dic__->m; /* need this to clear dat__*/
709 
710  lrs_free_dic(dic__, dat__); /* deallocate lrs_dic */
711 
712  dat__->m = savem;
713  lrs_free_dat(dat__);
714 
715  std::string name = "LrsWrapper:";
716  std::vector< char > chars(name.c_str(), name.c_str() + name.size() + 1u);
717 
718  lrs_close(&chars[0]);
719 
720  // coutOn__();
721  }
lrs_dat * dat__
Structure for holding static problem data of lrs.
Definition: LrsWrapper.h:185
lrs_mp_vector lrsOutput__
One line of output of lrs : aither a ray, a vertex, a facet or a linearity.
Definition: LrsWrapper.h:190
lrs_dic * dic__
Structure for holding current dictionary and indices of lrs.
Definition: LrsWrapper.h:182
lrs_mp_matrix Lin__
Holds lrs input linearities if any are found.
Definition: LrsWrapper.h:193

◆ getInput()

template<typename GUM_SCALAR >
auto gum::credal::LRSWrapper< GUM_SCALAR >::getInput ( ) const

Get the intput matrix of the problem.

Returns
A constant reference to the intput__ matrix.

Definition at line 52 of file LrsWrapper_tpl.h.

52  {
53  return input__;
54  }
matrix input__
Input matrix - either a V-representation or an H-representation.
Definition: LrsWrapper.h:113

◆ getLRSWrapperOutput__()

template<typename GUM_SCALAR >
void gum::credal::LRSWrapper< GUM_SCALAR >::getLRSWrapperOutput__ ( lrs_mp  Nin,
lrs_mp  Din,
std::vector< int64_t > &  Num,
std::vector< int64_t > &  Den 
) const
private

Translate a single output from lrs.

Only vertices are supposed to be read at this step.

Parameters
NinInput numerators in mp format (returned by lrs).
DinInput denominators in mp format (returned by lrs).
NumOutput integer numerators.
DenOutput integer denominators.

Definition at line 503 of file LrsWrapper_tpl.h.

507  {
508  int64_t Nsize = (Nin[0] > 0) ? Nin[0] : -Nin[0];
509  int64_t Dsize = (Din[0] > 0) ? Din[0] : -Din[0];
510 
511  int64_t num = 0L;
512  int64_t den = 0L;
513 
514  int64_t tmp;
515 
516  for (decltype(Nsize) i = Nsize - 1; i > 0; i--) {
517  tmp = Nin[i];
518 
519  for (decltype(i) j = 1; j < i; j++)
520  tmp *= BASE;
521 
522  num += tmp;
523  }
524 
525  if (!(Din[0] == 2L && Din[1] == 1L)) { /* rational */
526  for (decltype(Dsize) i = Dsize - 1; i > 0; i--) {
527  tmp = Din[i];
528 
529  for (decltype(i) j = 1; j < i; j++)
530  tmp *= BASE;
531 
532  den += tmp;
533  }
534  } else {
535  den = 1L;
536  }
537 
538  int64_t Nsign = ((Nin[0] < 0) ? -1L : 1L);
539  int64_t Dsign = ((Din[0] < 0) ? -1L : 1L);
540 
541  if ((Nsign * Dsign) == -1L) num = -num;
542 
543  Num.push_back(num);
544  Den.push_back(den);
545  }
#define BASE
Definition: LrsWrapper.h:73

◆ getOutput()

template<typename GUM_SCALAR >
auto gum::credal::LRSWrapper< GUM_SCALAR >::getOutput ( ) const

Get the output matrix solution of the problem.

Returns
A constant reference to the output__ matrix.

Definition at line 57 of file LrsWrapper_tpl.h.

57  {
58  return output__;
59  }
matrix output__
Output matrix - either a V-representation or an H-representation.
Definition: LrsWrapper.h:117

◆ getVerticesNumber()

template<typename GUM_SCALAR >
const unsigned int & gum::credal::LRSWrapper< GUM_SCALAR >::getVerticesNumber ( ) const

Get the number of vertices of this polytope.

Returns
A constant reference to the number of vertices vertices__.

Definition at line 62 of file LrsWrapper_tpl.h.

62  {
63  return vertices__;
64  }
unsigned int vertices__
The number of vertices of the polytope.
Definition: LrsWrapper.h:127

◆ getVolume()

template<typename GUM_SCALAR >
const GUM_SCALAR & gum::credal::LRSWrapper< GUM_SCALAR >::getVolume ( ) const

Get the volume of the polytope that has been computed.

Warning
Volume can only be computed using V-representation. H-representation volume computation is not predictable.
Probabilistic polytopes are not full dimensional : they lie in the simplex' hyper plane, therefor a pseudo-volume will be computed by projecting the polytope. The projection used is the lexicographically smallest coordinate subspace.
Returns
A constant reference to the polytope volume.

Definition at line 67 of file LrsWrapper_tpl.h.

67  {
68  if (volume__ != 0)
69  return volume__;
70  else
71  GUM_ERROR(OperationNotAllowed,
72  "LRSWrapper< GUM_SCALAR >::getVolume () : "
73  "volume computation was not asked for this "
74  "credal set, call computeVolume() from a "
75  "V-representation.");
76  }
GUM_SCALAR volume__
The volume of the polytope, if computed, 0 otherwise.
Definition: LrsWrapper.h:156
#define GUM_ERROR(type, msg)
Definition: exceptions.h:54

◆ H2V()

template<typename GUM_SCALAR >
void gum::credal::LRSWrapper< GUM_SCALAR >::H2V ( )

H-representation to V-representation.

Computes the V-representation of a polytope, i.e. it's vertices, from it's H-representation, i.e. the hyper-plan inequalities.

Definition at line 284 of file LrsWrapper_tpl.h.

284  {
286  GUM_ERROR(OperationNotAllowed,
287  "LRSWrapper< GUM_SCALAR >::H2V : fillH has not been called with "
288  "all modalities, current state is still : "
289  << setUpStateNames__[static_cast< int >(state__)]);
290 
291  // check that we have a credal set and not a precise point probability,
292  // i.e.
293  // sum of vertex elements is close to one ( floating type precision )
294  GUM_SCALAR sum = 0;
295 
296  for (const auto elem: vertex__)
297  sum += elem;
298 
299  if (std::fabs(sum - 1) < 1e-6) {
300  output__ = std::vector< std::vector< GUM_SCALAR > >(1, vertex__);
301  return;
302  }
303 
304  // not precise point probability, initialize lrs
305 
306  // coutOff__();
307 
308  initLrs__();
309 
310  /* We initiate reverse search from this dictionary */
311  /* getting new dictionaries until the search is complete */
312  /* User can access each output line from output which is */
313  /* vertex/ray/facet from the lrs_mp_vector output */
314  /* prune is TRUE if tree should be pruned at current node */
315 
316  // pruning is not used
317 
318  std::vector< int64_t > Num; /* numerators of all vertices */
319  std::vector< int64_t > Den; /* denominators of all vertices */
320 
321  do {
322  for (decltype(dic__->d) col = 0, end = dic__->d; col <= end; col++)
323  if (lrs_getsolution(dic__, dat__, lrsOutput__, col)) {
324  // iszero macro could be used here for the test on right
325  if (dat__->hull
326  || ((((lrsOutput__[0])[0] == 2 || (lrsOutput__[0])[0] == -2)
327  && (lrsOutput__[0])[1] == 0)
328  ? 1L
329  : 0L)) {
330  // coutOn__();
331  /*for ( decltype(Q->n) i = 0; i < Q->n; i++ )
332  pmp ("", output[i]);*/
333  GUM_ERROR(FatalError,
334  "LRSWrapper< GUM_SCALAR >::H2V : asked for "
335  "Q-hull computation or not reading a vertex !");
336  } else
337  for (decltype(dat__->n) i = 1, end = dat__->n; i < end; i++)
339  }
340  } while (lrs_getnextbasis(&dic__, dat__, 0L));
341 
342  auto vtx = Num.size();
343  std::vector< GUM_SCALAR > vertex(card__);
344 
345  for (decltype(vtx) i = 1; i <= vtx; i++) {
346  vertex[(i - 1) % card__] = GUM_SCALAR(Num[i - 1] * 1.0 / Den[i - 1]);
347 
348  if (i % card__ == 0) {
349  output__.push_back(vertex);
350  vertices__++;
351  }
352  }
353 
354  freeLrs__();
355 
356  // coutOn__();
357  }
void initLrs__()
Initialize lrs structs and first basis according to flags.
lrs_dat * dat__
Structure for holding static problem data of lrs.
Definition: LrsWrapper.h:185
lrs_mp_vector lrsOutput__
One line of output of lrs : aither a ray, a vertex, a facet or a linearity.
Definition: LrsWrapper.h:190
lrs_dic * dic__
Structure for holding current dictionary and indices of lrs.
Definition: LrsWrapper.h:182
states__ state__
The current state of the LrsWrapper.
Definition: LrsWrapper.h:153
std::vector< GUM_SCALAR > vertex__
In case we have lower = upper for all modalities, a point probability, there is no need to use lrs...
Definition: LrsWrapper.h:136
unsigned int card__
Cardinality of the variable.
Definition: LrsWrapper.h:120
unsigned int vertices__
The number of vertices of the polytope.
Definition: LrsWrapper.h:127
void getLRSWrapperOutput__(lrs_mp Nin, lrs_mp Din, std::vector< int64_t > &Num, std::vector< int64_t > &Den) const
Translate a single output from lrs.
matrix output__
Output matrix - either a V-representation or an H-representation.
Definition: LrsWrapper.h:117
void freeLrs__()
Free lrs space.
#define GUM_ERROR(type, msg)
Definition: exceptions.h:54
const char * setUpStateNames__[5]
To print an enum field name instead of it&#39;s value.
Definition: LrsWrapper.h:160

◆ initLrs__()

template<typename GUM_SCALAR >
void gum::credal::LRSWrapper< GUM_SCALAR >::initLrs__ ( )
private

Initialize lrs structs and first basis according to flags.

Definition at line 599 of file LrsWrapper_tpl.h.

599  {
601  GUM_ERROR(OperationNotAllowed,
602  "LRSWrapper< GUM_SCALAR >::initLrs__ : not ready, current state "
603  "is still : "
604  << setUpStateNames__[static_cast< int >(state__)]);
605 
606  //__coutOff();
607 
608  std::string name = "\n*LrsWrapper:";
609  std::vector< char > chars(name.c_str(), name.c_str() + name.size() + 1u);
610  // use &chars[0] as a char*
611 
612  if (!lrs_init(&chars[0])) {
613  // coutOn__();
614  GUM_ERROR(FatalError,
615  "LRSWrapper< GUM_SCALAR >::initLrs__ : failed lrs_init");
616  }
617 
618  name = "LRSWrapper globals";
619  chars = std::vector< char >(name.c_str(), name.c_str() + name.size() + 1u);
620 
621  dat__ = lrs_alloc_dat(&chars[0]);
622 
623  if (dat__ == nullptr) {
624  // coutOn__();
625  GUM_ERROR(FatalError,
626  "LRSWrapper< GUM_SCALAR >::initLrs__ : failed lrs_alloc_dat");
627  }
628 
629  dat__->n = Size(input__[0].size());
630  dat__->m = Size(input__.size());
631 
632  dat__->getvolume = (getVolume__) ? 1L : 0L;
633  dat__->hull = (hull__) ? 1L : 0L;
634  dat__->polytope = (polytope__) ? 1L : 0L;
635 
636  lrsOutput__ = lrs_alloc_mp_vector(dat__->n);
637 
638  dic__ = lrs_alloc_dic(dat__);
639 
640  if (dic__ == nullptr) {
641  // coutOn__();
642  GUM_ERROR(FatalError,
643  "LRSWrapper< GUM_SCALAR >::initLrs__ : failed lrs_alloc_dic");
644  }
645 
646  fill__();
647 
648  /* Pivot to a starting dictionary */
649  if (!lrs_getfirstbasis(&dic__, dat__, &Lin__, 0L)) {
650  // coutOn__();
651  GUM_ERROR(
652  FatalError,
653  "LRSWrapper< GUM_SCALAR >::initLrs__ : failed lrs_getfirstbasis");
654  }
655 
656  /* There may have been column redundancy */
657  /* If so the linearity space is obtained and redundant */
658  /* columns are removed. User can access linearity space */
659  /* from lrs_mp_matrix Lin dimensions nredundcol x d+1 */
660 
661  decltype(dat__->nredundcol) startcol = 0;
662 
663  if (dat__->homogeneous && dat__->hull) {
664  startcol++; /* col zero not treated as redundant */
665 
666  if (!dat__->restart) {
667  // coutOn__();
668 
669  for (decltype(dat__->nredundcol) col = startcol; col < dat__->nredundcol;
670  col++)
671  lrs_printoutput(dat__, Lin__[col]);
672 
673  GUM_ERROR(FatalError,
674  "LRSWrapper< GUM_SCALAR >::initLrs__ : redundant columns !");
675  }
676  }
677  /*
678  if ( dat__->nredundcol > 0 ) {
679  coutOn__();
680 
681  for ( decltype( dat__->nredundcol ) col = 0, end =
682  dat__->nredundcol;
683  col < end;
684  col++ )
685  lrs_printoutput( dat__, Lin__[col] );
686 
687  GUM_ERROR(
688  FatalError,
689  "LRSWrapper< GUM_SCALAR >::initLrs__ : redundant columns !" );
690  }
691  */
692  }
lrs_dat * dat__
Structure for holding static problem data of lrs.
Definition: LrsWrapper.h:185
lrs_mp_vector lrsOutput__
One line of output of lrs : aither a ray, a vertex, a facet or a linearity.
Definition: LrsWrapper.h:190
void fill__() const
Fill lrs_dictionnary and datas from input__ using integer rationals.
lrs_dic * dic__
Structure for holding current dictionary and indices of lrs.
Definition: LrsWrapper.h:182
states__ state__
The current state of the LrsWrapper.
Definition: LrsWrapper.h:153
lrs_mp_matrix Lin__
Holds lrs input linearities if any are found.
Definition: LrsWrapper.h:193
matrix input__
Input matrix - either a V-representation or an H-representation.
Definition: LrsWrapper.h:113
std::size_t Size
In aGrUM, hashed values are unsigned long int.
Definition: types.h:47
#define GUM_ERROR(type, msg)
Definition: exceptions.h:54
const char * setUpStateNames__[5]
To print an enum field name instead of it&#39;s value.
Definition: LrsWrapper.h:160

◆ nextHInput()

template<typename GUM_SCALAR >
void gum::credal::LRSWrapper< GUM_SCALAR >::nextHInput ( )

Reset the wrapper for next computation for a H-representation with the same variable cardinality and number of inequalities.

Usefull when creating credal networks specified as intervals over modalities.

Reset wrapper state state__ to it's previous state and clear output matrix output__. Keeps the cardinality card__ of the variable and therefor the input matrix intput__ structure.

Definition at line 153 of file LrsWrapper_tpl.h.

153  {
154  insertedModals__.clear();
155  insertedVertices__.clear();
156  output__.clear();
157  vertex__.clear();
158  vertex__.resize(card__, 0);
159 
160  volume__ = 0;
161  vertices__ = 0;
162 
163  getVolume__ = false;
164  hull__ = false;
165  polytope__ = false;
166 
169  else if (state__ == states__::V2Hready) {
171  GUM_ERROR(
172  OperationNotAllowed,
173  "LRSWrapper< GUM_SCALAR >::nextHInput : only for H-representation "
174  "as input. Previous state was : "
175  << setUpStateNames__[static_cast< int >(state__)]);
176  } else {
177  input__.clear();
179  card__ = 0;
180  vertex__.clear();
181  }
182  }
GUM_SCALAR volume__
The volume of the polytope, if computed, 0 otherwise.
Definition: LrsWrapper.h:156
states__ state__
The current state of the LrsWrapper.
Definition: LrsWrapper.h:153
std::vector< GUM_SCALAR > vertex__
In case we have lower = upper for all modalities, a point probability, there is no need to use lrs...
Definition: LrsWrapper.h:136
std::unordered_set< int > insertedModals__
To keep track of which constraints over modalities have been inserted.
Definition: LrsWrapper.h:124
unsigned int card__
Cardinality of the variable.
Definition: LrsWrapper.h:120
std::vector< std::vector< GUM_SCALAR > > insertedVertices__
To keep track of inserted vertices and total.
Definition: LrsWrapper.h:132
unsigned int vertices__
The number of vertices of the polytope.
Definition: LrsWrapper.h:127
matrix input__
Input matrix - either a V-representation or an H-representation.
Definition: LrsWrapper.h:113
matrix output__
Output matrix - either a V-representation or an H-representation.
Definition: LrsWrapper.h:117
#define GUM_ERROR(type, msg)
Definition: exceptions.h:54
const char * setUpStateNames__[5]
To print an enum field name instead of it&#39;s value.
Definition: LrsWrapper.h:160

◆ setUpH()

template<typename GUM_SCALAR >
void gum::credal::LRSWrapper< GUM_SCALAR >::setUpH ( const Size card)

Sets up an H-representation.

Initialize input matrix input__ to correct dimensions and wrapper state state__ to states__::Hup.

Parameters
cardA constant reference to the cardinality of the variable.

Definition at line 79 of file LrsWrapper_tpl.h.

79  {
80  if (card < 2)
81  GUM_ERROR(OperationNotAllowed,
82  "LRSWrapper< GUM_SCALAR >::setUpH : "
83  "cardinality must be at least 2");
84 
85  tearDown();
86 
87  input__ = std::vector< std::vector< GUM_SCALAR > >(
88  card * 2 + 2,
89  std::vector< GUM_SCALAR >(card + 1, 0));
90 
91  input__[card * 2] = std::vector< GUM_SCALAR >(card + 1, -1);
92  input__[card * 2][0] = 1;
93 
94  input__[card * 2 + 1] = std::vector< GUM_SCALAR >(card + 1, 1);
95  input__[card * 2 + 1][0] = -1;
96 
97  output__ = std::vector< std::vector< GUM_SCALAR > >();
98 
99  vertex__ = std::vector< GUM_SCALAR >(card);
100 
102 
103  card__ = (unsigned int)card;
104  }
states__ state__
The current state of the LrsWrapper.
Definition: LrsWrapper.h:153
void tearDown()
Reset the wrapper as if it was built.
std::vector< GUM_SCALAR > vertex__
In case we have lower = upper for all modalities, a point probability, there is no need to use lrs...
Definition: LrsWrapper.h:136
unsigned int card__
Cardinality of the variable.
Definition: LrsWrapper.h:120
matrix input__
Input matrix - either a V-representation or an H-representation.
Definition: LrsWrapper.h:113
matrix output__
Output matrix - either a V-representation or an H-representation.
Definition: LrsWrapper.h:117
#define GUM_ERROR(type, msg)
Definition: exceptions.h:54

◆ setUpV()

template<typename GUM_SCALAR >
void gum::credal::LRSWrapper< GUM_SCALAR >::setUpV ( const Size card,
const Size vertices 
)

Sets up a V-representation.

Initialize input matrix input__ to correct dimensions and wrapper state state__ to states__::Vup.

Parameters
cardA constant reference to the cardinality of the variable.
verticesA constant reference to the number of vertices of the polytope.

Definition at line 107 of file LrsWrapper_tpl.h.

107  {
108  if (card < 2)
109  GUM_ERROR(OperationNotAllowed,
110  "LRSWrapper< GUM_SCALAR >::setUpV : "
111  "cardinality must be at least 2");
112 
113  if (vertices < 2)
114  GUM_ERROR(OperationNotAllowed,
115  "LRSWrapper< GUM_SCALAR >::setUpV : vertices "
116  "must be at least 2 to build a polytope");
117 
118  tearDown();
119 
120  input__ = std::vector< std::vector< GUM_SCALAR > >(
121  vertices,
122  std::vector< GUM_SCALAR >(card + 1, 1));
123 
124  output__ = std::vector< std::vector< GUM_SCALAR > >();
125 
127 
128  card__ = (unsigned int)card;
129  vertices__ = (unsigned int)vertices;
130  }
states__ state__
The current state of the LrsWrapper.
Definition: LrsWrapper.h:153
void tearDown()
Reset the wrapper as if it was built.
unsigned int card__
Cardinality of the variable.
Definition: LrsWrapper.h:120
unsigned int vertices__
The number of vertices of the polytope.
Definition: LrsWrapper.h:127
matrix input__
Input matrix - either a V-representation or an H-representation.
Definition: LrsWrapper.h:113
matrix output__
Output matrix - either a V-representation or an H-representation.
Definition: LrsWrapper.h:117
#define GUM_ERROR(type, msg)
Definition: exceptions.h:54

◆ tearDown()

template<typename GUM_SCALAR >
void gum::credal::LRSWrapper< GUM_SCALAR >::tearDown ( )

Reset the wrapper as if it was built.

Reset wrapper state state__ to states__::none and clear all member datas.

Definition at line 133 of file LrsWrapper_tpl.h.

133  {
134  input__.clear();
135  output__.clear();
136  vertex__.clear();
137  insertedModals__.clear();
138 
139  insertedVertices__.clear();
140  vertices__ = 0;
141 
142  volume__ = 0;
143 
145  card__ = 0;
146 
147  getVolume__ = false;
148  hull__ = false;
149  polytope__ = false;
150  }
GUM_SCALAR volume__
The volume of the polytope, if computed, 0 otherwise.
Definition: LrsWrapper.h:156
states__ state__
The current state of the LrsWrapper.
Definition: LrsWrapper.h:153
std::vector< GUM_SCALAR > vertex__
In case we have lower = upper for all modalities, a point probability, there is no need to use lrs...
Definition: LrsWrapper.h:136
std::unordered_set< int > insertedModals__
To keep track of which constraints over modalities have been inserted.
Definition: LrsWrapper.h:124
unsigned int card__
Cardinality of the variable.
Definition: LrsWrapper.h:120
std::vector< std::vector< GUM_SCALAR > > insertedVertices__
To keep track of inserted vertices and total.
Definition: LrsWrapper.h:132
unsigned int vertices__
The number of vertices of the polytope.
Definition: LrsWrapper.h:127
matrix input__
Input matrix - either a V-representation or an H-representation.
Definition: LrsWrapper.h:113
matrix output__
Output matrix - either a V-representation or an H-representation.
Definition: LrsWrapper.h:117

◆ V2H()

template<typename GUM_SCALAR >
void gum::credal::LRSWrapper< GUM_SCALAR >::V2H ( )

V-representation to H-representation.

Warning
Not complete yet.

Computes the H-representation of a polytope from it's V-representation.

Definition at line 360 of file LrsWrapper_tpl.h.

360  {
361  if (!state__ == states__::V2Hready)
362  GUM_ERROR(OperationNotAllowed,
363  "LRSWrapper< GUM_SCALAR >::V2H : fillV has "
364  "not been called with all vertices, current "
365  "state is still : "
367  }
states__ state__
The current state of the LrsWrapper.
Definition: LrsWrapper.h:153
#define GUM_ERROR(type, msg)
Definition: exceptions.h:54
const char * setUpStateNames__[5]
To print an enum field name instead of it&#39;s value.
Definition: LrsWrapper.h:160

Member Data Documentation

◆ card__

template<typename GUM_SCALAR >
unsigned int gum::credal::LRSWrapper< GUM_SCALAR >::card__
private

Cardinality of the variable.

Definition at line 120 of file LrsWrapper.h.

◆ dat__

template<typename GUM_SCALAR >
lrs_dat* gum::credal::LRSWrapper< GUM_SCALAR >::dat__
private

Structure for holding static problem data of lrs.

Definition at line 185 of file LrsWrapper.h.

◆ dic__

template<typename GUM_SCALAR >
lrs_dic* gum::credal::LRSWrapper< GUM_SCALAR >::dic__
private

Structure for holding current dictionary and indices of lrs.

Definition at line 182 of file LrsWrapper.h.

◆ getVolume__

template<typename GUM_SCALAR >
bool gum::credal::LRSWrapper< GUM_SCALAR >::getVolume__
private

Definition at line 200 of file LrsWrapper.h.

◆ hull__

template<typename GUM_SCALAR >
bool gum::credal::LRSWrapper< GUM_SCALAR >::hull__
private

Definition at line 202 of file LrsWrapper.h.

◆ input__

template<typename GUM_SCALAR >
matrix gum::credal::LRSWrapper< GUM_SCALAR >::input__
private

Input matrix - either a V-representation or an H-representation.

Definition at line 113 of file LrsWrapper.h.

◆ insertedModals__

template<typename GUM_SCALAR >
std::unordered_set< int > gum::credal::LRSWrapper< GUM_SCALAR >::insertedModals__
private

To keep track of which constraints over modalities have been inserted.

When the set is full, the state changes from up to ready.

Definition at line 124 of file LrsWrapper.h.

◆ insertedVertices__

template<typename GUM_SCALAR >
std::vector< std::vector< GUM_SCALAR > > gum::credal::LRSWrapper< GUM_SCALAR >::insertedVertices__
private

To keep track of inserted vertices and total.

When set is full, the state changes from up to ready.

Definition at line 132 of file LrsWrapper.h.

◆ Lin__

template<typename GUM_SCALAR >
lrs_mp_matrix gum::credal::LRSWrapper< GUM_SCALAR >::Lin__
private

Holds lrs input linearities if any are found.

Definition at line 193 of file LrsWrapper.h.

◆ lrsOutput__

template<typename GUM_SCALAR >
lrs_mp_vector gum::credal::LRSWrapper< GUM_SCALAR >::lrsOutput__
private

One line of output of lrs : aither a ray, a vertex, a facet or a linearity.

Definition at line 190 of file LrsWrapper.h.

◆ oldCout__

template<typename GUM_SCALAR >
int gum::credal::LRSWrapper< GUM_SCALAR >::oldCout__
mutableprivate

File descriptor of standard cout.

Lrs writes a lot of stuff on standard cout. oldCout__ is used to save the current cout before redirecting it to /dev/null when calling lrs. The standard cout is restored when lrs is done.

Definition at line 176 of file LrsWrapper.h.

◆ output__

template<typename GUM_SCALAR >
matrix gum::credal::LRSWrapper< GUM_SCALAR >::output__
private

Output matrix - either a V-representation or an H-representation.

Definition at line 117 of file LrsWrapper.h.

◆ polytope__

template<typename GUM_SCALAR >
bool gum::credal::LRSWrapper< GUM_SCALAR >::polytope__
private

Definition at line 204 of file LrsWrapper.h.

◆ setUpStateNames__

template<typename GUM_SCALAR >
const char* gum::credal::LRSWrapper< GUM_SCALAR >::setUpStateNames__[5]
private
Initial value:
= {
enumStringify(states__::nHup),
enumStringify(states__::nVup),
enumStringify(states__::nH2Vready),
enumStringify(states__::nV2Hready),
}

To print an enum field name instead of it's value.

Used with GUM_ERROR.

Definition at line 160 of file LrsWrapper.h.

◆ state__

template<typename GUM_SCALAR >
states__ gum::credal::LRSWrapper< GUM_SCALAR >::state__
private

The current state of the LrsWrapper.

Definition at line 153 of file LrsWrapper.h.

◆ vertex__

template<typename GUM_SCALAR >
std::vector< GUM_SCALAR > gum::credal::LRSWrapper< GUM_SCALAR >::vertex__
private

In case we have lower = upper for all modalities, a point probability, there is no need to use lrs.

Definition at line 136 of file LrsWrapper.h.

◆ vertices__

template<typename GUM_SCALAR >
unsigned int gum::credal::LRSWrapper< GUM_SCALAR >::vertices__
private

The number of vertices of the polytope.

Definition at line 127 of file LrsWrapper.h.

◆ volume__

template<typename GUM_SCALAR >
GUM_SCALAR gum::credal::LRSWrapper< GUM_SCALAR >::volume__
private

The volume of the polytope, if computed, 0 otherwise.

Definition at line 156 of file LrsWrapper.h.


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