![]() |
aGrUM 2.3.2
a C++ library for (probabilistic) graphical models
|
Basic graph of cliques. More...
#include <cliqueGraph.h>
Classes | |
| struct | _RunningIntersect_ |
| structure used for the computation of the running intersection property More... | |
Public Types | |
| using | EdgeIterator = EdgeSetIterator |
| using | NodeIterator = NodeGraphPartIterator |
| using | NodeConstIterator = NodeGraphPartIterator |
| using | NodeIteratorSafe = NodeGraphPartIteratorSafe |
| using | NodeConstIteratorSafe = NodeGraphPartIteratorSafe |
| using | node_iterator = NodeGraphPartIterator |
| types for STL compliance | |
| using | node_const_iterator = NodeGraphPartIterator |
| types for STL compliance | |
| using | node_iterator_safe = NodeGraphPartIteratorSafe |
| types for STL compliance | |
| using | node_const_iterator_safe = NodeGraphPartIteratorSafe |
| types for STL compliance | |
Public Member Functions | |
Constructors / Destructors | |
| CliqueGraph (Size nodes_size=HashTableConst::default_size, bool nodes_resize_policy=true, Size edges_size=HashTableConst::default_size, bool edges_resize_policy=true) | |
| basic constructor: creates an empty clique graph | |
| CliqueGraph (const CliqueGraph &from) | |
| copy constructor | |
| virtual | ~CliqueGraph () |
| destructor | |
Accessors/Modifiers | |
| virtual void | addEdge (NodeId first, NodeId second) |
| inserts a new edge between two cliques | |
| virtual void | eraseEdge (const Edge &edge) |
| removes an edge (and its separator) from the clique graph | |
| virtual void | clearEdges () |
| removes all edges and their separators | |
| NodeId | addNode (const NodeSet &clique) |
| adds a new clique to the graph | |
| virtual NodeId | addNode () |
| adds a new clique to the graph | |
| virtual void | addNodeWithId (const NodeId id, const NodeSet &clique) |
| try to add a new clique to the graph | |
| virtual void | addNodeWithId (const NodeId id) |
| try to add a new clique to the graph | |
| virtual void | eraseNode (const NodeId node) |
| removes a given clique from the clique graph | |
| virtual void | clear () |
| removes all the cliques and separators from the graph (as well as their adjacent edges) | |
| const NodeSet & | clique (const NodeId idClique) const |
| returns the set of nodes included into a given clique | |
| NodeId | container (const NodeId idNode) const |
| returns the id of a clique containing the node the id of which is in argument | |
| virtual void | setClique (const NodeId idClique, const NodeSet &new_clique) |
| changes the set of nodes included into a given clique and returns the new set | |
| virtual void | addToClique (const NodeId clique_id, const NodeId node_id) |
| changes the set of nodes included into a given clique and returns the new set | |
| virtual void | eraseFromClique (const NodeId clique_id, const NodeId node_id) |
| remove a node from a clique | |
| const NodeSet & | separator (const Edge &edge) const |
| returns the separator included in a given edge | |
| const NodeSet & | separator (const NodeId clique1, const NodeId clique) const |
| returns the separator included in an edge specified by its extremities | |
| std::vector< NodeId > | containerPath (const NodeId node1, const NodeId node2) const |
| returns a path from a clique containing node1 to a clique containing node2 | |
| bool | hasRunningIntersection () const |
| indicates whether the running intersection property holds | |
| bool | isJoinTree () const |
| indicates whether the graph is a join tree | |
| virtual std::string | toString () const |
| friendly displays the content of the CliqueGraph | |
| virtual std::string | toDot () const |
| friendly displays the content of the CliqueGraph in DOT format | |
| virtual std::string | mapToDot (double scaleClique, double scaleSep, double lenEdge, const std::string &colorClique="burlywood", const std::string &colorSep="palegreen") const |
| friendly displays the content of the map of the CliqueGraph in DOT format | |
Operators | |
| CliqueGraph & | operator= (const CliqueGraph &from) |
| copy operator | |
| bool | operator== (const CliqueGraph &from) const |
| checks whether two clique graphs are equal | |
Operators | |
| bool | operator== (const UndiGraph &g) const |
| tests whether two UndiGraphs are identical (same nodes, same edges) | |
| bool | operator!= (const UndiGraph &g) const |
| tests whether two UndiGraphs are different | |
Operators | |
| bool | operator== (const EdgeGraphPart &p) const |
| tests whether two EdgeGraphParts contain the same edges | |
Accessors/Modifiers | |
| bool | hasUndirectedCycle () const |
| checks whether the graph contains cycles | |
| virtual UndiGraph | partialUndiGraph (NodeSet nodes) |
| returns the partial graph formed by the nodes given in parameter | |
| NodeProperty< NodeId > | nodes2ConnectedComponent () const |
| returns a property {node:id of connected component} | |
Accessors/Modifiers | |
| bool | existsEdge (const Edge &edge) const |
| indicates whether a given edge exists | |
| bool | existsEdge (NodeId n1, NodeId n2) const |
| indicates whether a given edge exists | |
| bool | emptyEdges () const |
| indicates wether the EdgeGraphPart contains any edge | |
| Size | sizeEdges () const |
| indicates the number of edges stored within the EdgeGraphPart | |
| const EdgeSet & | edges () const |
| returns the set of edges stored within the EdgeGraphPart | |
| const NodeSet & | neighbours (NodeId id) const |
| returns the set of node neighbours to a given node | |
| void | eraseNeighbours (NodeId id) |
| erase all the edges adjacent to a given node | |
| void | unvirtualizedEraseNeighbours (NodeId id) |
| same function as eraseNeighbours but without any virtual call to an erase | |
| template<typename VAL> | |
| EdgeProperty< VAL > | edgesProperty (VAL(*f)(const Edge &), Size size=0) const |
| a method to create a hashMap of VAL from a set of edges (using for every edge, say x, the VAL f(x)) | |
| template<typename VAL> | |
| EdgeProperty< VAL > | edgesProperty (const VAL &val, Size size=0) const |
| a method to create a hashMap of VAL from a set of edges (using for every edge, say x, the VAL a) | |
| template<typename VAL> | |
| List< VAL > | listMapEdges (VAL(*f)(const Edge &)) const |
| a method to create a list of VAL from a set of edges (using for every edge, say x, the VAL f(x)) | |
| std::vector< NodeId > | undirectedPath (NodeId node1, NodeId node2) const |
| returns a possible path from node1 to node2 in the edge set | |
| bool | hasUndirectedPath (NodeId n1, NodeId n2) const |
| return true if n1 and n2 are connected (by an undirected path) in the graph. | |
| bool | hasUndirectedPath (NodeId n1, NodeId n2, const NodeSet &except) const |
| return true if n1 and n2 are connected (by an undirected path not using the nodes of except) in the graph. | |
| bool | hasUndirectedPath (const NodeSet &n1, const NodeSet &n2, const NodeSet &except) const |
| return true if n1 and n2 are connected (by an undirected path not using the nodes of except) in the graph. | |
Operators | |
| bool | operator== (const NodeGraphPart &p) const |
| check whether two NodeGraphParts contain the same nodes | |
| bool | operator!= (const NodeGraphPart &p) const |
| check whether two NodeGraphParts contain different nodes | |
Accessors/Modifiers | |
| void | populateNodes (const NodeGraphPart &s) |
| populateNodes clears *this and fills it with the same nodes as "s" | |
| template<typename T> | |
| void | populateNodesFromProperty (const NodeProperty< T > &h) |
| populateNodesFromProperty clears *this and fills it with the keys of "h" | |
| NodeId | nextNodeId () const |
| returns a new node id, not yet used by any node | |
| std::vector< NodeId > | addNodes (Size n) |
| insert n nodes | |
| bool | existsNode (const NodeId id) const |
| returns true iff the NodeGraphPart contains the given nodeId | |
| bool | exists (const NodeId id) const |
| alias for existsNode | |
| bool | emptyNodes () const |
| indicates whether there exists nodes in the NodeGraphPart | |
| bool | empty () const |
| alias for emptyNodes | |
| virtual void | clearNodes () |
| remove all the nodes from the NodeGraphPart | |
| Size | sizeNodes () const |
| returns the number of nodes in the NodeGraphPart | |
| Size | size () const |
| alias for sizeNodes | |
| NodeId | bound () const |
| returns a number n such that all node ids are strictly lower than n | |
| NodeSet | asNodeSet () const |
| returns a copy of the set of nodes represented by the NodeGraphPart | |
| const NodeGraphPart & | nodes () const |
| return *this as a NodeGraphPart | |
| node_iterator_safe | beginSafe () const |
| a begin iterator to parse the set of nodes contained in the NodeGraphPart | |
| const node_iterator_safe & | endSafe () const noexcept |
| the end iterator to parse the set of nodes contained in the NodeGraphPart | |
| node_iterator | begin () const noexcept |
| a begin iterator to parse the set of nodes contained in the NodeGraphPart | |
| const node_iterator & | end () const noexcept |
| the end iterator to parse the set of nodes contained in the NodeGraphPart | |
| template<typename VAL> | |
| NodeProperty< VAL > | nodesPropertyFromFunction (VAL(*f)(const NodeId &), Size size=0) const |
| a method to create a HashTable with key:NodeId and value:VAL | |
| template<typename VAL> | |
| NodeProperty< VAL > | nodesPropertyFromVal (const VAL &a, Size size=0) const |
| a method to create a hashMap with key:NodeId and value:VAL | |
| template<typename VAL> | |
| List< VAL > | listMapNodes (VAL(*f)(const NodeId &)) const |
| a method to create a list of VAL from a set of nodes (using for every nodee, say x, the VAL f(x)) | |
Static Public Member Functions | |
Constructors / Destructors | |
| static UndiGraph | completeGraph (int n) |
| create a complete UndiGraph with n nodes | |
Public Attributes | |
| Signaler2< NodeId, NodeId > | onEdgeAdded |
| Signaler2< NodeId, NodeId > | onEdgeDeleted |
| Signaler1< NodeId > | onNodeAdded |
| Signaler1< NodeId > | onNodeDeleted |
Private Member Functions | |
| void | _updateSeparators_ (const NodeId clique1) |
| function used to update the separators when a clique is modified | |
| bool | _runningIntersectionDFS_ (const NodeId clique, const NodeId from, _RunningIntersect_ &infos_DFS) const |
| function used for the computation of the running intersection property | |
| void | _checkNeighbours_ (NodeId id) |
| when the EdgeGraphPart contains no edge adjacent to a given node, this function adds an empty set entry to neighbours[id] | |
| void | _clearEdges_ () |
Private Attributes | |
| NodeProperty< NodeSet > | _cliques_ |
| the set of nodes contained into the cliques | |
| EdgeProperty< NodeSet > | _separators_ |
| the set of nodes contained into the separators | |
| EdgeSet | _edges_ |
| the set of all the edges contained within the EdgeGraphPart | |
| NodeProperty< NodeSet * > | _neighbours_ |
| for each node, the set of its adjacent edges | |
Basic graph of cliques.
A CliqueGraph is an undirected graph the nodes of which are Cliques, i.e., sets of NodeIds. Cliques are linked by Edges. These edges contain separators that are actually the intersection of the two Cliques at the extremities of the edge.
Definition at line 77 of file cliqueGraph.h.
|
inherited |
Definition at line 96 of file edgeGraphPart.h.
|
inherited |
types for STL compliance
Definition at line 276 of file nodeGraphPart.h.
|
inherited |
types for STL compliance
Definition at line 278 of file nodeGraphPart.h.
|
inherited |
types for STL compliance
Definition at line 275 of file nodeGraphPart.h.
|
inherited |
types for STL compliance
Definition at line 277 of file nodeGraphPart.h.
|
inherited |
Definition at line 285 of file nodeGraphPart.h.
|
inherited |
Definition at line 287 of file nodeGraphPart.h.
|
inherited |
Definition at line 284 of file nodeGraphPart.h.
|
inherited |
Definition at line 286 of file nodeGraphPart.h.
|
explicit |
basic constructor: creates an empty clique graph
| nodes_size | the size of the hash table used to store all the nodes |
| nodes_resize_policy | the resizing policy of this hash table |
| edges_size | the size of the hash table used to store all the edges |
| edges_resize_policy | the resizing policy of this hash table |
References gum::HashTableConst::default_size.
Referenced by CliqueGraph(), operator=(), and operator==().
| gum::CliqueGraph::CliqueGraph | ( | const CliqueGraph & | from | ) |
copy constructor
| from | the CliqueGraph that will be copied into this |
References CliqueGraph().
|
virtual |
destructor
|
privateinherited |
when the EdgeGraphPart contains no edge adjacent to a given node, this function adds an empty set entry to neighbours[id]
| id | the node whose neighbours[id] is checked |
Definition at line 67 of file edgeGraphPart_inl.h.
References _neighbours_.
Referenced by addEdge().
|
privateinherited |
Definition at line 88 of file edgeGraphPart.cpp.
References _edges_, _neighbours_, GUM_EMIT2, and onEdgeDeleted.
Referenced by ~EdgeGraphPart(), and clearEdges().
|
private |
function used for the computation of the running intersection property
References clique().
|
private |
function used to update the separators when a clique is modified
inserts a new edge between two cliques
| first | the id of one extremity of the new edge to be inserted |
| second | the id of the other extremity of the new edge to be inserted |
| InvalidNode | if first and/or second do not belong to the graph nodes |
Reimplemented from gum::EdgeGraphPart.
Referenced by gum::BinaryJoinTreeConverterDefault::_convertClique_().
|
virtual |
adds a new clique to the graph
Reimplemented from gum::NodeGraphPart.
adds a new clique to the graph
References clique().
Referenced by gum::BinaryJoinTreeConverterDefault::_convertClique_().
insert n nodes
| n | the number of nodes to add |
Definition at line 276 of file nodeGraphPart_inl.h.
Referenced by gum::DiGraph::completeGraph(), and gum::UndiGraph::completeGraph().
|
virtual |
try to add a new clique to the graph
| DuplicateElement | exception is thrown if the id of the clique already exists within the clique graph |
Reimplemented from gum::NodeGraphPart.
try to add a new clique to the graph
| DuplicateElement | exception is thrown if the id of the clique already exists within the clique graph |
References clique().
changes the set of nodes included into a given clique and returns the new set
| NotFound | exception is thrown if clique_id does not exist |
| DuplicateElement | exception is thrown if clique_id set already contains the node |
|
inherited |
returns a copy of the set of nodes represented by the NodeGraphPart
Definition at line 356 of file nodeGraphPart_inl.h.
References _boundVal_, _inHoles_(), empty(), gum::Set< Key >::insert(), and sizeNodes().
Referenced by gum::MarginalTargetedInference< GUM_SCALAR >::MarginalTargetedInference(), gum::MarginalTargetedMRFInference< GUM_SCALAR >::MarginalTargetedMRFInference(), and gum::ImportanceSampling< GUM_SCALAR >::unsharpenBN_().
|
noexceptinherited |
a begin iterator to parse the set of nodes contained in the NodeGraphPart
Definition at line 333 of file nodeGraphPart_inl.h.
References NodeGraphPartIterator, and gum::NodeGraphPartIterator::validate_().
Referenced by gum::Estimator< GUM_SCALAR >::Estimator(), populateNodesFromProperty(), and gum::Estimator< GUM_SCALAR >::setFromBN().
|
inherited |
a begin iterator to parse the set of nodes contained in the NodeGraphPart
Definition at line 321 of file nodeGraphPart_inl.h.
References NodeGraphPartIteratorSafe, and gum::NodeGraphPartIterator::validate_().
|
inherited |
returns a number n such that all node ids are strictly lower than n
Definition at line 310 of file nodeGraphPart_inl.h.
References _boundVal_.
Referenced by _clearNodes_().
|
virtual |
removes all the cliques and separators from the graph (as well as their adjacent edges)
Reimplemented from gum::NodeGraphPart.
|
virtual |
removes all edges and their separators
Reimplemented from gum::EdgeGraphPart.
|
virtualinherited |
remove all the nodes from the NodeGraphPart
Definition at line 312 of file nodeGraphPart_inl.h.
References _clearNodes_().
Referenced by gum::DiGraph::clear(), gum::MixedGraph::clear(), gum::UndiGraph::clear(), and gum::MixedGraph::operator=().
returns the set of nodes included into a given clique
| NotFound | exception is raised if the clique does not belong to the clique graph |
Referenced by _runningIntersectionDFS_(), addNode(), addNodeWithId(), gum::BarrenNodesFinder::barrenNodes(), gum::Triangulation::maxLog10CliqueDomainSize(), and separator().
|
staticinherited |
create a complete UndiGraph with n nodes
| n | int |
Definition at line 60 of file undiGraph.cpp.
References UndiGraph(), addEdge(), and gum::NodeGraphPart::addNodes().
returns the id of a clique containing the node the id of which is in argument
| NotFound | exception is thrown if no clique contains idNode |
| std::vector< NodeId > gum::CliqueGraph::containerPath | ( | const NodeId | node1, |
| const NodeId | node2 ) const |
returns a path from a clique containing node1 to a clique containing node2
| NotFound | such path cannot be found |
|
inherited |
returns the set of edges stored within the EdgeGraphPart
Definition at line 59 of file edgeGraphPart_inl.h.
References _edges_.
Referenced by gum::EssentialGraph::_buildEssentialGraph_(), gum::MeekRules::_propagatesOrientationInChainOfRemainingEdges_(), gum::BarrenNodesFinder::barrenNodes(), gum::learning::Miic::initiation_(), gum::learning::SimpleMiic::initiation_(), gum::PDAG::moralGraph(), gum::learning::SimpleMiic::propagatesOrientationInChainOfRemainingEdges_(), gum::MeekRules::propagateToCPDAG(), and gum::learning::IBNLearner::setPossibleSkeleton().
|
inherited |
a method to create a hashMap of VAL from a set of edges (using for every edge, say x, the VAL a)
| a | the default value assigned to each edge in the returned Property |
| size | an optional parameter enabling to fine-tune the returned Property. Roughly speaking, it is a good practice to have a size equal to half the number of edges. If you do not specify this parameter, the method will assign it for you. |
|
inherited |
a method to create a hashMap of VAL from a set of edges (using for every edge, say x, the VAL f(x))
| f | a function assigning a VAL to any edge |
| size | an optional parameter enabling to fine-tune the returned Property. Roughly speaking, it is a good practice to have a size equal to half the number of edges. If you do not specify this parameter, the method will assign it for you. |
|
inherited |
alias for emptyNodes
Definition at line 308 of file nodeGraphPart_inl.h.
References emptyNodes().
Referenced by asNodeSet(), gum::PDAG::cSeparation(), gum::DAG::dSeparation(), gum::prm::gspan::Pattern::remove(), and gum::PDAG::toDot().
|
inherited |
indicates wether the EdgeGraphPart contains any edge
Definition at line 55 of file edgeGraphPart_inl.h.
References _edges_.
|
inherited |
indicates whether there exists nodes in the NodeGraphPart
Definition at line 306 of file nodeGraphPart_inl.h.
References sizeNodes().
Referenced by empty().
|
noexceptinherited |
the end iterator to parse the set of nodes contained in the NodeGraphPart
Definition at line 339 of file nodeGraphPart_inl.h.
References _endIteratorSafe_, and NodeGraphPartIterator.
Referenced by gum::Estimator< GUM_SCALAR >::Estimator(), populateNodesFromProperty(), and gum::Estimator< GUM_SCALAR >::setFromBN().
|
noexceptinherited |
the end iterator to parse the set of nodes contained in the NodeGraphPart
Definition at line 329 of file nodeGraphPart_inl.h.
References _endIteratorSafe_, and NodeGraphPartIteratorSafe.
|
virtual |
removes an edge (and its separator) from the clique graph
| edge | the edge to be removed |
Reimplemented from gum::EdgeGraphPart.
Referenced by gum::BinaryJoinTreeConverterDefault::_convertClique_().
|
virtual |
remove a node from a clique
If node_id cannot be found in the clique set, then the function does nothing. In particular, it does not throw any exception.
| NotFound | exception is thrown if clique_id does not exist |
|
inherited |
erase all the edges adjacent to a given node
| id | the node the adjacent edges of which will be removed |
Definition at line 101 of file edgeGraphPart_inl.h.
References _neighbours_, gum::Set< Key >::beginSafe(), gum::Set< Key >::endSafe(), and eraseEdge().
|
virtual |
removes a given clique from the clique graph
If the CliqueGraph does not contain the node, then nothing is done. In particular, no exception is raised.
Reimplemented from gum::NodeGraphPart.
alias for existsNode
Definition at line 296 of file nodeGraphPart_inl.h.
References existsNode().
Referenced by gum::prm::StructuredInference< GUM_SCALAR >::_removeNode_(), gum::DiGraph::addArc(), gum::prm::gspan::Pattern::addArc(), gum::UndiGraph::addEdge(), gum::prm::gspan::Pattern::exists(), gum::DiGraph::hasDirectedPath(), gum::learning::IBNLearner::learnDag_(), and gum::DAG::moralizedAncestralGraph().
indicates whether a given edge exists
| edge | the edge we test whether or not it belongs to the EdgeGraphPart |
Definition at line 61 of file edgeGraphPart_inl.h.
References _edges_.
Referenced by gum::prm::GSpan< GUM_SCALAR >::_sortPatterns_(), gum::EssentialGraph::_strongly_protected_(), gum::StaticTriangulation::_triangulate_(), eraseEdge(), gum::learning::Miic::orientationMiic_(), gum::learning::SimpleMiic::orientationMiic_(), gum::learning::Miic::unshieldedTriples_(), gum::learning::SimpleMiic::unshieldedTriples_(), gum::learning::Miic::unshieldedTriplesMiic_(), and gum::learning::SimpleMiic::unshieldedTriplesMiic_().
indicates whether a given edge exists
| n1 | the id of one extremity of the edge we test the existence in the EdgeGraphPart |
| n2 | the id of the other extremity of the edge we test the existence in the EdgeGraphPart |
Definition at line 63 of file edgeGraphPart_inl.h.
References _neighbours_.
returns true iff the NodeGraphPart contains the given nodeId
Definition at line 290 of file nodeGraphPart_inl.h.
References _boundVal_, and _inHoles_().
Referenced by eraseNode(), exists(), gum::PDAG::moralizedAncestralGraph(), gum::UndiGraph::partialUndiGraph(), and gum::rec_ancestral().
| bool gum::CliqueGraph::hasRunningIntersection | ( | ) | const |
indicates whether the running intersection property holds
The function works properly even if the graph contains cycles.
|
inherited |
checks whether the graph contains cycles
Definition at line 90 of file undiGraph.cpp.
References gum::List< Val >::empty(), gum::List< Val >::front(), gum::List< Val >::insert(), gum::EdgeGraphPart::neighbours(), gum::NodeGraphPart::nodes(), gum::NodeGraphPart::nodesPropertyFromVal(), and gum::List< Val >::popFront().
|
inherited |
return true if n1 and n2 are connected (by an undirected path not using the nodes of except) in the graph.
Definition at line 222 of file edgeGraphPart.cpp.
References gum::Set< Key >::begin(), gum::Set< Key >::contains(), gum::Set< Key >::empty(), gum::Set< Key >::erase(), gum::Set< Key >::insert(), and neighbours().
return true if n1 and n2 are connected (by an undirected path) in the graph.
Definition at line 185 of file edgeGraphPart.cpp.
References gum::Set< Key >::begin(), gum::Set< Key >::contains(), gum::Set< Key >::empty(), gum::Set< Key >::erase(), gum::Set< Key >::insert(), and neighbours().
Referenced by gum::UGmodel::isIndependent(), and gum::UGmodel::isIndependent().
|
inherited |
return true if n1 and n2 are connected (by an undirected path not using the nodes of except) in the graph.
Definition at line 202 of file edgeGraphPart.cpp.
References gum::Set< Key >::begin(), gum::Set< Key >::contains(), gum::Set< Key >::empty(), gum::Set< Key >::erase(), gum::Set< Key >::insert(), and neighbours().
| bool gum::CliqueGraph::isJoinTree | ( | ) | const |
indicates whether the graph is a join tree
|
inherited |
a method to create a list of VAL from a set of edges (using for every edge, say x, the VAL f(x))
| f | a function assigning a VAL to any edge |
|
inherited |
a method to create a list of VAL from a set of nodes (using for every nodee, say x, the VAL f(x))
| f | a function assigning a VAL to any node |
References listMapNodes().
Referenced by listMapNodes().
|
virtual |
friendly displays the content of the map of the CliqueGraph in DOT format
returns the set of node neighbours to a given node
Note that the set of nodes returned may be empty if no edge within the EdgeGraphPart is adjacent the given node.
| id | the node to which the edges are adjacent |
Definition at line 96 of file edgeGraphPart_inl.h.
References _neighbours_, and gum::emptyNodeSet.
Referenced by gum::MeekRules::_applyMeekRules_(), gum::BinaryJoinTreeConverterDefault::_convertClique_(), gum::BinaryJoinTreeConverterDefault::_convertConnectedComponent_(), gum::MeekRules::_critereMinParents_(), gum::BinaryJoinTreeConverterDefault::_markConnectedComponent_(), gum::MeekRules::_propagatesOrientationInChainOfRemainingEdges_(), gum::prm::StructuredInference< GUM_SCALAR >::_removeBarrenNodes_(), gum::prm::GSpan< GUM_SCALAR >::_sortPatterns_(), gum::prm::GSpan< GUM_SCALAR >::_subgraph_mining_(), gum::StaticTriangulation::_triangulate_(), gum::MixedGraph::boundary(), gum::MixedGraph::chainComponent(), gum::MixedGraph::hasMixedOrientedPath(), gum::PDAG::hasMixedReallyOrientedPath(), gum::UndiGraph::hasUndirectedCycle(), hasUndirectedPath(), hasUndirectedPath(), hasUndirectedPath(), gum::learning::SimpleMiic::learnPDAG(), gum::learning::SimpleMiic::learnStructure(), gum::MixedGraph::mixedOrientedPath(), gum::MixedGraph::mixedUnorientedPath(), gum::PDAG::moralGraph(), gum::UndiGraph::nodes2ConnectedComponent(), gum::UndiGraph::partialUndiGraph(), gum::learning::SimpleMiic::propagatesOrientationInChainOfRemainingEdges_(), gum::learning::SimpleMiic::propagatesRemainingOrientableEdges_(), gum::rec_ancestral(), gum::rec_hasMixedReallyOrientedPath(), gum::MixedGraph::toDot(), gum::PDAG::toDot(), gum::UndiGraph::toDot(), undirectedPath(), gum::learning::Miic::unshieldedTriples_(), gum::learning::SimpleMiic::unshieldedTriples_(), gum::learning::Miic::unshieldedTriplesMiic_(), and gum::learning::SimpleMiic::unshieldedTriplesMiic_().
|
inherited |
returns a new node id, not yet used by any node
Definition at line 232 of file nodeGraphPart_inl.h.
References _boundVal_, and _holes_.
|
inherited |
return *this as a NodeGraphPart
Definition at line 368 of file nodeGraphPart_inl.h.
References NodeGraphPart().
Referenced by gum::MeekRules::_complete_(), gum::prm::ClusteredLayerGenerator< GUM_SCALAR >::_generateClassDag_(), gum::prm::LayerGenerator< GUM_SCALAR >::_generateClassDag_(), gum::prm::ClassBayesNet< GUM_SCALAR >::_init_(), gum::prm::SVE< GUM_SCALAR >::_initElimOrder_(), gum::prm::SVED< GUM_SCALAR >::_initElimOrder_(), gum::prm::SVE< GUM_SCALAR >::_initLiftedNodes_(), gum::MeekRules::_orientDoubleHeadedArcs_(), gum::MeekRules::_propagates_(), gum::prm::GSpan< GUM_SCALAR >::_sortPatterns_(), gum::prm::PRMFactory< GUM_SCALAR >::addAttribute(), gum::UndiGraph::hasUndirectedCycle(), gum::DAG::moralGraph(), gum::PDAG::moralGraph(), gum::DAG::moralizedAncestralGraph(), gum::PDAG::moralizedAncestralGraph(), gum::prm::gspan::Pattern::nodes(), gum::UndiGraph::nodes2ConnectedComponent(), gum::learning::Miic::orientDoubleHeadedArcs_(), gum::UndiGraph::partialUndiGraph(), gum::learning::IBNLearner::prepareMiic_(), gum::MeekRules::propagateToDAG(), gum::DiGraph::toDot(), gum::MixedGraph::toDot(), gum::PDAG::toDot(), and gum::UndiGraph::toDot().
|
inherited |
returns a property {node:id of connected component}
Definition at line 184 of file undiGraph.cpp.
References gum::HashTable< Key, Val >::exists(), gum::HashTable< Key, Val >::insert(), gum::EdgeGraphPart::neighbours(), and gum::NodeGraphPart::nodes().
|
inherited |
a method to create a HashTable with key:NodeId and value:VAL
VAL are computed from the nodes using for all node x, VAL f(x). This method is a wrapper of the same method in HashTable.
| f | a function assigning a VAL to any node |
| size | an optional parameter enabling to fine-tune the returned Property. Roughly speaking, it is a good practice to have a size equal to half the number of nodes. If you do not specify this parameter, the method will assign it for you. |
References nodesPropertyFromFunction(), and size().
Referenced by nodesPropertyFromFunction().
|
inherited |
a method to create a hashMap with key:NodeId and value:VAL
for all nodes, the value stored is a. This method is a wrapper of the same method in HashTable.
| a | the default value assigned to each edge in the returned Property |
| size | an optional parameter enabling to fine-tune the returned Property. Roughly speaking, it is a good practice to have a size equal to half the number of nodes. If you do not specify this parameter, the method will assign it for you. |
References nodesPropertyFromVal(), and size().
Referenced by gum::BinaryJoinTreeConverterDefault::convert(), gum::UndiGraph::hasUndirectedCycle(), and nodesPropertyFromVal().
|
inherited |
check whether two NodeGraphParts contain different nodes
| p | the NodeGraphPart to be compared with "this" |
Definition at line 354 of file nodeGraphPart_inl.h.
References NodeGraphPart(), and operator==().
tests whether two UndiGraphs are different
| g | the UndiGraph with which "this" is compared |
Definition at line 90 of file undiGraph_inl.h.
References UndiGraph(), and operator==().
| CliqueGraph & gum::CliqueGraph::operator= | ( | const CliqueGraph & | from | ) |
| bool gum::CliqueGraph::operator== | ( | const CliqueGraph & | from | ) | const |
checks whether two clique graphs are equal
References CliqueGraph().
|
inherited |
tests whether two EdgeGraphParts contain the same edges
| p | the EdgeGraphPart that we compare with this |
Definition at line 125 of file edgeGraphPart_inl.h.
References EdgeGraphPart(), and _edges_.
Referenced by gum::MixedGraph::operator==(), and gum::UndiGraph::operator==().
|
inherited |
check whether two NodeGraphParts contain the same nodes
| p | the NodeGraphPart to be compared with "this" |
Definition at line 343 of file nodeGraphPart_inl.h.
References NodeGraphPart(), _boundVal_, and _holes_.
Referenced by operator!=(), gum::DiGraph::operator==(), gum::MixedGraph::operator==(), and gum::UndiGraph::operator==().
tests whether two UndiGraphs are identical (same nodes, same edges)
| g | the UndiGraph with which "this" is compared |
Definition at line 86 of file undiGraph_inl.h.
References UndiGraph(), gum::EdgeGraphPart::operator==(), and gum::NodeGraphPart::operator==().
Referenced by operator!=().
returns the partial graph formed by the nodes given in parameter
Definition at line 171 of file undiGraph.cpp.
References UndiGraph(), addEdge(), gum::NodeGraphPart::addNodeWithId(), gum::NodeGraphPart::existsNode(), gum::EdgeGraphPart::neighbours(), and gum::NodeGraphPart::nodes().
|
inherited |
populateNodes clears *this and fills it with the same nodes as "s"
populateNodes should basically be the preferred way to insert nodes with IDs not selected by the internal idFactory.
| s | the NodeGraphPart to be copied |
Definition at line 83 of file nodeGraphPart.cpp.
References NodeGraphPart(), _boundVal_, _holes_, _holes_resize_policy_, _holes_size_, _updateEndIteratorSafe_(), and clear().
Referenced by gum::DAG::moralGraph(), gum::PDAG::moralGraph(), and operator=().
|
inherited |
populateNodesFromProperty clears *this and fills it with the keys of "h"
populateNodes should basically be the preferred way to insert nodes with IDs not selected by the internal idFactory.
References NodeGraphPart(), begin(), end(), and toString().
returns the separator included in a given edge
| NotFound | exception is thrown if the edge does not belong to the clique graph |
Referenced by gum::BinaryJoinTreeConverterDefault::_convertClique_(), and gum::BarrenNodesFinder::barrenNodes().
|
virtual |
changes the set of nodes included into a given clique and returns the new set
| NotFound | exception is thrown if idClique is not a clique of the clique graph |
|
inherited |
alias for sizeNodes
Definition at line 288 of file nodeGraphPart_inl.h.
References sizeNodes().
Referenced by gum::StaticTriangulation::StaticTriangulation(), gum::prm::gspan::DFSTree< GUM_SCALAR >::_addChild_(), gum::StaticTriangulation::_triangulate_(), gum::learning::GreedyHillClimbing::learnStructure(), gum::learning::LocalSearchWithTabuList::learnStructure(), nodesPropertyFromFunction(), nodesPropertyFromVal(), gum::BayesBall::relevantTensors(), gum::dSeparationAlgorithm::relevantTensors(), gum::BayesBall::requisiteNodes(), gum::dSeparationAlgorithm::requisiteNodes(), gum::StaticTriangulation::setGraph(), gum::DAGmodel::size(), gum::prm::gspan::Pattern::size(), gum::UGmodel::size(), and gum::UndiGraph::toDot().
|
inherited |
indicates the number of edges stored within the EdgeGraphPart
Definition at line 57 of file edgeGraphPart_inl.h.
References _edges_.
|
inherited |
returns the number of nodes in the NodeGraphPart
Definition at line 284 of file nodeGraphPart_inl.h.
References _boundVal_, and _holes_.
Referenced by gum::BinaryJoinTreeConverterDefault::_markConnectedComponent_(), asNodeSet(), gum::BinaryJoinTreeConverterDefault::convert(), emptyNodes(), and size().
|
virtual |
friendly displays the content of the CliqueGraph in DOT format
Reimplemented from gum::UndiGraph.
|
virtual |
friendly displays the content of the CliqueGraph
Reimplemented from gum::NodeGraphPart.
|
inherited |
returns a possible path from node1 to node2 in the edge set
| node1 | the id from which the path begins |
| node2 | the id to which the path ends |
| NotFound | exception is raised if no path can be found between the two nodes |
Definition at line 145 of file edgeGraphPart.cpp.
References gum::List< Val >::empty(), gum::HashTable< Key, Val >::exists(), gum::List< Val >::front(), GUM_ERROR, gum::HashTable< Key, Val >::insert(), neighbours(), gum::List< Val >::popFront(), and gum::List< Val >::pushBack().
|
inherited |
same function as eraseNeighbours but without any virtual call to an erase
| id | the node whose ingoing arcs will be removed |
Definition at line 114 of file edgeGraphPart_inl.h.
References _neighbours_, gum::Set< Key >::beginSafe(), gum::Set< Key >::endSafe(), and eraseEdge().
Referenced by gum::MixedGraph::eraseNode(), and gum::UndiGraph::eraseNode().
|
private |
the set of nodes contained into the cliques
Definition at line 266 of file cliqueGraph.h.
|
privateinherited |
the set of all the edges contained within the EdgeGraphPart
Definition at line 266 of file edgeGraphPart.h.
Referenced by EdgeGraphPart(), EdgeGraphPart(), _clearEdges_(), addEdge(), edges(), emptyEdges(), eraseEdge(), existsEdge(), operator=(), operator==(), sizeEdges(), and toString().
|
privateinherited |
for each node, the set of its adjacent edges
Definition at line 269 of file edgeGraphPart.h.
Referenced by EdgeGraphPart(), _checkNeighbours_(), _clearEdges_(), addEdge(), eraseEdge(), eraseNeighbours(), existsEdge(), neighbours(), operator=(), and unvirtualizedEraseNeighbours().
|
private |
the set of nodes contained into the separators
Definition at line 269 of file cliqueGraph.h.
Definition at line 98 of file edgeGraphPart.h.
Referenced by EdgeGraphPart(), addEdge(), and operator=().
Definition at line 99 of file edgeGraphPart.h.
Referenced by _clearEdges_(), and eraseEdge().
|
inherited |
Definition at line 289 of file nodeGraphPart.h.
Referenced by addNode(), and addNodeWithId().
|
inherited |
Definition at line 290 of file nodeGraphPart.h.
Referenced by _clearNodes_(), and eraseNode().