![]() |
aGrUM
0.16.0
|
Base class for undirected graphs. More...
#include <undiGraph.h>
Public Attributes | |
Signaler1< NodeId > | onNodeAdded |
Signaler1< NodeId > | onNodeDeleted |
Signaler2< NodeId, NodeId > | onEdgeAdded |
Signaler2< NodeId, NodeId > | onEdgeDeleted |
Public Member Functions | |
Constructors / Destructors | |
UndiGraph (Size nodes_size=HashTableConst::default_size, bool nodes_resize_policy=true, Size edges_size=HashTableConst::default_size, bool edges_resize_policy=true) | |
default constructor More... | |
UndiGraph (const UndiGraph &g) | |
copy constructor More... | |
virtual | ~UndiGraph () |
destructor More... | |
Operators | |
UndiGraph & | operator= (const UndiGraph &g) |
copy operator More... | |
bool | operator== (const UndiGraph &g) const |
tests whether two UndiGraphs are identical (same nodes, same edges) More... | |
bool | operator!= (const UndiGraph &g) const |
tests whether two UndiGraphs are different More... | |
Accessors/Modifiers | |
virtual void | addEdge (const NodeId first, const NodeId second) |
insert a new edge into the undirected graph More... | |
virtual void | eraseNode (const NodeId id) |
remove a node and its adjacent edges from the graph More... | |
virtual void | clear () |
removes all the nodes and edges from the graph More... | |
virtual const std::string | toString () const |
to friendly display the content of the graph More... | |
virtual const std::string | toDot () const |
to friendly display graph in DOT format More... | |
bool | hasUndirectedCycle () const |
checks whether the graph contains cycles More... | |
virtual UndiGraph | partialUndiGraph (NodeSet nodesSet) |
returns the partial graph formed by the nodes given in parameter More... | |
Operators | |
bool | operator== (const NodeGraphPart &p) const |
check whether two NodeGraphParts contain the same nodes More... | |
bool | operator!= (const NodeGraphPart &p) const |
check whether two NodeGraphParts contain different nodes More... | |
Accessors/Modifiers | |
void | populateNodes (const NodeGraphPart &s) |
populateNodes clears *this and fills it with the same nodes as "s" More... | |
template<typename T > | |
void | populateNodesFromProperty (const NodeProperty< T > &h) |
populateNodesFromProperty clears *this and fills it with the keys of "h" More... | |
NodeId | nextNodeId () const |
returns a new node id, not yet used by any node More... | |
virtual NodeId | addNode () |
insert a new node and return its id More... | |
std::vector< NodeId > | addNodes (Size n) |
insert n nodes More... | |
virtual void | addNodeWithId (const NodeId id) |
try to insert a node with the given id More... | |
bool | existsNode (const NodeId id) const |
returns true iff the NodeGraphPart contains the given nodeId More... | |
bool | exists (const NodeId id) const |
alias for existsNode More... | |
bool | emptyNodes () const |
indicates whether there exists nodes in the NodeGraphPart More... | |
bool | empty () const |
alias for emptyNodes More... | |
virtual void | clearNodes () |
remove all the nodes from the NodeGraphPart More... | |
Size | sizeNodes () const |
returns the number of nodes in the NodeGraphPart More... | |
Size | size () const |
alias for sizeNodes More... | |
NodeId | bound () const |
returns a number n such that all node ids are strictly lower than n More... | |
NodeSet | asNodeSet () const |
returns a copy of the set of nodes represented by the NodeGraphPart More... | |
const NodeGraphPart & | nodes () const |
return *this as a NodeGraphPart More... | |
node_iterator_safe | beginSafe () const |
a begin iterator to parse the set of nodes contained in the NodeGraphPart More... | |
const node_iterator_safe & | endSafe () const noexcept |
the end iterator to parse the set of nodes contained in the NodeGraphPart More... | |
node_iterator | begin () const noexcept |
a begin iterator to parse the set of nodes contained in the NodeGraphPart More... | |
const node_iterator & | end () const noexcept |
the end iterator to parse the set of nodes contained in the NodeGraphPart More... | |
template<typename VAL > | |
NodeProperty< VAL > | nodesProperty (VAL(*f)(const NodeId &), Size size=0) const |
a method to create a HashTable with key:NodeId and value:VAL More... | |
template<typename VAL > | |
NodeProperty< VAL > | nodesProperty (const VAL &a, Size size=0) const |
a method to create a hashMap with key:NodeId and value:VAL More... | |
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)) More... | |
Operators | |
bool | operator== (const EdgeGraphPart &p) const |
tests whether two EdgeGraphParts contain the same edges More... | |
bool | operator!= (const EdgeGraphPart &p) const |
tests whether two EdgeGraphParts contain different edges More... | |
Accessors/Modifiers | |
virtual void | eraseEdge (const Edge &edge) |
removes an edge from the EdgeGraphPart More... | |
bool | existsEdge (const Edge &edge) const |
indicates whether a given edge exists More... | |
bool | existsEdge (const NodeId n1, const NodeId n2) const |
indicates whether a given edge exists More... | |
bool | emptyEdges () const |
indicates wether the EdgeGraphPart contains any edge More... | |
virtual void | clearEdges () |
removes all the edges from the EdgeGraphPart More... | |
Size | sizeEdges () const |
indicates the number of edges stored within the EdgeGraphPart More... | |
const EdgeSet & | edges () const |
returns the set of edges stored within the EdgeGraphPart More... | |
const NodeSet & | neighbours (const NodeId id) const |
returns the set of edges adjacent to a given node More... | |
void | eraseNeighbours (const NodeId id) |
erase all the edges adjacent to a given node More... | |
void | unvirtualizedEraseNeighbours (const NodeId id) |
same function as eraseNeighbours but without any virtual call to an erase More... | |
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)) More... | |
template<typename VAL > | |
EdgeProperty< VAL > | edgesProperty (const VAL &a, 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) More... | |
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)) More... | |
const std::vector< NodeId > | undirectedPath (const NodeId node1, const NodeId node2) const |
returns a possible path from node1 to node2 in the edge set More... | |
Public Types | |
typedef NodeGraphPartIterator | NodeIterator |
typedef NodeGraphPartIterator | NodeConstIterator |
typedef NodeGraphPartIteratorSafe | NodeIteratorSafe |
typedef NodeGraphPartIteratorSafe | NodeConstIteratorSafe |
typedef EdgeSetIterator | EdgeIterator |
using | node_iterator = NodeGraphPartIterator |
types for STL compliance More... | |
using | node_const_iterator = NodeGraphPartIterator |
types for STL compliance More... | |
using | node_iterator_safe = NodeGraphPartIteratorSafe |
types for STL compliance More... | |
using | node_const_iterator_safe = NodeGraphPartIteratorSafe |
types for STL compliance More... | |
Base class for undirected graphs.
This is the base class for graphs containing undirected edges (so-called edges).
Definition at line 109 of file undiGraph.h.
|
inherited |
Definition at line 77 of file edgeGraphPart.h.
|
inherited |
types for STL compliance
Definition at line 261 of file nodeGraphPart.h.
|
inherited |
types for STL compliance
Definition at line 263 of file nodeGraphPart.h.
|
inherited |
types for STL compliance
Definition at line 260 of file nodeGraphPart.h.
|
inherited |
types for STL compliance
Definition at line 262 of file nodeGraphPart.h.
|
inherited |
Definition at line 270 of file nodeGraphPart.h.
|
inherited |
Definition at line 272 of file nodeGraphPart.h.
|
inherited |
Definition at line 269 of file nodeGraphPart.h.
|
inherited |
Definition at line 271 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 |
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 40 of file undiGraph.cpp.
gum::UndiGraph::UndiGraph | ( | const UndiGraph & | g | ) |
copy constructor
g | the UndiGraph to copy |
Definition at line 49 of file undiGraph.cpp.
|
virtual |
destructor
Definition at line 53 of file undiGraph.cpp.
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.
Reimplemented in gum::CliqueGraph.
Definition at line 35 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::SpanningForestPrim::__computeInAComponent(), gum::prm::gspan::DFSTree< GUM_SCALAR >::__initialiaze_root(), gum::DAGmodel::__moralGraph(), gum::learning::genericBNLearner::__prepare_miic_3off2(), gum::prm::GSpan< GUM_SCALAR >::__sortPatterns(), gum::StaticTriangulation::__triangulate(), gum::InfluenceDiagram< GUM_SCALAR >::_moralGraph(), gum::prm::StructuredInference< GUM_SCALAR >::CData::CData(), gum::prm::gspan::DFSTree< GUM_SCALAR >::growPattern(), gum::prm::gspan::EdgeGrowth< GUM_SCALAR >::insert(), gum::prm::gspan::InterfaceGraph< GUM_SCALAR >::InterfaceGraph(), gum::DAG::moralGraph(), partialUndiGraph(), gum::EssentialGraph::skeleton(), and gum::StaticTriangulation::triangulatedGraph().
|
virtualinherited |
insert a new node and return its id
Reimplemented in gum::CliqueGraph.
Definition at line 253 of file nodeGraphPart_inl.h.
References GUM_EMIT1.
Referenced by gum::prm::gspan::DFSTree< GUM_SCALAR >::__addChild(), gum::prm::StructuredInference< GUM_SCALAR >::__addEdgesInReducedGraph(), gum::prm::o3prm::O3InterfaceFactory< GUM_SCALAR >::__addInterface2Dag(), gum::prm::ClassDependencyGraph< GUM_SCALAR >::__addNode(), gum::prm::o3prm::O3TypeFactory< GUM_SCALAR >::__addTypes2Dag(), gum::prm::gspan::StrictSearch< GUM_SCALAR >::__buildPatternGraph(), gum::prm::StructuredInference< GUM_SCALAR >::__buildPatternGraph(), gum::prm::o3prm::O3ClassFactory< GUM_SCALAR >::__checkAndAddNodesToDag(), gum::prm::LayerGenerator< GUM_SCALAR >::__generateClassDag(), gum::prm::ClusteredLayerGenerator< GUM_SCALAR >::__generateClassDag(), gum::prm::gspan::DFSTree< GUM_SCALAR >::__initialiaze_root(), gum::IncrementalGraphLearner< AttributeSelection, isScalar >::_insertNode(), gum::prm::gspan::DFSTree< GUM_SCALAR >::addRoot(), gum::prm::gspan::DFSTree< GUM_SCALAR >::growPattern(), gum::IncrementalGraphLearner< AttributeSelection, isScalar >::IncrementalGraphLearner(), gum::prm::gspan::EdgeGrowth< GUM_SCALAR >::insert(), and gum::LeafAggregator::update().
insert n nodes
n | the number of nodes to add |
Definition at line 271 of file nodeGraphPart_inl.h.
|
virtualinherited |
try to insert a node with the given id
DuplicateElement | exception if the id already exists |
Definition at line 132 of file nodeGraphPart.cpp.
References gum::NodeGraphPart::__boundVal, gum::NodeGraphPart::__eraseHole(), gum::NodeGraphPart::__holes, gum::NodeGraphPart::__holes_resize_policy, gum::NodeGraphPart::__holes_size, gum::NodeGraphPart::__inHoles(), gum::NodeGraphPart::__updateEndIteratorSafe(), GUM_EMIT1, GUM_ERROR, gum::Set< Key, Alloc >::insert(), and gum::NodeGraphPart::onNodeAdded.
Referenced by gum::EssentialGraph::__buildEssentialGraph(), gum::MarkovBlanket::__buildMarkovBlanket(), gum::SpanningForestPrim::__computeInAComponent(), gum::learning::genericBNLearner::__learnDAG(), gum::learning::genericBNLearner::__prepare_miic_3off2(), gum::prm::GSpan< GUM_SCALAR >::__sortPatterns(), gum::InfluenceDiagram< GUM_SCALAR >::_addNode(), gum::InfluenceDiagram< GUM_SCALAR >::_moralGraph(), gum::prm::gspan::Pattern::addNodeWithLabel(), gum::prm::StructuredInference< GUM_SCALAR >::CData::CData(), gum::InfluenceDiagram< GUM_SCALAR >::getDecisionGraph(), gum::BayesNetFragment< GUM_SCALAR >::installNode(), gum::prm::gspan::InterfaceGraph< GUM_SCALAR >::InterfaceGraph(), gum::learning::Miic::learnStructure(), partialUndiGraph(), gum::EssentialGraph::skeleton(), and gum::learning::StructuralConstraintDAG::StructuralConstraintDAG().
|
inherited |
returns a copy of the set of nodes represented by the NodeGraphPart
Definition at line 361 of file nodeGraphPart_inl.h.
References gum::Set< Key, Alloc >::insert().
Referenced by gum::InfluenceDiagram< GUM_SCALAR >::getPartialTemporalOrder().
|
noexceptinherited |
a begin iterator to parse the set of nodes contained in the NodeGraphPart
Definition at line 333 of file nodeGraphPart_inl.h.
References gum::NodeGraphPartIterator::_validate().
Referenced by gum::prm::gspan::DFSTree< GUM_SCALAR >::parent().
|
inherited |
a begin iterator to parse the set of nodes contained in the NodeGraphPart
Definition at line 319 of file nodeGraphPart_inl.h.
References gum::NodeGraphPartIterator::_validate().
|
inherited |
returns a number n such that all node ids are strictly lower than n
Definition at line 308 of file nodeGraphPart_inl.h.
Referenced by gum::NodeGraphPart::__clearNodes(), gum::StaticTriangulation::__computeEliminationTree(), gum::NodeGraphPartIterator::_setPos(), and gum::NodeGraphPartIterator::_validate().
|
virtual |
removes all the nodes and edges from the graph
Reimplemented from gum::NodeGraphPart.
Reimplemented in gum::MixedGraph, and gum::CliqueGraph.
Definition at line 43 of file undiGraph_inl.h.
References gum::EdgeGraphPart::clearEdges(), and gum::NodeGraphPart::clearNodes().
Referenced by gum::StaticTriangulation::clear(), gum::DAGmodel::moralGraph(), and operator=().
|
virtualinherited |
removes all the edges from the EdgeGraphPart
Reimplemented in gum::CliqueGraph.
Definition at line 67 of file edgeGraphPart.cpp.
References gum::EdgeGraphPart::__edges, gum::EdgeGraphPart::__neighbours, gum::Set< Key, Alloc >::clear(), GUM_EMIT2, and gum::EdgeGraphPart::onEdgeDeleted.
Referenced by clear(), gum::MixedGraph::clear(), gum::EdgeGraphPart::operator=(), gum::MixedGraph::operator=(), and gum::EdgeGraphPart::~EdgeGraphPart().
|
virtualinherited |
remove all the nodes from the NodeGraphPart
Definition at line 310 of file nodeGraphPart_inl.h.
Referenced by gum::DiGraph::clear(), clear(), gum::MixedGraph::clear(), and gum::MixedGraph::operator=().
|
inherited |
returns the set of edges stored within the EdgeGraphPart
Definition at line 39 of file edgeGraphPart_inl.h.
References gum::EdgeGraphPart::__edges.
Referenced by gum::StaticTriangulation::__computeMaxPrimeJunctionTree(), gum::learning::Miic::_initiation(), gum::BarrenNodesFinder::barrenNodes(), gum::EssentialGraph::edges(), gum::SpanningForestPrim::edgesInSpanningForest(), and gum::learning::genericBNLearner::setPossibleSkeleton().
|
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. |
Referenced by gum::DefaultJunctionTreeStrategy::__computeJunctionTree().
|
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 |
alias for emptyNodes
Definition at line 306 of file nodeGraphPart_inl.h.
Referenced by gum::prm::gspan::Pattern::remove().
|
inherited |
indicates wether the EdgeGraphPart contains any edge
Definition at line 35 of file edgeGraphPart_inl.h.
References gum::EdgeGraphPart::__edges, and gum::Set< Key, Alloc >::empty().
|
inherited |
indicates whether there exists nodes in the NodeGraphPart
Definition at line 304 of file nodeGraphPart_inl.h.
|
noexceptinherited |
the end iterator to parse the set of nodes contained in the NodeGraphPart
Definition at line 339 of file nodeGraphPart_inl.h.
|
noexceptinherited |
the end iterator to parse the set of nodes contained in the NodeGraphPart
Definition at line 329 of file nodeGraphPart_inl.h.
|
virtualinherited |
removes an edge from the EdgeGraphPart
edge | the edge to be removed |
Reimplemented in gum::CliqueGraph.
Definition at line 65 of file edgeGraphPart_inl.h.
References gum::EdgeGraphPart::__edges, gum::EdgeGraphPart::__neighbours, gum::Set< Key, Alloc >::erase(), gum::EdgeGraphPart::existsEdge(), gum::Edge::first(), GUM_EMIT2, gum::EdgeGraphPart::onEdgeDeleted, and gum::Edge::second().
Referenced by gum::learning::Miic::_initiation(), gum::learning::Miic::_iteration(), gum::learning::Miic::_orientation_3off2(), gum::learning::Miic::_orientation_latents(), gum::learning::Miic::_orientation_miic(), gum::learning::Miic::_propagatesHead(), gum::EdgeGraphPart::eraseNeighbours(), and gum::EdgeGraphPart::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 83 of file edgeGraphPart_inl.h.
References gum::EdgeGraphPart::__neighbours, gum::EdgeGraphPart::eraseEdge(), and gum::EdgeGraphPart::neighbours().
|
virtual |
remove a node and its adjacent edges from the graph
id | the id of the node to be removed |
Reimplemented from gum::NodeGraphPart.
Reimplemented in gum::MixedGraph, and gum::CliqueGraph.
Definition at line 58 of file undiGraph_inl.h.
References gum::NodeGraphPart::eraseNode(), and gum::EdgeGraphPart::unvirtualizedEraseNeighbours().
Referenced by gum::prm::StructuredInference< GUM_SCALAR >::__removeNode(), and gum::StaticTriangulation::__triangulate().
alias for existsNode
Definition at line 292 of file nodeGraphPart_inl.h.
Referenced by gum::MarkovBlanket::__buildMarkovBlanket(), gum::prm::ClassBayesNet< GUM_SCALAR >::__get(), gum::learning::genericBNLearner::__learnDAG(), gum::prm::StructuredInference< GUM_SCALAR >::__removeNode(), gum::NodeGraphPartIterator::_setPos(), gum::prm::gspan::Pattern::addArc(), gum::DiGraph::addArc(), addEdge(), gum::prm::gspan::Pattern::exists(), and gum::DiGraph::hasDirectedPath().
indicates whether a given edge exists
edge | the edge we test whether or not it belongs to the EdgeGraphPart |
Definition at line 41 of file edgeGraphPart_inl.h.
References gum::EdgeGraphPart::__edges, and gum::Set< Key, Alloc >::contains().
Referenced by gum::StaticTriangulation::__computeMaxPrimeMergings(), gum::prm::GSpan< GUM_SCALAR >::__sortPatterns(), gum::EssentialGraph::__strongly_protected(), gum::StaticTriangulation::__triangulate(), gum::learning::Miic::_orientation_3off2(), gum::learning::Miic::_orientation_miic(), gum::EdgeGraphPart::eraseEdge(), gum::StaticTriangulation::fillIns(), and gum::prm::gspan::InterfaceGraph< GUM_SCALAR >::InterfaceGraph().
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 45 of file edgeGraphPart_inl.h.
References gum::EdgeGraphPart::__neighbours.
returns true iff the NodeGraphPart contains the given nodeId
Definition at line 286 of file nodeGraphPart_inl.h.
Referenced by gum::MarkovBlanket::__buildMarkovBlanket(), gum::SpanningForestPrim::__compute(), gum::SpanningForestPrim::__computeInAComponent(), gum::SpanningForestPrim::__exploreNode(), gum::OrderedEliminationSequenceStrategy::__isOrderNeeded(), gum::PartialOrderedEliminationSequenceStrategy::_isPartialOrderNeeded(), gum::OrderedEliminationSequenceStrategy::eliminationUpdate(), gum::DefaultPartialOrderedEliminationSequenceStrategy::eliminationUpdate(), gum::InfluenceDiagram< GUM_SCALAR >::getDecisionGraph(), gum::BayesNetFragment< GUM_SCALAR >::isInstalledNode(), partialUndiGraph(), gum::OrderedEliminationSequenceStrategy::setOrder(), and gum::PartialOrderedEliminationSequenceStrategy::setPartialOrder().
bool gum::UndiGraph::hasUndirectedCycle | ( | ) | const |
checks whether the graph contains cycles
Definition at line 55 of file undiGraph.cpp.
References gum::List< Val, Alloc >::empty(), gum::List< Val, Alloc >::front(), gum::List< Val, Alloc >::insert(), gum::EdgeGraphPart::neighbours(), gum::NodeGraphPart::nodes(), gum::NodeGraphPart::nodesProperty(), and gum::List< Val, Alloc >::popFront().
|
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 |
returns the set of edges adjacent to a given node
Note that the set of edges 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 78 of file edgeGraphPart_inl.h.
References gum::EdgeGraphPart::__checkNeighbours(), and gum::EdgeGraphPart::__neighbours.
Referenced by gum::DefaultJunctionTreeStrategy::__computeJunctionTree(), gum::StaticTriangulation::__computeMaxPrimeMergings(), gum::BinaryJoinTreeConverterDefault::__convertClique(), gum::BinaryJoinTreeConverterDefault::__convertConnectedComponent(), gum::SpanningForestPrim::__exploreNode(), gum::prm::gspan::DFSTree< GUM_SCALAR >::__initialiaze_root(), gum::BinaryJoinTreeConverterDefault::__markConnectedComponent(), gum::prm::StructuredInference< GUM_SCALAR >::__removeBarrenNodes(), gum::prm::GSpan< GUM_SCALAR >::__sortPatterns(), gum::EssentialGraph::__strongly_protected(), gum::StaticTriangulation::__triangulate(), gum::learning::Miic::_propagatesHead(), gum::EdgeGraphPart::eraseNeighbours(), gum::prm::gspan::DFSTree< GUM_SCALAR >::growPattern(), hasUndirectedCycle(), gum::learning::Miic::learnStructure(), gum::MixedGraph::mixedOrientedPath(), gum::MixedGraph::mixedUnorientedPath(), gum::EssentialGraph::neighbours(), gum::prm::gspan::DFSTree< GUM_SCALAR >::NeighborDegreeSort::operator()(), partialUndiGraph(), gum::EssentialGraph::toDot(), toDot(), gum::MixedGraph::toDot(), gum::EdgeGraphPart::undirectedPath(), and gum::EdgeGraphPart::unvirtualizedEraseNeighbours().
|
inherited |
returns a new node id, not yet used by any node
Definition at line 226 of file nodeGraphPart_inl.h.
Referenced by gum::InfluenceDiagram< GUM_SCALAR >::_addNode().
|
inherited |
return *this as a NodeGraphPart
Definition at line 373 of file nodeGraphPart_inl.h.
Referenced by gum::MarkovBlanket::__buildMarkovBlanket(), gum::SpanningForestPrim::__compute(), gum::StaticTriangulation::__computeMaxPrimeJunctionTree(), gum::prm::LayerGenerator< GUM_SCALAR >::__generateClassDag(), gum::prm::ClusteredLayerGenerator< GUM_SCALAR >::__generateClassDag(), gum::prm::GSpan< GUM_SCALAR >::__sortPatterns(), gum::credal::CNMonteCarloSampling< GUM_SCALAR, BNInferenceEngine >::__threadUpdate(), gum::InfluenceDiagram< GUM_SCALAR >::_moralGraph(), gum::InfluenceDiagram< GUM_SCALAR >::_removeTables(), gum::prm::StructuredInference< GUM_SCALAR >::CData::CData(), gum::StaticTriangulation::fillIns(), gum::InfluenceDiagram< GUM_SCALAR >::getDecisionGraph(), gum::prm::gspan::DFSTree< GUM_SCALAR >::growPattern(), hasUndirectedCycle(), gum::DAG::moralGraph(), gum::MarkovBlanket::nodes(), gum::EssentialGraph::nodes(), gum::prm::gspan::Pattern::nodes(), gum::MarkovBlanket::toDot(), gum::EssentialGraph::toDot(), gum::InfluenceDiagram< GUM_SCALAR >::toDot(), toDot(), gum::DiGraph::toDot(), and gum::MixedGraph::toDot().
|
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. |
Referenced by gum::InfluenceDiagram< GUM_SCALAR >::_getChildrenDecision(), gum::BarrenNodesFinder::barrenNodes(), gum::BinaryJoinTreeConverterDefault::convert(), gum::InfluenceDiagram< GUM_SCALAR >::existsPathBetween(), and hasUndirectedCycle().
|
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. |
|
inherited |
tests whether two EdgeGraphParts contain different edges
p | the EdgeGraphPart that we compare with this |
Definition at line 111 of file edgeGraphPart_inl.h.
References gum::EdgeGraphPart::__edges.
tests whether two UndiGraphs are different
g | the UndiGraph with which "this" is compared |
Definition at line 70 of file undiGraph_inl.h.
References operator==().
|
inherited |
check whether two NodeGraphParts contain different nodes
p | the NodeGraphPart to be compared with "this" |
Definition at line 357 of file nodeGraphPart_inl.h.
References gum::NodeGraphPartIterator::operator==().
copy operator
g | the DiGraph to copy |
Definition at line 48 of file undiGraph_inl.h.
References clear(), gum::EdgeGraphPart::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 107 of file edgeGraphPart_inl.h.
References gum::EdgeGraphPart::__edges.
Referenced by operator==(), and gum::MixedGraph::operator==().
tests whether two UndiGraphs are identical (same nodes, same edges)
g | the UndiGraph with which "this" is compared |
Definition at line 66 of file undiGraph_inl.h.
References gum::EdgeGraphPart::operator==(), and gum::NodeGraphPart::operator==().
Referenced by 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 gum::NodeGraphPart::__boundVal, and gum::NodeGraphPart::__holes.
Referenced by operator==(), gum::DiGraph::operator==(), and gum::MixedGraph::operator==().
returns the partial graph formed by the nodes given in parameter
Definition at line 139 of file undiGraph.cpp.
References addEdge(), gum::NodeGraphPart::addNodeWithId(), gum::NodeGraphPart::existsNode(), and gum::EdgeGraphPart::neighbours().
|
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 64 of file nodeGraphPart.cpp.
References gum::NodeGraphPart::__boundVal, gum::NodeGraphPart::__holes, gum::NodeGraphPart::__holes_resize_policy, gum::NodeGraphPart::__holes_size, gum::NodeGraphPart::__updateEndIteratorSafe(), and gum::NodeGraphPart::clear().
Referenced by gum::DAGmodel::__moralGraph(), and gum::DAG::moralGraph().
|
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.
|
inherited |
alias for sizeNodes
Definition at line 284 of file nodeGraphPart_inl.h.
Referenced by gum::StaticTriangulation::__computeMaxPrimeJunctionTree(), gum::StaticTriangulation::__computeRecursiveThinning(), gum::OrderedEliminationSequenceStrategy::__isOrderNeeded(), gum::DiGraph::__topologicalOrder(), gum::StaticTriangulation::__triangulate(), gum::PartialOrderedEliminationSequenceStrategy::_isPartialOrderNeeded(), gum::BarrenNodesFinder::barrenNodes(), gum::prm::gspan::DFSTree< GUM_SCALAR >::growPattern(), gum::learning::GreedyHillClimbing::learnStructure(), gum::learning::LocalSearchWithTabuList::learnStructure(), gum::BayesBall::relevantPotentials(), gum::dSeparation::relevantPotentials(), gum::BayesBall::requisiteNodes(), gum::dSeparation::requisiteNodes(), gum::StaticTriangulation::setGraph(), gum::MarkovBlanket::size(), gum::EssentialGraph::size(), gum::DAGmodel::size(), gum::prm::gspan::Pattern::size(), gum::StaticTriangulation::StaticTriangulation(), and toDot().
|
inherited |
indicates the number of edges stored within the EdgeGraphPart
Definition at line 37 of file edgeGraphPart_inl.h.
References gum::EdgeGraphPart::__edges, and gum::Set< Key, Alloc >::size().
Referenced by gum::EssentialGraph::sizeEdges().
|
inherited |
returns the number of nodes in the NodeGraphPart
Definition at line 280 of file nodeGraphPart_inl.h.
Referenced by gum::BinaryJoinTreeConverterDefault::__markConnectedComponent(), gum::BarrenNodesFinder::barrenNodes(), gum::BinaryJoinTreeConverterDefault::convert(), gum::EliminationSequenceStrategy::setGraph(), gum::MarkovBlanket::sizeNodes(), and gum::EssentialGraph::sizeNodes().
|
virtual |
to friendly display graph in DOT format
Reimplemented in gum::CliqueGraph, and gum::MixedGraph.
Definition at line 109 of file undiGraph.cpp.
References gum::List< Val, Alloc >::exists(), gum::List< Val, Alloc >::insert(), gum::EdgeGraphPart::neighbours(), gum::NodeGraphPart::nodes(), and gum::NodeGraphPart::size().
|
virtual |
to friendly display the content of the graph
Reimplemented in gum::MixedGraph, and gum::CliqueGraph.
Definition at line 102 of file undiGraph.cpp.
References 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 127 of file edgeGraphPart.cpp.
References gum::List< Val, Alloc >::empty(), gum::HashTable< Key, Val, Alloc >::exists(), gum::List< Val, Alloc >::front(), GUM_ERROR, gum::HashTable< Key, Val, Alloc >::insert(), gum::EdgeGraphPart::neighbours(), gum::List< Val, Alloc >::popFront(), and gum::List< Val, Alloc >::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 96 of file edgeGraphPart_inl.h.
References gum::EdgeGraphPart::__neighbours, gum::EdgeGraphPart::eraseEdge(), and gum::EdgeGraphPart::neighbours().
Referenced by eraseNode(), and gum::MixedGraph::eraseNode().
Definition at line 79 of file edgeGraphPart.h.
Referenced by gum::EdgeGraphPart::addEdge(), gum::EdgeGraphPart::EdgeGraphPart(), and gum::EdgeGraphPart::operator=().
Definition at line 80 of file edgeGraphPart.h.
Referenced by gum::EdgeGraphPart::clearEdges(), and gum::EdgeGraphPart::eraseEdge().
|
inherited |
Definition at line 274 of file nodeGraphPart.h.
Referenced by gum::NodeGraphPart::addNodeWithId().
|
inherited |
Definition at line 275 of file nodeGraphPart.h.
Referenced by gum::NodeGraphPart::__clearNodes().