aGrUM  0.14.2
classDependencyGraph.h
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 #ifndef GUM_ClassDependencyGraph_H
28 #define GUM_ClassDependencyGraph_H
29 
30 #include <agrum/PRM/PRM.h>
31 
32 namespace gum {
33  namespace prm {
34 
43  template < typename GUM_SCALAR >
45  public:
47  typedef std::pair< const PRMClassElementContainer< GUM_SCALAR >*,
50 
51  // ========================================================================
53  // ========================================================================
55 
60 
63 
66 
68  // ========================================================================
70  // ========================================================================
72 
75  const DAG& dag() const;
76 
81  const EltPair& get(NodeId id) const;
82 
92  const PRMClassElement< GUM_SCALAR >& elt) const;
93 
98  const NodeProperty< Size >& modalities() const;
99 
101  private:
103  void __buildGraph(const PRM< GUM_SCALAR >& prm);
104 
107  const PRMClassElement< GUM_SCALAR >& elt);
108 
110  void
112  NodeId node,
114 
117 
124 
131 
133  typedef HashTable<
137 
142  };
143 
144 
145 #ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
146  extern template class ClassDependencyGraph< double >;
147 #endif
148 
149  } /* namespace prm */
150 } /* namespace gum */
151 
153 
154 #endif /* GUM_ClassDependencyGraph_H */
Inline implementation of ClassDependencyGraph.
const DAG & dag() const
Returns a constant reference over the graph of the DAG representing the ClassDependencyGraph<GUM_SCAL...
Abstract class representing an element of PRM class.
Headers of PRM.
NodeMap __node_map
Map each Class to a HashTable mapping the Class&#39;s ClassElements to their assigned NodeId in __graph...
gum is the global namespace for all aGrUM entities
Definition: agrum.h:25
ClassDependencyGraph(const PRM< GUM_SCALAR > &prm)
Default constructor.
The class for generic Hash Tables.
Definition: hashTable.h:676
std::pair< const PRMClassElementContainer< GUM_SCALAR > *, const PRMClassElement< GUM_SCALAR > *> EltPair
Association between a class element and it&#39;s holding class.
NodeProperty< Size > __modalitites
The modalities map for each node in the ClassDependencyGraph<GUM_SCALAR>. This is useful when using a...
void __buildGraph(const PRM< GUM_SCALAR > &prm)
Build the class dependency graph.
This class represent the dependencies of all classes in a PRM<GUM_SCALAR>.
void __addNode(const PRMClassElementContainer< GUM_SCALAR > *c, const PRMClassElement< GUM_SCALAR > &elt)
Add nodes in __graph while updating consequently all the mappings.
This class represents a Probabilistic Relational PRMSystem<GUM_SCALAR>.
Definition: PRM.h:63
<agrum/PRM/classElementContainer.h>
HashTable< const PRMClassElementContainer< GUM_SCALAR > *, HashTable< const PRMClassElement< GUM_SCALAR > *, NodeId > *> NodeMap
Code shortcut.
void __addArcs(const PRMClassElementContainer< GUM_SCALAR > &c, NodeId node, HashTable< const PRMClassElement< GUM_SCALAR > *, NodeId > &map)
Add arcs in __graph.
const NodeProperty< Size > & modalities() const
Returns a mapping between the ClassDependencyGraph<GUM_SCALAR>&#39;s nodes and their modalities.
Base class for dag.
Definition: DAG.h:99
Size NodeId
Type for node ids.
Definition: graphElements.h:97
NodeProperty< EltPair *> __elt_map
Mapping between the nodes in __graph with the PRMClassElement<GUM_SCALAR> in the PRM<GUM_SCALAR>.