aGrUM  0.16.0
orderedTriangulation.cpp
Go to the documentation of this file.
1 
30 #include <agrum/agrum.h>
31 
33 
34 namespace gum {
35 
39  const JunctionTreeStrategy& JTStrategy,
40  bool minimality) :
41  StaticTriangulation(elimSeq, JTStrategy, minimality) {
42  // for debugging purposes
43  GUM_CONSTRUCTOR(OrderedTriangulation);
44  }
45 
48  const UndiGraph* theGraph,
49  const NodeProperty< Size >* dom,
50  const std::vector< NodeId >* order,
52  const JunctionTreeStrategy& JTStrategy,
53  bool minimality) :
54  StaticTriangulation(theGraph, dom, elimSeq, JTStrategy, minimality),
55  __order(order) {
56  static_cast< OrderedEliminationSequenceStrategy* >(
58  ->setOrder(__order);
59 
60  // for debugging purposes
61  GUM_CONSTRUCTOR(OrderedTriangulation);
62  }
63 
64  // copy constructor
66  StaticTriangulation(from), __order(from.__order) {
67  // for debugging purposes
68  GUM_CONS_CPY(OrderedTriangulation);
69  }
70 
71  // move constructor
73  StaticTriangulation(std::move(from)), __order(from.__order) {
74  // for debugging purposes
75  GUM_CONS_MOV(OrderedTriangulation);
76  }
77 
80  return new OrderedTriangulation(
81  static_cast< const OrderedEliminationSequenceStrategy& >(
84  }
85 
88  return new OrderedTriangulation(*this);
89  }
90 
93  // for debugging purposes
94  GUM_DESTRUCTOR(OrderedTriangulation);
95  }
96 
99  const NodeProperty< Size >* domsizes) {
100  StaticTriangulation::setGraph(graph, domsizes);
101  static_cast< OrderedEliminationSequenceStrategy* >(
103  ->setOrder(__order);
104  }
105 
107  void OrderedTriangulation::setOrder(const std::vector< NodeId >* order) {
108  __order = order;
109  static_cast< OrderedEliminationSequenceStrategy* >(
111  ->setOrder(__order);
112  }
113 
117  static_cast< OrderedEliminationSequenceStrategy* >(
119  elim->setGraph(&graph, _domain_sizes);
120  elim->setOrder(__order);
121  }
122 
123 } /* namespace gum */
virtual ~OrderedTriangulation()
destructor
An Elimination sequence algorithm that imposes a given complete ordering on the nodes elimination seq...
EliminationSequenceStrategy * _elimination_sequence_strategy
the elimination sequence strategy used by the triangulation
STL namespace.
virtual bool setGraph(UndiGraph *graph, const NodeProperty< Size > *dom_sizes) final
sets a new graph to be triangulated
virtual bool setOrder(const std::vector< NodeId > *order) final
sets the sequence of elimination
JunctionTreeStrategy * _junction_tree_strategy
the junction tree strategy used by the triangulation
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
Definition: agrum.h:25
OrderedTriangulation(const OrderedEliminationSequenceStrategy &elimSeq=OrderedEliminationSequenceStrategy(), const JunctionTreeStrategy &JTStrategy=DefaultJunctionTreeStrategy(), bool minimality=false)
default constructor
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
virtual OrderedTriangulation * copyFactory() const final
virtual copy constructor
Base Class for all the algorithms producing a junction given a set of cliques/subcliques resulting fr...
const std::vector< NodeId > * __order
the elimination sequence to apply
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
virtual void setOrder(const std::vector< NodeId > *order) final
sets the sequence of elimination (only the reference is stored)
virtual void _initTriangulation(UndiGraph &graph) final
the function called to initialize the triangulation process
virtual OrderedTriangulation * newFactory() const final
returns a fresh triangulation over the same graph and of the same type as the current object (using t...
class for graph triangulations for which we enforce a given complete ordering on the nodes eliminatio...
base class for all non-incremental triangulation methods
Base class for undirected graphs.
Definition: undiGraph.h:109
virtual void setGraph(const UndiGraph *graph, const NodeProperty< Size > *domsizes)
initialize the triangulation data structures for a new graph
virtual void setGraph(const UndiGraph *graph, const NodeProperty< Size > *domsizes) final
initialize the triangulation data structures for a new graph