aGrUM  0.16.0
triangulation.cpp
Go to the documentation of this file.
1 
29 #include <agrum/agrum.h>
30 #include <agrum/core/math/math.h>
32 
33 #ifdef GUM_NO_INLINE
35 #endif // GUM_NO_INLINE
36 
37 namespace gum {
38 
39  // constructor
41  // for debugging purposes
42  GUM_CONSTRUCTOR(Triangulation);
43  }
44 
45  // constructor with a domain size specified
47  _domain_sizes(domsizes) {
48  GUM_CONSTRUCTOR(Triangulation);
49  }
50 
51  // destructor
53  // for debugging purposes
54  GUM_DESTRUCTOR(Triangulation);
55  }
56 
57  // copy constructor
60  GUM_CONS_CPY(Triangulation);
61  }
62 
63  // move constructor
66  GUM_CONS_MOV(Triangulation);
67  }
68 
69  // returns the max of log10DomainSize of cliques in the junction tree
71  double res = 0.0;
72  double dSize;
73  const JunctionTree& jt = junctionTree(); // here, the fact that we get
74  // a junction tree ensures that _domain_sizes is different from nullptr
75 
76  for (const NodeId cl : jt) {
77  dSize = 0.0;
78 
79  for (const auto node : jt.clique(cl))
80  dSize += std::log10((*_domain_sizes)[node]);
81 
82  if (res < dSize) res = dSize;
83  }
84 
85  return res;
86  }
87 
88 } /* namespace gum */
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
double maxLog10CliqueDomainSize()
returns the max of log10DomainSize of the cliques in the junction tree.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
Definition: agrum.h:25
The class for generic Hash Tables.
Definition: hashTable.h:679
const NodeProperty< Size > * _domain_sizes
the domain sizes of the variables/nodes of the graph
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
Basic graph of cliques.
Definition: cliqueGraph.h:58
Triangulation()
default constructor
virtual ~Triangulation()
destructor
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
Interface for all the triangulation methods.
Definition: triangulation.h:47
virtual const CliqueGraph & junctionTree()=0
returns a compatible junction tree
Size NodeId
Type for node ids.
Definition: graphElements.h:98