![]() |
aGrUM 2.3.2
a C++ library for (probabilistic) graphical models
|
Base class for mixed graphs. More...
#include <mixedGraph.h>
Public Types | |
| using | EdgeIterator = EdgeSetIterator |
| using | ArcIterator = ArcSetIterator |
| 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 | |||
| bool | hasDirectedPath (NodeId from, NodeId to) | ||
| checks whether there exists a directed path from from to to | |||
Constructors / Destructors | |||
| MixedGraph (Size nodes_size=HashTableConst::default_size, bool nodes_resize_policy=true, Size arcs_size=HashTableConst::default_size, bool arcs_resize_policy=true, Size edges_size=HashTableConst::default_size, bool edges_resize_policy=true) | |||
| default constructor | |||
| MixedGraph (const UndiGraph &g) | |||
| default constructor | |||
| MixedGraph (const DiGraph &g) | |||
| default constructor | |||
| MixedGraph (const MixedGraph &g) | |||
| copy constructor | |||
| virtual | ~MixedGraph () | ||
| destructor | |||
Operators | |||
| MixedGraph & | operator= (const MixedGraph &g) | ||
| copy operator | |||
| bool | operator== (const MixedGraph &g) const | ||
| tests whether two MixedGraphs are identical (same nodes, arcs and edges) | |||
Accessors/Modifiers | |||
| void | eraseNode (const NodeId node) override | ||
| remove a node as well as its adjacent arcs and edges from the graph | |||
| void | clear () override | ||
| removes all the nodes, arcs and edges from the graph | |||
| std::vector< NodeId > | mixedOrientedPath (NodeId node1, NodeId node2) const | ||
| returns a mixed edge/directed arc path from node1 to node2 in the arc/edge set | |||
| bool | hasMixedOrientedPath (NodeId node1, NodeId node2) const | ||
| returns true if a mixed edge/directed arc path from node1 to node2 in the arc/edge set exists. | |||
| std::vector< NodeId > | mixedUnorientedPath (NodeId node1, NodeId node2) const | ||
| returns a mixed/directed path from node1 to node2 in the arc/edge set | |||
| std::string | toDot () const override | ||
| to friendly display mixed graph in DOT format | |||
| std::string | toString () const override | ||
| to friendly display the content of the MixedGraph | |||
| NodeSet | boundary (NodeId node) const | ||
| returns the set of node adjacent to a given node | |||
| NodeSet | chainComponent (NodeId node) const | ||
| returns the set of nodes reachable by undirected path | |||
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 | |||
| void | addEdge (NodeId first, NodeId second) override | ||
| insert a new edge into the undirected graph | |||
| 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 | |||
| virtual void | eraseEdge (const Edge &edge) | ||
| removes an edge from the EdgeGraphPart | |||
| 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 | |||
| virtual void | clearEdges () | ||
| removes all the edges from the EdgeGraphPart | |||
| 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 DiGraph &g) const | ||
| tests whether two DiGraphs are identical (same nodes, same arcs) | |||
Operators | |||
| bool | operator== (const ArcGraphPart &p) const | ||
| tests whether two ArcGraphParts contain the same arcs | |||
Accessors/Modifiers | |||
tests whether two DiGraphs are different
| |||
| virtual void | addArc (const NodeId tail, const NodeId head) | ||
| insert a new arc into the directed graph | |||
| Sequence< NodeId > | topologicalOrder () const | ||
| Build and return a topological order. | |||
Accessors/Modifiers | |||
| virtual void | eraseArc (const Arc &arc) | ||
| removes an arc from the ArcGraphPart | |||
| bool | existsArc (const Arc &arc) const | ||
| indicates whether a given arc exists | |||
| bool | existsArc (NodeId tail, NodeId head) const | ||
| indicates whether a given arc exists | |||
| bool | emptyArcs () const | ||
| indicates wether the ArcGraphPart contains any arc | |||
| void | clearArcs () | ||
| removes all the arcs from the ArcGraphPart | |||
| Size | sizeArcs () const | ||
| indicates the number of arcs stored within the ArcGraphPart | |||
| const ArcSet & | arcs () const | ||
| returns the set of arcs stored within the ArcGraphPart | |||
| const NodeSet & | parents (NodeId id) const | ||
| returns the set of nodes with arc ingoing to a given node | |||
| NodeSet | parents (const NodeSet &ids) const | ||
| returns the set of parents of a set of nodes | |||
| NodeSet | family (NodeId id) const | ||
| returns the set of nodes which consists in the node and its parents | |||
| NodeSet | family (const NodeSet &ids) const | ||
| returns the set of family nodes of a set of nodes | |||
| NodeSet | descendants (NodeId id) const | ||
| returns the set of nodes with directed path outgoing from a given node | |||
| NodeSet | ancestors (NodeId id) const | ||
| returns the set of nodes with directed path ingoing to a given node | |||
| NodeSet | children (const NodeSet &ids) const | ||
| returns the set of children of a set of nodes | |||
| const NodeSet & | children (NodeId id) const | ||
| returns the set of nodes with arc outgoing from a given node | |||
| void | eraseParents (NodeId id) | ||
| erase all the parents of a given node | |||
| void | unvirtualizedEraseParents (NodeId id) | ||
| same function as eraseParents but without any virtual call to an erase | |||
| void | eraseChildren (NodeId id) | ||
| removes all the children of a given node | |||
| void | unvirtualizedEraseChildren (NodeId id) | ||
| same function as eraseChildren but without any virtual call to an erase | |||
| template<typename VAL> | |||
| ArcProperty< VAL > | arcsProperty (VAL(*f)(const Arc &), Size size=0) const | ||
| a method to create a hashMap of VAL from a set of arcs (using for every arc, say x, the VAL f(x)) | |||
| template<typename VAL> | |||
| ArcProperty< VAL > | arcsProperty (const VAL &a, Size size=0) const | ||
| a method to create a hashMap of VAL from a set of arcs (using for every arc, say x, the VAL a) | |||
| template<typename VAL> | |||
| List< VAL > | listMapArcs (VAL(*f)(const Arc &)) const | ||
| a method to create a list of VAL from a set of arcs (using for every arc, say x, the VAL f(x)) | |||
| std::vector< NodeId > | directedPath (NodeId node1, NodeId node2) const | ||
| returns a directed path from node1 to node2 belonging to the set of arcs | |||
| std::vector< NodeId > | directedUnorientedPath (NodeId node1, NodeId node2) const | ||
| returns an unoriented (directed) path from node1 to node2 in the arc set | |||
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 | |||
| virtual NodeId | addNode () | ||
| insert a new node and return its id | |||
| std::vector< NodeId > | addNodes (Size n) | ||
| insert n nodes | |||
| virtual void | addNodeWithId (const NodeId id) | ||
| try to insert a node with the given id | |||
| 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 | |
Constructors / Destructors | |
| static DiGraph | completeGraph (int n) |
| Build a complete DiGraph with n nodes. | |
Public Attributes | |
| Signaler2< NodeId, NodeId > | onEdgeAdded |
| Signaler2< NodeId, NodeId > | onEdgeDeleted |
| Signaler2< NodeId, NodeId > | onArcAdded |
| Signaler2< NodeId, NodeId > | onArcDeleted |
| Signaler1< NodeId > | onNodeAdded |
| Signaler1< NodeId > | onNodeDeleted |
Protected Member Functions | |
| void | eraseSetOfArcs_ (const ArcSet &set) |
| a (virtualized) function to remove a given set of arcs | |
| void | unvirtualizedEraseSetOfArcs_ (const ArcSet &set) |
| similar to eraseSetOfArcs_ except that it is unvirtualized | |
Private Member Functions | |
| 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_ () |
| void | _checkParents_ (NodeId id) |
| when the ArcGraphPart contains no arc ingoing into a given node, this function adds an empty set entry to parents[id] | |
| void | _checkChildren_ (NodeId id) |
| when the ArcGraphPart contains no arc outgoing from a given node, this function adds an empty set entry to children[id] | |
Private Attributes | |
| EdgeSet | _edges_ |
| the set of all the edges contained within the EdgeGraphPart | |
| NodeProperty< NodeSet * > | _neighbours_ |
| for each node, the set of its adjacent edges | |
| Set< Arc > | _arcs_ |
| the set of all the arcs contained within the ArcGraphPart | |
| NodeProperty< NodeSet * > | _parents_ |
| for each arc, the sets of its parents | |
| NodeProperty< NodeSet * > | _children_ |
| for each arc, the set of its children | |
Base class for mixed graphs.
Definition at line 146 of file mixedGraph.h.
|
inherited |
Definition at line 100 of file arcGraphPart.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 |
default constructor
| nodes_size | the size of the hash table used to store all the nodes |
| nodes_resize_policy | the resizing policy of this hash table |
| arcs_size | the size of the hash table used to store all the arcs |
| arcs_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 |
Definition at line 56 of file mixedGraph.cpp.
References gum::DiGraph::DiGraph(), MixedGraph(), and gum::UndiGraph::UndiGraph().
Referenced by MixedGraph(), MixedGraph(), MixedGraph(), MixedGraph(), gum::PDAG::PDAG(), gum::PDAG::PDAG(), gum::PDAG::PDAG(), gum::PDAG::PDAG(), gum::PDAG::PDAG(), ~MixedGraph(), operator=(), and operator==().
|
explicit |
default constructor
| nodes_size | the size of the hash table used to store all the nodes |
| nodes_resize_policy | the resizing policy of this hash table |
| arcs_size | the size of the hash table used to store all the arcs |
| arcs_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 |
Definition at line 70 of file mixedGraph.cpp.
References gum::DiGraph::DiGraph(), MixedGraph(), and gum::UndiGraph::UndiGraph().
|
explicit |
default constructor
| nodes_size | the size of the hash table used to store all the nodes |
| nodes_resize_policy | the resizing policy of this hash table |
| arcs_size | the size of the hash table used to store all the arcs |
| arcs_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 |
Definition at line 74 of file mixedGraph.cpp.
References gum::DiGraph::DiGraph(), MixedGraph(), and gum::UndiGraph::UndiGraph().
| gum::MixedGraph::MixedGraph | ( | const MixedGraph & | g | ) |
copy constructor
| g | the MixedGraph to copy |
Definition at line 78 of file mixedGraph.cpp.
References gum::DiGraph::DiGraph(), MixedGraph(), and gum::UndiGraph::UndiGraph().
|
virtual |
destructor
Definition at line 83 of file mixedGraph.cpp.
References MixedGraph().
|
privateinherited |
when the ArcGraphPart contains no arc outgoing from a given node, this function adds an empty set entry to children[id]
| id | the node whose children[id] is checked |
Definition at line 71 of file arcGraphPart_inl.h.
References _children_.
Referenced by addArc().
|
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 |
when the ArcGraphPart contains no arc ingoing into a given node, this function adds an empty set entry to parents[id]
| id | the node whose parents[id] is checked |
Definition at line 67 of file arcGraphPart_inl.h.
References _parents_.
Referenced by addArc().
|
privateinherited |
Definition at line 88 of file edgeGraphPart.cpp.
References _edges_, _neighbours_, GUM_EMIT2, and onEdgeDeleted.
Referenced by ~EdgeGraphPart(), and clearEdges().
insert a new arc into the directed graph
| tail | the id of the tail of the new inserted arc |
| head | the id of the head of the new inserted arc |
| InvalidNode | if head or tail does not belong to the graph nodes |
Reimplemented from gum::ArcGraphPart.
Reimplemented in gum::DAG, gum::PDAG, and gum::prm::gspan::Pattern.
Definition at line 55 of file diGraph_inl.h.
References gum::ArcGraphPart::addArc(), gum::NodeGraphPart::exists(), and GUM_ERROR.
Referenced by gum::MeekRules::_applyMeekRules_(), gum::EssentialGraph::_buildEssentialGraph_(), gum::learning::Miic::_orientingVstructureMiic_(), gum::learning::SimpleMiic::_orientingVstructureMiic_(), gum::MeekRules::_propagatesOrientationInChainOfRemainingEdges_(), gum::learning::Miic::_propagatingOrientationMiic_(), gum::learning::SimpleMiic::_propagatingOrientationMiic_(), gum::DAG::addArc(), gum::PDAG::addArc(), gum::prm::gspan::Pattern::addArc(), completeGraph(), gum::learning::SimpleMiic::learnPDAG(), gum::learning::SimpleMiic::learnStructure(), gum::learning::SimpleMiic::orientationLatents_(), gum::learning::Miic::orientationMiic_(), gum::learning::SimpleMiic::orientationMiic_(), gum::learning::IBNLearner::prepareMiic_(), gum::learning::SimpleMiic::propagatesOrientationInChainOfRemainingEdges_(), and gum::learning::SimpleMiic::propagatesRemainingOrientableEdges_().
insert a new edge into the undirected graph
The order in which the extremal nodes are specified is not important.
| first | the id of one extremal node of the new inserted edge |
| second | the id of the other extremal node of the new inserted edge |
| InvalidNode | if first and/or second do not belong to the graph nodes |
Reimplemented from gum::EdgeGraphPart.
Definition at line 55 of file undiGraph_inl.h.
References gum::EdgeGraphPart::addEdge(), gum::NodeGraphPart::exists(), and GUM_ERROR.
Referenced by gum::prm::StructuredInference< GUM_SCALAR >::_addEdgesInReducedGraph_(), gum::EssentialGraph::_buildEssentialGraph_(), gum::prm::gspan::StrictSearch< GUM_SCALAR >::_buildPatternGraph_(), gum::prm::StructuredInference< GUM_SCALAR >::_buildPatternGraph_(), gum::prm::GSpan< GUM_SCALAR >::_sortPatterns_(), gum::StaticTriangulation::_triangulate_(), completeGraph(), gum::DAG::moralGraph(), gum::PDAG::moralGraph(), gum::InfluenceDiagram< GUM_SCALAR >::moralGraph_(), gum::DAG::moralizedAncestralGraph(), partialUndiGraph(), gum::learning::IBNLearner::prepareMiic_(), and gum::EssentialGraph::skeleton().
|
virtualinherited |
insert a new node and return its id
Reimplemented in gum::CliqueGraph.
Definition at line 258 of file nodeGraphPart_inl.h.
References _boundVal_, _eraseHole_(), _holes_, _updateEndIteratorSafe_(), GUM_EMIT1, and onNodeAdded.
Referenced by gum::prm::gspan::DFSTree< GUM_SCALAR >::_addChild_(), gum::prm::StructuredInference< GUM_SCALAR >::_addEdgesInReducedGraph_(), gum::prm::gspan::StrictSearch< GUM_SCALAR >::_buildPatternGraph_(), gum::prm::StructuredInference< GUM_SCALAR >::_buildPatternGraph_(), gum::prm::ClusteredLayerGenerator< GUM_SCALAR >::_generateClassDag_(), gum::prm::LayerGenerator< GUM_SCALAR >::_generateClassDag_(), and gum::prm::gspan::DFSTree< GUM_SCALAR >::addRoot().
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().
|
virtualinherited |
try to insert a node with the given id
| DuplicateElement | exception if the id already exists |
Reimplemented in gum::CliqueGraph.
Definition at line 151 of file nodeGraphPart.cpp.
References _boundVal_, _eraseHole_(), _holes_, _holes_resize_policy_, _holes_size_, _inHoles_(), _updateEndIteratorSafe_(), GUM_EMIT1, GUM_ERROR, and onNodeAdded.
Referenced by gum::learning::StructuralConstraintDAG::StructuralConstraintDAG(), gum::EssentialGraph::_buildEssentialGraph_(), gum::prm::GSpan< GUM_SCALAR >::_sortPatterns_(), gum::prm::gspan::Pattern::addNodeWithLabel(), gum::learning::IBNLearner::learnDag_(), gum::learning::SimpleMiic::learnStructure(), gum::InfluenceDiagram< GUM_SCALAR >::moralGraph_(), gum::DAG::moralizedAncestralGraph(), gum::PDAG::moralizedAncestralGraph(), gum::UndiGraph::partialUndiGraph(), gum::learning::IBNLearner::prepareMiic_(), gum::MeekRules::propagateToCPDAG(), gum::MeekRules::propagateToDAG(), gum::rec_ancestral(), and gum::EssentialGraph::skeleton().
returns the set of nodes with directed path ingoing to a given node
Note that the set of nodes returned may be empty if no path within the ArcGraphPart is ingoing to the given node.
| id | the node which is the head of a directed path with the returned nodes |
Definition at line 191 of file arcGraphPart.cpp.
References gum::Set< Key >::begin(), gum::Set< Key >::contains(), gum::Set< Key >::empty(), gum::Set< Key >::erase(), gum::Set< Key >::insert(), and parents().
Referenced by gum::DAGmodel::ancestors().
|
inherited |
returns the set of arcs stored within the ArcGraphPart
Definition at line 59 of file arcGraphPart_inl.h.
References _arcs_.
Referenced by gum::EssentialGraph::_buildEssentialGraph_(), gum::prm::ClassBayesNet< GUM_SCALAR >::_init_(), gum::prm::gspan::Pattern::arcs(), gum::learning::SimpleMiic::learnStructure(), gum::DAG::moralGraph(), gum::PDAG::moralGraph(), gum::MeekRules::propagateToCPDAG(), gum::MeekRules::propagateToDAG(), and gum::DiGraph::toDot().
|
inherited |
a method to create a hashMap of VAL from a set of arcs (using for every arc, say x, the VAL a)
| a | the default value assigned to each arc 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 arcs. 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 arcs (using for every arc, say x, the VAL f(x))
| f | a function assigning a VAL to any arc |
| 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 arcs. If you do not specify this parameter, the method will assign it for you. |
|
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_().
returns the set of node adjacent to a given node
Note that the set of node returned may be empty.
| id | the node to which the edges are adjacent |
Definition at line 86 of file mixedGraph_inl.h.
References gum::ArcGraphPart::children(), gum::EdgeGraphPart::neighbours(), and gum::ArcGraphPart::parents().
Referenced by gum::MeekRules::_isOrientable_(), and gum::learning::SimpleMiic::isOrientable_().
returns the set of nodes reachable by undirected path
Note that the set of node returned may be empty.
| id | the node to which the edges are adjacent |
Definition at line 260 of file mixedGraph.cpp.
References gum::Set< Key >::begin(), gum::Set< Key >::empty(), gum::Set< Key >::erase(), gum::Set< Key >::exists(), gum::Set< Key >::insert(), and gum::EdgeGraphPart::neighbours().
Referenced by gum::PDAG::toDot().
returns the set of children of a set of nodes
Definition at line 86 of file arcGraphPart_inl.h.
References children().
Referenced by ArcGraphPart(), gum::prm::ClassDependencyGraph< GUM_SCALAR >::_addArcs_(), gum::EssentialGraph::_buildEssentialGraph_(), gum::prm::gspan::Pattern::_expandCodeIsMinimal_(), gum::prm::SVE< GUM_SCALAR >::_initElimOrder_(), gum::prm::SVED< GUM_SCALAR >::_initElimOrder_(), gum::DAG::_minimalCondSetVisitDn_(), gum::DAG::_minimalCondSetVisitUp_(), gum::prm::gspan::Pattern::_not_rec_(), gum::MeekRules::_propagatesOrientationInChainOfRemainingEdges_(), gum::prm::gspan::Pattern::_rec_(), gum::BarrenNodesFinder::barrenNodes(), gum::MixedGraph::boundary(), children(), descendants(), directedUnorientedPath(), eraseChildren(), gum::DiGraph::hasDirectedPath(), gum::PDAG::hasMixedReallyOrientedPath(), gum::credal::CNLoopyPropagation< GUM_SCALAR >::initialize_(), gum::prm::PRMClassElementContainer< double >::isInputNode(), gum::prm::gspan::Pattern::isMinimal(), gum::credal::CNLoopyPropagation< GUM_SCALAR >::makeInferenceNodeToNeighbours_(), gum::DAG::minimalCondSet(), gum::MixedGraph::mixedUnorientedPath(), gum::learning::SimpleMiic::propagatesOrientationInChainOfRemainingEdges_(), gum::rec_hasMixedReallyOrientedPath(), gum::BayesBall::relevantTensors(), gum::dSeparationAlgorithm::relevantTensors(), gum::prm::gspan::Pattern::remove(), gum::BayesBall::requisiteNodes(), gum::dSeparationAlgorithm::requisiteNodes(), gum::DAGCycleDetector::setDAG(), gum::MixedGraph::toDot(), gum::PDAG::toDot(), and unvirtualizedEraseChildren().
returns the set of nodes with arc outgoing from a given node
Note that the set of arcs returned may be empty if no arc within the ArcGraphPart is outgoing from the given node.
| id | the node which is the tail of the arcs returned |
Definition at line 109 of file arcGraphPart_inl.h.
References _children_, and gum::emptyNodeSet.
|
overridevirtual |
removes all the nodes, arcs and edges from the graph
Reimplemented from gum::NodeGraphPart.
Definition at line 68 of file mixedGraph_inl.h.
References gum::ArcGraphPart::clearArcs(), gum::EdgeGraphPart::clearEdges(), and gum::NodeGraphPart::clearNodes().
|
inherited |
removes all the arcs from the ArcGraphPart
Definition at line 98 of file arcGraphPart.cpp.
References _arcs_, _children_, _parents_, GUM_EMIT2, and onArcDeleted.
Referenced by ~ArcGraphPart(), gum::DiGraph::clear(), gum::MixedGraph::clear(), operator=(), and gum::MixedGraph::operator=().
|
virtualinherited |
removes all the edges from the EdgeGraphPart
Reimplemented in gum::CliqueGraph.
Definition at line 86 of file edgeGraphPart.cpp.
References _clearEdges_().
Referenced by gum::MixedGraph::clear(), gum::UndiGraph::clear(), operator=(), and gum::MixedGraph::operator=().
|
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=().
|
staticinherited |
Build a complete DiGraph with n nodes.
| int | n |
Definition at line 57 of file diGraph.cpp.
References DiGraph(), addArc(), and gum::NodeGraphPart::addNodes().
|
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 set of nodes with directed path outgoing from a given node
Note that the set of nodes returned may be empty if no path within the ArcGraphPart is outgoing from the given node.
| id | the node which is the tail of a directed path with the returned nodes |
Definition at line 174 of file arcGraphPart.cpp.
References gum::Set< Key >::begin(), children(), gum::Set< Key >::contains(), gum::Set< Key >::empty(), gum::Set< Key >::erase(), and gum::Set< Key >::insert().
Referenced by gum::DAGmodel::descendants().
|
inherited |
returns a directed path from node1 to node2 belonging to the set of arcs
| 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 208 of file arcGraphPart.cpp.
References gum::List< Val >::empty(), gum::HashTable< Key, Val >::exists(), gum::List< Val >::front(), GUM_ERROR, gum::HashTable< Key, Val >::insert(), parents(), gum::List< Val >::popFront(), and gum::List< Val >::pushBack().
Referenced by gum::learning::SimpleMiic::orientationLatents_().
|
inherited |
returns an unoriented (directed) path from node1 to node2 in the arc 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 249 of file arcGraphPart.cpp.
References children(), gum::List< Val >::empty(), gum::HashTable< Key, Val >::exists(), gum::List< Val >::front(), GUM_ERROR, gum::HashTable< Key, Val >::insert(), parents(), gum::List< Val >::popFront(), and gum::List< Val >::pushBack().
|
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 ArcGraphPart contains any arc
Definition at line 55 of file arcGraphPart_inl.h.
References _arcs_.
|
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.
|
virtualinherited |
removes an arc from the ArcGraphPart
| arc | the arc to be removed |
Definition at line 126 of file arcGraphPart_inl.h.
References _arcs_, _children_, _parents_, existsArc(), GUM_EMIT2, gum::Arc::head(), onArcDeleted, and gum::Arc::tail().
Referenced by gum::EssentialGraph::_buildEssentialGraph_(), gum::prm::ClusteredLayerGenerator< GUM_SCALAR >::_generateClassDag_(), gum::prm::LayerGenerator< GUM_SCALAR >::_generateClassDag_(), gum::MeekRules::_orientDoubleHeadedArcs_(), gum::BarrenNodesFinder::barrenNodes(), eraseChildren(), eraseParents(), eraseSetOfArcs_(), gum::learning::IBNLearner::learnDag_(), gum::learning::GreedyHillClimbing::learnStructure(), gum::learning::LocalSearchWithTabuList::learnStructure(), gum::learning::SimpleMiic::learnStructure(), gum::learning::SimpleMiic::orientationLatents_(), gum::learning::Miic::orientationMiic_(), gum::learning::SimpleMiic::orientationMiic_(), gum::learning::Miic::orientDoubleHeadedArcs_(), gum::prm::gspan::Pattern::pop_back(), unvirtualizedEraseChildren(), unvirtualizedEraseParents(), and unvirtualizedEraseSetOfArcs_().
|
inherited |
removes all the children of a given node
| id | the node all the children of which will be removed |
Definition at line 158 of file arcGraphPart_inl.h.
References _children_, children(), and eraseArc().
|
virtualinherited |
removes an edge from the EdgeGraphPart
| edge | the edge to be removed |
Reimplemented in gum::CliqueGraph.
Definition at line 82 of file edgeGraphPart_inl.h.
References _edges_, _neighbours_, existsEdge(), gum::Edge::first(), GUM_EMIT2, onEdgeDeleted, and gum::Edge::second().
Referenced by gum::MeekRules::_applyMeekRules_(), gum::learning::Miic::_orientingVstructureMiic_(), gum::learning::SimpleMiic::_orientingVstructureMiic_(), gum::MeekRules::_propagatesOrientationInChainOfRemainingEdges_(), gum::learning::Miic::_propagatingOrientationMiic_(), gum::learning::SimpleMiic::_propagatingOrientationMiic_(), gum::prm::GSpan< GUM_SCALAR >::discoverPatterns(), eraseNeighbours(), gum::learning::Miic::initiation_(), gum::learning::SimpleMiic::initiation_(), gum::learning::Miic::iteration_(), gum::learning::SimpleMiic::iteration_(), gum::learning::SimpleMiic::learnPDAG(), gum::learning::SimpleMiic::learnStructure(), gum::learning::SimpleMiic::orientationLatents_(), gum::learning::Miic::orientationMiic_(), gum::learning::SimpleMiic::orientationMiic_(), gum::learning::SimpleMiic::propagatesOrientationInChainOfRemainingEdges_(), gum::learning::SimpleMiic::propagatesRemainingOrientableEdges_(), and unvirtualizedEraseNeighbours().
|
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().
|
overridevirtual |
remove a node as well as its adjacent arcs and edges from the graph
| id | the id of the node to be removed |
Reimplemented from gum::NodeGraphPart.
Definition at line 74 of file mixedGraph_inl.h.
References gum::NodeGraphPart::eraseNode(), gum::ArcGraphPart::unvirtualizedEraseChildren(), gum::EdgeGraphPart::unvirtualizedEraseNeighbours(), and gum::ArcGraphPart::unvirtualizedEraseParents().
|
inherited |
erase all the parents of a given node
| id | the node all the parents of which will be removed |
Definition at line 144 of file arcGraphPart_inl.h.
References _parents_, eraseArc(), and parents().
|
protectedinherited |
a (virtualized) function to remove a given set of arcs
Definition at line 139 of file arcGraphPart_inl.h.
References eraseArc().
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 arc exists
| arc | the arc we test whether or not it belongs to the ArcGraphPart |
Definition at line 61 of file arcGraphPart_inl.h.
References _arcs_.
Referenced by gum::learning::Miic::_existsDirectedPath_(), gum::learning::SimpleMiic::_existsDirectedPath_(), gum::MeekRules::_existsDirectedPath_(), gum::learning::Miic::_existsNonTrivialDirectedPath_(), gum::learning::SimpleMiic::_existsNonTrivialDirectedPath_(), gum::prm::ClusteredLayerGenerator< GUM_SCALAR >::_generateClassDag_(), gum::prm::LayerGenerator< GUM_SCALAR >::_generateClassDag_(), gum::prm::gspan::Pattern::_not_rec_(), gum::learning::Miic::_orientingVstructureMiic_(), gum::learning::SimpleMiic::_orientingVstructureMiic_(), gum::MeekRules::_propagatesOrientationInChainOfRemainingEdges_(), gum::prm::gspan::Pattern::_rec_(), gum::EssentialGraph::_strongly_protected_(), eraseArc(), gum::prm::gspan::Pattern::exists(), gum::learning::SimpleMiic::orientationLatents_(), gum::learning::Miic::updateProbaTriples_(), and gum::learning::SimpleMiic::updateProbaTriples_().
indicates whether a given arc exists
| tail | the tail of the arc we test the existence in the ArcGraphPart |
| head | the head of the arc we test the existence in the ArcGraphPart |
Definition at line 63 of file arcGraphPart_inl.h.
References _parents_.
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().
returns the set of family nodes of a set of nodes
Definition at line 102 of file arcGraphPart_inl.h.
References family().
returns the set of nodes which consists in the node and its parents
Note that the set of nodes returned may be empty if no path within the ArcGraphPart is outgoing from the given node.
| id | the node which is the tail of a directed path with the returned nodes |
Definition at line 80 of file arcGraphPart_inl.h.
References parents().
Referenced by family().
checks whether there exists a directed path from from to to
If from==to, this function checks if a directed cycle containing from exists.
| from | |
| to |
Definition at line 151 of file diGraph.cpp.
References gum::ArcGraphPart::children(), gum::Set< Key >::contains(), gum::List< Val >::empty(), gum::NodeGraphPart::exists(), gum::List< Val >::front(), gum::Set< Key >::insert(), gum::List< Val >::popFront(), and gum::List< Val >::pushBack().
Referenced by gum::DAG::addArc(), and gum::PDAG::addArc().
returns true if a mixed edge/directed arc path from node1 to node2 in the arc/edge set exists.
| node1 | the id from which the path begins |
| node2 | the id to which the path ends |
Definition at line 149 of file mixedGraph.cpp.
References gum::List< Val >::empty(), gum::HashTable< Key, Val >::exists(), gum::List< Val >::front(), gum::HashTable< Key, Val >::insert(), gum::EdgeGraphPart::neighbours(), gum::ArcGraphPart::parents(), gum::List< Val >::popFront(), and gum::List< Val >::pushBack().
|
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().
|
inherited |
a method to create a list of VAL from a set of arcs (using for every arc, say x, the VAL f(x))
| f | a function assigning a VAL to any arc |
|
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().
returns a mixed edge/directed arc path from node1 to node2 in the arc/edge set
This function returns, if any, a path from node1 to node2, using edges and/or arcs (wrt the direction of th arcs)
| node1 | the id from which the path begins |
| node2 | the id to which the path ends if no path can be found between the two nodes, the returned vector is empty |
Definition at line 96 of file mixedGraph.cpp.
References gum::List< Val >::empty(), gum::HashTable< Key, Val >::exists(), gum::List< Val >::front(), gum::HashTable< Key, Val >::insert(), gum::EdgeGraphPart::neighbours(), gum::ArcGraphPart::parents(), gum::List< Val >::popFront(), and gum::List< Val >::pushBack().
Referenced by gum::MeekRules::_isOrientable_(), and gum::learning::SimpleMiic::isOrientable_().
returns a mixed/directed path from node1 to node2 in the arc/edge set
This function returns, if any, a path from node1 to node2, using edges and/or arcs (not necessarily following the direction of th arcs)
| node1 | the id from which the path begins |
| node2 | the id to which the path ends if no path can be found between the two nodes, the returned vector is empty. |
Definition at line 191 of file mixedGraph.cpp.
References gum::ArcGraphPart::children(), gum::List< Val >::empty(), gum::HashTable< Key, Val >::exists(), gum::List< Val >::front(), gum::HashTable< Key, Val >::insert(), gum::EdgeGraphPart::neighbours(), gum::ArcGraphPart::parents(), gum::List< Val >::popFront(), and gum::List< Val >::pushBack().
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==().
| INLINE MixedGraph & gum::MixedGraph::operator= | ( | const MixedGraph & | g | ) |
copy operator
| g | the MixedGraph to copy |
Definition at line 51 of file mixedGraph_inl.h.
References MixedGraph(), gum::ArcGraphPart::clearArcs(), gum::EdgeGraphPart::clearEdges(), gum::NodeGraphPart::clearNodes(), gum::ArcGraphPart::operator=(), gum::EdgeGraphPart::operator=(), and gum::NodeGraphPart::operator=().
Referenced by gum::PDAG::operator=().
|
inherited |
tests whether two ArcGraphParts contain the same arcs
| p | the ArcGraphPart that we compare with this |
Definition at line 201 of file arcGraphPart_inl.h.
References ArcGraphPart(), and _arcs_.
Referenced by gum::DiGraph::operator==(), and gum::MixedGraph::operator==().
tests whether two DiGraphs are identical (same nodes, same arcs)
| g | the DiGraph with which "this" is compared |
Definition at line 89 of file diGraph_inl.h.
References DiGraph(), gum::ArcGraphPart::operator==(), and gum::NodeGraphPart::operator==().
|
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==().
| INLINE bool gum::MixedGraph::operator== | ( | const MixedGraph & | g | ) | const |
tests whether two MixedGraphs are identical (same nodes, arcs and edges)
| g | the MixedGraph with which "this" is compared |
Definition at line 81 of file mixedGraph_inl.h.
References MixedGraph(), gum::ArcGraphPart::operator==(), gum::EdgeGraphPart::operator==(), and gum::NodeGraphPart::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 set of parents of a set of nodes
Definition at line 94 of file arcGraphPart_inl.h.
References parents().
returns the set of nodes with arc ingoing to a given node
Note that the set of arcs returned may be empty if no arc within the ArcGraphPart is ingoing into the given node.
| id | the node toward which the arcs returned are pointing |
Definition at line 75 of file arcGraphPart_inl.h.
References _parents_, and gum::emptyNodeSet.
Referenced by gum::MeekRules::_complete_(), gum::MeekRules::_critereMinParents_(), gum::learning::Miic::_existsDirectedPath_(), gum::learning::SimpleMiic::_existsDirectedPath_(), gum::MeekRules::_existsDirectedPath_(), gum::learning::Miic::_existsNonTrivialDirectedPath_(), gum::learning::SimpleMiic::_existsNonTrivialDirectedPath_(), gum::prm::gspan::Pattern::_expandCodeIsMinimal_(), gum::prm::ClusteredLayerGenerator< GUM_SCALAR >::_generateClass_(), gum::prm::ClusteredLayerGenerator< GUM_SCALAR >::_generateClassDag_(), gum::prm::LayerGenerator< GUM_SCALAR >::_generateClassDag_(), gum::prm::LayerGenerator< GUM_SCALAR >::_generateClasses_(), gum::prm::ClusteredLayerGenerator< GUM_SCALAR >::_generateCluster_(), gum::prm::SVE< GUM_SCALAR >::_initElimOrder_(), gum::prm::SVED< GUM_SCALAR >::_initElimOrder_(), gum::prm::SVE< GUM_SCALAR >::_initLiftedNodes_(), gum::prm::SVED< GUM_SCALAR >::_initLiftedNodes_(), gum::MeekRules::_isOrientable_(), gum::DAG::_minimalCondSetVisitDn_(), gum::DAG::_minimalCondSetVisitUp_(), gum::prm::gspan::Pattern::_not_rec_(), gum::MeekRules::_orientDoubleHeadedArcs_(), gum::MeekRules::_propagates_(), gum::learning::Miic::_propagatingOrientationMiic_(), gum::learning::SimpleMiic::_propagatingOrientationMiic_(), gum::prm::gspan::Pattern::_rec_(), gum::EssentialGraph::_strongly_protected_(), ancestors(), gum::BarrenNodesFinder::barrenNodes(), gum::MixedGraph::boundary(), directedPath(), directedUnorientedPath(), eraseParents(), family(), gum::MixedGraph::hasMixedOrientedPath(), gum::credal::CNLoopyPropagation< GUM_SCALAR >::initialize_(), gum::prm::PRMClassElementContainer< double >::isInputNode(), gum::learning::Miic::isMaxIndegree_(), gum::prm::gspan::Pattern::isMinimal(), gum::learning::SimpleMiic::isOrientable_(), gum::learning::SimpleMiic::learnPDAG(), gum::learning::SimpleMiic::learnStructure(), gum::credal::CNLoopyPropagation< GUM_SCALAR >::makeInferenceNodeToNeighbours_(), gum::DAG::minimalCondSet(), gum::MixedGraph::mixedOrientedPath(), gum::MixedGraph::mixedUnorientedPath(), gum::DAG::moralGraph(), gum::PDAG::moralGraph(), gum::DAG::moralizedAncestralGraph(), gum::learning::Miic::orientDoubleHeadedArcs_(), gum::prm::gspan::DFSTree< GUM_SCALAR >::parent(), gum::prm::gspan::DFSTree< GUM_SCALAR >::parent(), parents(), gum::rec_ancestral(), gum::BayesBall::relevantTensors(), gum::dSeparationAlgorithm::relevantTensors(), gum::prm::gspan::Pattern::remove(), gum::BayesBall::requisiteNodes(), gum::dSeparationAlgorithm::requisiteNodes(), gum::prm::gspan::Pattern::rightmostPath(), gum::DAGCycleDetector::setDAG(), and unvirtualizedEraseParents().
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().
|
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 arcs stored within the ArcGraphPart
Definition at line 57 of file arcGraphPart_inl.h.
References _arcs_.
Referenced by gum::prm::gspan::Pattern::sizeArcs().
|
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().
|
overridevirtual |
to friendly display mixed graph in DOT format
Reimplemented from gum::UndiGraph.
Reimplemented in gum::PDAG.
Definition at line 276 of file mixedGraph.cpp.
References gum::ArcGraphPart::children(), gum::Set< Key >::exists(), gum::Set< Key >::insert(), gum::EdgeGraphPart::neighbours(), and gum::NodeGraphPart::nodes().
Build and return a topological order.
| InvalidDirectedCycle | Raised if this DiGraph contains cycles. |
Definition at line 111 of file diGraph.cpp.
References GUM_ERROR, and topologicalOrder().
Referenced by gum::IBayesNet< double >::arcs(), gum::learning::SimpleMiic::learnPDAG(), gum::learning::SimpleMiic::learnStructure(), and topologicalOrder().
|
overridevirtual |
to friendly display the content of the MixedGraph
Reimplemented from gum::NodeGraphPart.
Definition at line 87 of file mixedGraph.cpp.
References gum::ArcGraphPart::toString(), gum::EdgeGraphPart::toString(), and gum::NodeGraphPart::toString().
Referenced by gum::operator<<().
|
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 eraseChildren but without any virtual call to an erase
| id | the node whose outgoing arcs will be removed |
Definition at line 189 of file arcGraphPart_inl.h.
References _children_, children(), and eraseArc().
Referenced by gum::DiGraph::eraseNode(), and gum::MixedGraph::eraseNode().
|
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().
|
inherited |
same function as eraseParents but without any virtual call to an erase
| id | the node whose ingoing arcs will be removed |
Definition at line 177 of file arcGraphPart_inl.h.
References _parents_, eraseArc(), and parents().
Referenced by gum::DiGraph::eraseNode(), and gum::MixedGraph::eraseNode().
|
protectedinherited |
similar to eraseSetOfArcs_ except that it is unvirtualized
Definition at line 172 of file arcGraphPart_inl.h.
References eraseArc().
the set of all the arcs contained within the ArcGraphPart
Definition at line 316 of file arcGraphPart.h.
Referenced by ArcGraphPart(), ArcGraphPart(), addArc(), arcs(), clearArcs(), emptyArcs(), eraseArc(), existsArc(), operator=(), operator==(), sizeArcs(), and toString().
|
privateinherited |
for each arc, the set of its children
Definition at line 322 of file arcGraphPart.h.
Referenced by ArcGraphPart(), _checkChildren_(), addArc(), children(), clearArcs(), eraseArc(), eraseChildren(), operator=(), and unvirtualizedEraseChildren().
|
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().
|
privateinherited |
for each arc, the sets of its parents
Definition at line 319 of file arcGraphPart.h.
Referenced by ArcGraphPart(), _checkParents_(), addArc(), clearArcs(), eraseArc(), eraseParents(), existsArc(), operator=(), parents(), and unvirtualizedEraseParents().
Definition at line 102 of file arcGraphPart.h.
Referenced by ArcGraphPart(), addArc(), and operator=().
Definition at line 103 of file arcGraphPart.h.
Referenced by clearArcs(), and eraseArc().
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().