48#ifndef GUM_INTERFACE_GRAPH_H
49#define GUM_INTERFACE_GRAPH_H
59 template <
typename GUM_SCALAR >
99 template <
typename GUM_SCALAR >
124 template <
typename GUM_SCALAR >
131 template <
typename GUM_SCALAR >
162 template <
typename GUM_SCALAR >
181 template <
typename GUM_SCALAR >
306#ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
307# ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
308# ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
313#ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
314# ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
315# ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
320#ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
321# ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
322# ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
Set of pairs of elements with fast search for both elements.
The class for generic Hash Tables.
Base class for undirected graphs.
This class discovers pattern in a PRM<GUM_SCALAR>'s PRMSystem<GUM_SCALAR> to speed up structured infe...
An PRMInstance is a Bayesian network fragment defined by a Class and used in a PRMSystem.
A PRMSystem is a container of PRMInstance and describe a relational skeleton.
Inner class to handle data about edges in graph.
bool operator==(const EdgeData< GUM_SCALAR > &from) const
Equality operator.
PRMInstance< GUM_SCALAR > * v
The other instance represented by thus edge.
PRMInstance< GUM_SCALAR > * u
One of the two instance represented by this edge.
LabelData * l_u
The label data of u.
LabelData * l
The labal data of this edge.
bool operator!=(const EdgeData< GUM_SCALAR > &from) const
Difference operator.
LabelData * l_v
The label data of v.
This class represent the interface graph of a given gum::prm::PRMSystem<GUM_SCALAR>.
const PRMSystem< GUM_SCALAR > * _sys_
The gum::prm::PRMSystem<GUM_SCALAR> represented by this interface graph.
NodeProperty< NodeData< GUM_SCALAR > * > _nodes_
Data associated with a node in graph.
Size size(const LabelData *l) const
Returns the number of node or edges labelled by l.
Bijection< Idx, LabelData * > & labels()
Returns the bijection between LabelData and their string representation.
UndiGraph _graph_
The interface graph.
InterfaceGraph & operator=(const InterfaceGraph &source)
Copy operator.
Idx _counter_
A counter used of assigning ids to labels.
InterfaceGraph(const PRMSystem< GUM_SCALAR > &sys)
Default constructor.
NodeId id(const PRMInstance< GUM_SCALAR > &i) const
Returns the id of i in this interface graph.
HashTable< LabelData *, Set< NodeData< GUM_SCALAR > * > * > _nodeMap_
Mapping between a LabelData and the set of NodeData<GUM_SCALAR> with that label.
EdgeData< GUM_SCALAR > & edge(NodeId u, NodeId v)
Returns data about an edge.
Set< NodeData< GUM_SCALAR > * > & nodes(const LabelData *l)
Returns the set of nodes labelled by l.
EdgeProperty< EdgeData< GUM_SCALAR > * > _edges_
Data associated with edges in graph.
~InterfaceGraph()
Destructor.
bool _erase_flag_
For shallow copies.
HashTable< LabelData *, Set< EdgeData< GUM_SCALAR > * > * > _edgeMap_
Mapping between a LabelData and the set of EdgeData<GUM_SCALAR> with that label.
void _label_(NodeData< GUM_SCALAR > *node, HashTable< std::string, LabelData * > &label_map)
Compute the label of node and add it to labels if it does not exists yet. Update node with the correc...
UndiGraph & graph()
Returns the graph of this interface graph.
NodeData< GUM_SCALAR > & node(const PRMInstance< GUM_SCALAR > *i)
Returns data about a node.
LabelData * label(Idx id)
Returns a label given its id.
Bijection< Idx, LabelData * > * _labels_
Bijection between labels and their ids.
Set< EdgeData< GUM_SCALAR > * > & edges(const LabelData *l)
Returns the set of nodes labelled by l.
HashTable< PRMInstance< GUM_SCALAR > *, NodeId > _idMap_
Mapping between PRMInstance<GUM_SCALAR> dans their id in graph.
Inner class to handle data about nodes in graph.
PRMInstance< GUM_SCALAR > * n
The instance represented by this node.
bool operator==(const NodeData< GUM_SCALAR > &from) const
Equality operator.
bool operator!=(const NodeData< GUM_SCALAR > &from) const
Difference operator.
LabelData * l
The label of this node.
std::size_t Size
In aGrUM, hashed values are unsigned long int.
Size Idx
Type for indexes.
Size NodeId
Type for node ids.
HashTable< Edge, VAL > EdgeProperty
Property on graph elements.
HashTable< NodeId, VAL > NodeProperty
Property on graph elements.
Inline implementation of gum::InterfaceGraph.
std::ostream & operator<<(std::ostream &out, const DFSCode &code)
Print code in out.
namespace for all probabilistic relational models entities
gum is the global namespace for all aGrUM entities
Inner class to handle data about labels in this interface graph.
bool operator==(const LabelData &from) const
Equality operator.
Idx id
An unique identifier for this label.
bool operator!=(const LabelData &from) const
Difference operator.
Size tree_width
The size in terms of tree width of the given label.
std::string l
The string version of this label.