aGrUM  0.14.2
partialOrderedTriangulation.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  * Copyright (C) 2005 by Christophe GONZALES and Pierre-Henri WUILLEMIN *
3  * {prenom.nom}_at_lip6.fr *
4  * *
5  * This program is free software; you can redistribute it and/or modify *
6  * it under the terms of the GNU General Public License as published by *
7  * the Free Software Foundation; either version 2 of the License, or *
8  * (at your option) any later version. *
9  * *
10  * This program is distributed in the hope that it will be useful, *
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13  * GNU General Public License for more details. *
14  * *
15  * You should have received a copy of the GNU General Public License *
16  * along with this program; if not, write to the *
17  * Free Software Foundation, Inc., *
18  * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
19  ***************************************************************************/
27 #include <agrum/agrum.h>
28 
30 
31 namespace gum {
32 
33  // default constructor
36  const JunctionTreeStrategy& JTStrategy,
37  bool minimality) :
38  StaticTriangulation(elimSeq, JTStrategy, minimality) {
39  // for debugging purposes
40  GUM_CONSTRUCTOR(PartialOrderedTriangulation);
41  }
42 
43  // constructor with a given graph
45  const UndiGraph* theGraph,
46  const NodeProperty< Size >* dom,
47  const List< NodeSet >* partial_order,
49  const JunctionTreeStrategy& JTStrategy,
50  bool minimality) :
51  StaticTriangulation(theGraph, dom, elimSeq, JTStrategy, minimality),
52  __partial_order(partial_order) {
56 
57  // for debugging purposes
58  GUM_CONSTRUCTOR(PartialOrderedTriangulation);
59  }
60 
61  // copy constructor
63  const PartialOrderedTriangulation& from) :
64  StaticTriangulation(from),
66  // for debugging purposes
67  GUM_CONS_CPY(PartialOrderedTriangulation);
68  }
69 
70  // move constructor
73  StaticTriangulation(std::move(from)),
75  // for debugging purposes
76  GUM_CONS_MOV(PartialOrderedTriangulation);
77  }
78 
81  return new PartialOrderedTriangulation(
82  static_cast< const PartialOrderedEliminationSequenceStrategy& >(
85  }
86 
89  return new PartialOrderedTriangulation(*this);
90  }
91 
94  // for debugging purposes
95  GUM_DESTRUCTOR(PartialOrderedTriangulation);
96  }
97 
99  void
101  const NodeProperty< Size >* domsizes) {
102  StaticTriangulation::setGraph(graph, domsizes);
106  }
107 
110  const List< NodeSet >* partial_order) {
111  __partial_order = partial_order;
115  }
116 
122  elim->setGraph(&graph, _domain_sizes);
124  }
125 
126 } /* namespace gum */
EliminationSequenceStrategy * _elimination_sequence_strategy
the elimination sequence strategy used by the triangulation
const List< NodeSet > * __partial_order
the partial ordering to apply to eliminate nodes
virtual bool setPartialOrder(const List< NodeSet > *subsets)
sets a new partial ordering constraint on the elimination sequence
STL namespace.
JunctionTreeStrategy * _junction_tree_strategy
the junction tree strategy used by the triangulation
virtual void _initTriangulation(UndiGraph &graph) final
the function called to initialize the triangulation process
Generic doubly linked lists.
Definition: list.h:369
gum is the global namespace for all aGrUM entities
Definition: agrum.h:25
virtual PartialOrderedTriangulation * newFactory() const
returns a fresh triangulation (over an empty graph) of the same type as the current object ...
The class for generic Hash Tables.
Definition: hashTable.h:676
PartialOrderedTriangulation(const PartialOrderedEliminationSequenceStrategy &elimSeq=DefaultPartialOrderedEliminationSequenceStrategy(), const JunctionTreeStrategy &JTStrategy=DefaultJunctionTreeStrategy(), bool minimality=false)
default constructor
const NodeProperty< Size > * _domain_sizes
the domain sizes of the variables/nodes of the graph
Base class for all elimination sequence algorithm that impose a given partial ordering on the nodes e...
virtual bool setGraph(UndiGraph *graph, const NodeProperty< Size > *dom_sizes)
sets a new graph to be triangulated
class for graph triangulations for which we enforce a given partial ordering on the nodes elimination...
Base Class for all the algorithms producing a junction given a set of cliques/subcliques resulting fr...
virtual void setPartialOrder(const List< NodeSet > *partial_order) final
sets the elimination sequence&#39;s partial order (only a reference is stored)
virtual PartialOrderedTriangulation * copyFactory() const final
virtual copy constructor
class for graph triangulations for which we enforce a given partial ordering on the nodes elimination...
base class for all non-incremental triangulation methods
Base class for undirected graphs.
Definition: undiGraph.h:106
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