![]() |
aGrUM
0.16.0
|
Base class for mixed graphs. More...
#include <mixedGraph.h>
Public Attributes | |
Signaler1< NodeId > | onNodeAdded |
Signaler1< NodeId > | onNodeDeleted |
Signaler2< NodeId, NodeId > | onEdgeAdded |
Signaler2< NodeId, NodeId > | onEdgeDeleted |
Signaler2< NodeId, NodeId > | onArcAdded |
Signaler2< NodeId, NodeId > | onArcDeleted |
Public Member Functions | |
bool | hasDirectedPath (const NodeId from, const NodeId to) |
checks whether there exists a directed path from from to to More... | |
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 More... | |
MixedGraph (const MixedGraph &g) | |
copy constructor More... | |
virtual | ~MixedGraph () |
destructor More... | |
Operators | |
MixedGraph & | operator= (const MixedGraph &g) |
copy operator More... | |
bool | operator== (const MixedGraph &g) const |
tests whether two MixedGraphs are identical (same nodes, arcs and edges) More... | |
bool | operator!= (const MixedGraph &g) const |
tests whether two MixedGraphs are different More... | |
Accessors/Modifiers | |
virtual void | eraseNode (const NodeId id) |
remove a node as well as its adjacent arcs and edges from the graph More... | |
virtual void | clear () |
removes all the nodes, arcs and edges from the graph More... | |
const std::vector< NodeId > | mixedOrientedPath (const NodeId node1, const NodeId node2) const |
returns a mixed edge/directed arc path from node1 to node2 in the arc/edge set More... | |
const std::vector< NodeId > | mixedUnorientedPath (const NodeId node1, const NodeId node2) const |
returns a mixed/directed path from node1 to node2 in the arc/edge set More... | |
virtual const std::string | toDot () const |
to friendly display mixed graph in DOT format More... | |
virtual const std::string | toString () const |
to friendly display the content of the MixedGraph More... | |
Operators | |
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... | |
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... | |
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 | addEdge (const NodeId first, const NodeId second) |
insert a new edge into the undirected graph 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... | |
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... | |
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... | |
Operators | |
bool | operator== (const DiGraph &g) const |
tests whether two DiGraphs are identical (same nodes, same arcs) More... | |
bool | operator!= (const DiGraph &g) const |
tests whether two DiGraphs are different More... | |
Operators | |
bool | operator== (const ArcGraphPart &p) const |
tests whether two ArcGraphParts contain the same arcs More... | |
bool | operator!= (const ArcGraphPart &p) const |
tests whether two ArcGraphParts contain different arcs More... | |
Accessors/Modifiers | |
virtual void | addArc (const NodeId tail, const NodeId head) |
insert a new arc into the directed graph More... | |
const Sequence< NodeId > & | topologicalOrder (bool clear=true) const |
The topological order stays the same as long as no variable or arcs are added or erased src the topology. More... | |
Accessors/Modifiers | |
virtual void | eraseArc (const Arc &arc) |
removes an arc from the ArcGraphPart More... | |
bool | existsArc (const Arc &arc) const |
indicates whether a given arc exists More... | |
bool | existsArc (const NodeId tail, const NodeId head) const |
indicates whether a given arc exists More... | |
bool | emptyArcs () const |
indicates wether the ArcGraphPart contains any arc More... | |
void | clearArcs () |
removes all the arcs from the ArcGraphPart More... | |
Size | sizeArcs () const |
indicates the number of arcs stored within the ArcGraphPart More... | |
const ArcSet & | arcs () const |
returns the set of arcs stored within the ArcGraphPart More... | |
const NodeSet & | parents (const NodeId id) const |
returns the set of nodes with arc ingoing to a given node More... | |
const NodeSet & | children (const NodeId id) const |
returns the set of nodes with arc outgoing from a given node More... | |
void | eraseParents (const NodeId id) |
erase all the parents of a given node More... | |
void | unvirtualizedEraseParents (const NodeId id) |
same function as eraseParents but without any virtual call to an erase More... | |
void | eraseChildren (const NodeId id) |
removes all the children of a given node More... | |
void | unvirtualizedEraseChildren (const NodeId id) |
same function as eraseChildren but without any virtual call to an erase More... | |
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)) More... | |
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) More... | |
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)) More... | |
const std::vector< NodeId > | directedPath (const NodeId node1, const NodeId node2) const |
returns a directed path from node1 to node2 belonging to the set of arcs More... | |
const std::vector< NodeId > | directedUnorientedPath (const NodeId node1, const NodeId node2) const |
returns an unoriented (directed) path from node1 to node2 in the arc set More... | |
Public Types | |
typedef NodeGraphPartIterator | NodeIterator |
typedef NodeGraphPartIterator | NodeConstIterator |
typedef NodeGraphPartIteratorSafe | NodeIteratorSafe |
typedef NodeGraphPartIteratorSafe | NodeConstIteratorSafe |
typedef EdgeSetIterator | EdgeIterator |
typedef ArcSetIterator | ArcIterator |
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... | |
Protected Member Functions | |
void | _eraseSetOfArcs (const ArcSet &set) |
a (virtualized) function to remove a given set of arcs More... | |
void | _unvirtualizedEraseSetOfArcs (const ArcSet &set) |
similar to _eraseSetOfArcs except that it is unvirtualized More... | |
Base class for mixed graphs.
Definition at line 127 of file mixedGraph.h.
|
inherited |
Definition at line 81 of file arcGraphPart.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 |
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 37 of file mixedGraph.cpp.
gum::MixedGraph::MixedGraph | ( | const MixedGraph & | g | ) |
copy constructor
g | the MixedGraph to copy |
Definition at line 53 of file mixedGraph.cpp.
|
virtual |
destructor
Definition at line 59 of file mixedGraph.cpp.
|
protectedinherited |
a (virtualized) function to remove a given set of arcs
Definition at line 91 of file arcGraphPart_inl.h.
References gum::ArcGraphPart::eraseArc().
|
protectedinherited |
similar to _eraseSetOfArcs except that it is unvirtualized
Definition at line 124 of file arcGraphPart_inl.h.
References gum::ArcGraphPart::eraseArc().
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.
Definition at line 35 of file diGraph_inl.h.
References gum::ArcGraphPart::addArc(), gum::NodeGraphPart::exists(), and GUM_ERROR.
Referenced by gum::EssentialGraph::__buildEssentialGraph(), gum::MarkovBlanket::__buildMarkovBlanket(), gum::learning::Miic::_orientation_3off2(), gum::learning::Miic::_orientation_latents(), gum::learning::Miic::_orientation_miic(), gum::learning::Miic::_propagatesHead(), gum::prm::gspan::Pattern::addArc(), gum::DAG::addArc(), and gum::DAGCycleDetector::addArc().
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(), gum::UndiGraph::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(), gum::UndiGraph::partialUndiGraph(), gum::EssentialGraph::skeleton(), and gum::learning::StructuralConstraintDAG::StructuralConstraintDAG().
|
inherited |
returns the set of arcs stored within the ArcGraphPart
Definition at line 39 of file arcGraphPart_inl.h.
References gum::ArcGraphPart::__arcs.
Referenced by gum::MarkovBlanket::arcs(), gum::EssentialGraph::arcs(), gum::DAGmodel::arcs(), gum::prm::gspan::Pattern::arcs(), gum::learning::DAG2BNLearner< ALLOC >::createBN(), gum::DAG::moralGraph(), 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 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 |
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 |
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().
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 62 of file arcGraphPart_inl.h.
References gum::ArcGraphPart::__checkChildren(), and gum::ArcGraphPart::__children.
Referenced by gum::MCBayesNetGenerator< GUM_SCALAR, ICPTGenerator, ICPTDisturber >::__AR(), gum::EssentialGraph::__buildEssentialGraph(), gum::MCBayesNetGenerator< GUM_SCALAR, ICPTGenerator, ICPTDisturber >::__connect(), gum::MCBayesNetGenerator< GUM_SCALAR, ICPTGenerator, ICPTDisturber >::__directedPath(), gum::prm::gspan::Pattern::__expandCodeIsMinimal(), gum::prm::gspan::Pattern::__not_rec(), gum::prm::gspan::Pattern::__rec(), gum::InfluenceDiagram< GUM_SCALAR >::_getChildrenDecision(), gum::credal::CNLoopyPropagation< GUM_SCALAR >::_initialize(), gum::credal::CNLoopyPropagation< GUM_SCALAR >::_makeInferenceNodeToNeighbours(), gum::ArcGraphPart::ArcGraphPart(), gum::MarkovBlanket::children(), gum::EssentialGraph::children(), gum::DAGmodel::children(), gum::ArcGraphPart::directedUnorientedPath(), gum::InfluenceDiagram< GUM_SCALAR >::erase(), gum::ArcGraphPart::eraseChildren(), gum::InfluenceDiagram< GUM_SCALAR >::existsPathBetween(), gum::DiGraph::hasDirectedPath(), gum::prm::gspan::Pattern::isMinimal(), mixedUnorientedPath(), gum::BayesBall::relevantPotentials(), gum::dSeparation::relevantPotentials(), gum::prm::gspan::Pattern::remove(), gum::BayesBall::requisiteNodes(), gum::dSeparation::requisiteNodes(), gum::MarkovBlanket::toDot(), gum::EssentialGraph::toDot(), gum::InfluenceDiagram< GUM_SCALAR >::toDot(), toDot(), and gum::ArcGraphPart::unvirtualizedEraseChildren().
|
virtual |
removes all the nodes, arcs and edges from the graph
Reimplemented from gum::DiGraph.
Definition at line 49 of file mixedGraph_inl.h.
References gum::ArcGraphPart::clearArcs(), gum::EdgeGraphPart::clearEdges(), and gum::NodeGraphPart::clearNodes().
Referenced by gum::EssentialGraph::__buildEssentialGraph().
|
inherited |
removes all the arcs from the ArcGraphPart
Definition at line 79 of file arcGraphPart.cpp.
References gum::ArcGraphPart::__arcs, gum::ArcGraphPart::__children, gum::ArcGraphPart::__parents, gum::Set< Key, Alloc >::clear(), GUM_EMIT2, and gum::ArcGraphPart::onArcDeleted.
Referenced by gum::DiGraph::clear(), clear(), gum::ArcGraphPart::operator=(), operator=(), and gum::ArcGraphPart::~ArcGraphPart().
|
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 gum::UndiGraph::clear(), clear(), gum::EdgeGraphPart::operator=(), 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(), gum::UndiGraph::clear(), clear(), and operator=().
|
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 155 of file arcGraphPart.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::ArcGraphPart::parents(), gum::List< Val, Alloc >::popFront(), and gum::List< Val, Alloc >::pushBack().
Referenced by gum::learning::Miic::_orientation_latents().
|
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 198 of file arcGraphPart.cpp.
References gum::ArcGraphPart::children(), 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::ArcGraphPart::parents(), gum::List< Val, Alloc >::popFront(), and gum::List< Val, Alloc >::pushBack().
|
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 ArcGraphPart contains any arc
Definition at line 35 of file arcGraphPart_inl.h.
References gum::ArcGraphPart::__arcs, and gum::Set< Key, Alloc >::empty().
|
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 arc from the ArcGraphPart
arc | the arc to be removed |
Definition at line 79 of file arcGraphPart_inl.h.
References gum::ArcGraphPart::__arcs, gum::ArcGraphPart::__children, gum::ArcGraphPart::__parents, gum::Set< Key, Alloc >::erase(), gum::ArcGraphPart::existsArc(), GUM_EMIT2, gum::Arc::head(), gum::ArcGraphPart::onArcDeleted, and gum::Arc::tail().
Referenced by gum::EssentialGraph::__buildEssentialGraph(), gum::prm::LayerGenerator< GUM_SCALAR >::__generateClassDag(), gum::prm::ClusteredLayerGenerator< GUM_SCALAR >::__generateClassDag(), gum::learning::genericBNLearner::__learnDAG(), gum::ArcGraphPart::_eraseSetOfArcs(), gum::learning::Miic::_orientation_3off2(), gum::learning::Miic::_orientation_latents(), gum::learning::Miic::_orientation_miic(), gum::BayesNetFragment< GUM_SCALAR >::_uninstallArc(), gum::ArcGraphPart::_unvirtualizedEraseSetOfArcs(), gum::DAGCycleDetector::eraseArc(), gum::InfluenceDiagram< GUM_SCALAR >::eraseArc(), gum::ArcGraphPart::eraseChildren(), gum::ArcGraphPart::eraseParents(), gum::learning::GreedyHillClimbing::learnStructure(), gum::learning::LocalSearchWithTabuList::learnStructure(), gum::prm::gspan::Pattern::pop_back(), gum::BayesNet< double >::reverseArc(), gum::ArcGraphPart::unvirtualizedEraseChildren(), and gum::ArcGraphPart::unvirtualizedEraseParents().
|
inherited |
removes all the children of a given node
id | the node all the children of which will be removed |
Definition at line 110 of file arcGraphPart_inl.h.
References gum::ArcGraphPart::__children, gum::Set< Key, Alloc >::beginSafe(), gum::ArcGraphPart::children(), gum::Set< Key, Alloc >::endSafe(), and gum::ArcGraphPart::eraseArc().
|
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 as well as its adjacent arcs and edges from the graph
id | the id of the node to be removed |
Reimplemented from gum::DiGraph.
Definition at line 55 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 96 of file arcGraphPart_inl.h.
References gum::ArcGraphPart::__parents, gum::Set< Key, Alloc >::beginSafe(), gum::Set< Key, Alloc >::endSafe(), gum::ArcGraphPart::eraseArc(), and gum::ArcGraphPart::parents().
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(), gum::UndiGraph::addEdge(), gum::prm::gspan::Pattern::exists(), and gum::DiGraph::hasDirectedPath().
indicates whether a given arc exists
arc | the arc we test whether or not it belongs to the ArcGraphPart |
Definition at line 41 of file arcGraphPart_inl.h.
References gum::ArcGraphPart::__arcs, and gum::Set< Key, Alloc >::contains().
Referenced by gum::MCBayesNetGenerator< GUM_SCALAR, ICPTGenerator, ICPTDisturber >::__AorR(), gum::MCBayesNetGenerator< GUM_SCALAR, ICPTGenerator, ICPTDisturber >::__AR(), gum::MarkovBlanket::__buildMarkovBlanket(), gum::MCBayesNetGenerator< GUM_SCALAR, ICPTGenerator, ICPTDisturber >::__connect(), gum::MCBayesNetGenerator< GUM_SCALAR, ICPTGenerator, ICPTDisturber >::__directedPath(), gum::learning::Miic::__existsDirectedPath(), gum::prm::LayerGenerator< GUM_SCALAR >::__generateClassDag(), gum::prm::ClusteredLayerGenerator< GUM_SCALAR >::__generateClassDag(), gum::MCBayesNetGenerator< GUM_SCALAR, ICPTGenerator, ICPTDisturber >::__jump_multi(), gum::MCBayesNetGenerator< GUM_SCALAR, ICPTGenerator, ICPTDisturber >::__jump_poly(), gum::prm::gspan::Pattern::__not_rec(), gum::prm::gspan::Pattern::__rec(), gum::learning::Miic::_orientation_3off2(), gum::learning::Miic::_orientation_latents(), gum::learning::Miic::_orientation_miic(), gum::learning::Miic::_updateProbaTriples(), gum::DAGCycleDetector::addArc(), gum::ArcGraphPart::eraseArc(), gum::DAGCycleDetector::eraseArc(), gum::InfluenceDiagram< GUM_SCALAR >::eraseArc(), and gum::prm::gspan::Pattern::exists().
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 45 of file arcGraphPart_inl.h.
References gum::ArcGraphPart::__parents.
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(), gum::UndiGraph::partialUndiGraph(), gum::OrderedEliminationSequenceStrategy::setOrder(), and gum::PartialOrderedEliminationSequenceStrategy::setPartialOrder().
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 137 of file diGraph.cpp.
References gum::ArcGraphPart::children(), gum::Set< Key, Alloc >::contains(), gum::List< Val, Alloc >::empty(), gum::NodeGraphPart::exists(), gum::List< Val, Alloc >::front(), gum::Set< Key, Alloc >::insert(), gum::List< Val, Alloc >::popFront(), and gum::List< Val, Alloc >::pushBack().
Referenced by gum::DAG::addArc().
|
inherited |
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 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 |
const std::vector< NodeId > gum::MixedGraph::mixedOrientedPath | ( | const NodeId | node1, |
const NodeId | node2 | ||
) | const |
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 (following the direction of th 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 74 of file mixedGraph.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::ArcGraphPart::parents(), gum::List< Val, Alloc >::popFront(), and gum::List< Val, Alloc >::pushBack().
const std::vector< NodeId > gum::MixedGraph::mixedUnorientedPath | ( | const NodeId | node1, |
const NodeId | node2 | ||
) | const |
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 |
NotFound | exception is raised if no path can be found between the two nodes |
Definition at line 136 of file mixedGraph.cpp.
References gum::ArcGraphPart::children(), 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::ArcGraphPart::parents(), gum::List< Val, Alloc >::popFront(), and gum::List< Val, Alloc >::pushBack().
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(), gum::UndiGraph::hasUndirectedCycle(), gum::learning::Miic::learnStructure(), mixedOrientedPath(), mixedUnorientedPath(), gum::EssentialGraph::neighbours(), gum::prm::gspan::DFSTree< GUM_SCALAR >::NeighborDegreeSort::operator()(), gum::UndiGraph::partialUndiGraph(), gum::EssentialGraph::toDot(), gum::UndiGraph::toDot(), 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(), gum::UndiGraph::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(), gum::UndiGraph::toDot(), gum::DiGraph::toDot(), and 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 gum::UndiGraph::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.
|
inherited |
tests whether two ArcGraphParts contain different arcs
p | the ArcGraphPart that we compare with this |
Definition at line 157 of file arcGraphPart_inl.h.
References gum::ArcGraphPart::__arcs.
tests whether two UndiGraphs are different
g | the UndiGraph with which "this" is compared |
Definition at line 70 of file undiGraph_inl.h.
References gum::UndiGraph::operator==().
tests whether two DiGraphs are different
g | the DiGraph with which "this" is compared |
Definition at line 83 of file diGraph_inl.h.
References gum::DiGraph::operator==().
INLINE bool gum::MixedGraph::operator!= | ( | const MixedGraph & | g | ) | const |
tests whether two MixedGraphs are different
g | the MixedGraph with which "this" is compared |
Definition at line 67 of file mixedGraph_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==().
INLINE MixedGraph & gum::MixedGraph::operator= | ( | const MixedGraph & | g | ) |
copy operator
g | the MixedGraph to copy |
Definition at line 32 of file mixedGraph_inl.h.
References gum::ArcGraphPart::clearArcs(), gum::EdgeGraphPart::clearEdges(), gum::NodeGraphPart::clearNodes(), gum::EdgeGraphPart::operator=(), 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 107 of file edgeGraphPart_inl.h.
References gum::EdgeGraphPart::__edges.
Referenced by gum::UndiGraph::operator==(), and operator==().
|
inherited |
tests whether two ArcGraphParts contain the same arcs
p | the ArcGraphPart that we compare with this |
Definition at line 153 of file arcGraphPart_inl.h.
References gum::ArcGraphPart::__arcs.
Referenced by gum::DiGraph::operator==(), and 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 gum::UndiGraph::operator!=().
tests whether two DiGraphs are identical (same nodes, same arcs)
g | the DiGraph with which "this" is compared |
Definition at line 79 of file diGraph_inl.h.
References gum::ArcGraphPart::operator==(), and gum::NodeGraphPart::operator==().
Referenced by gum::DiGraph::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 62 of file mixedGraph_inl.h.
References gum::EdgeGraphPart::operator==(), gum::ArcGraphPart::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 gum::UndiGraph::operator==(), gum::DiGraph::operator==(), and operator==().
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 57 of file arcGraphPart_inl.h.
References gum::ArcGraphPart::__checkParents(), and gum::ArcGraphPart::__parents.
Referenced by gum::MCBayesNetGenerator< GUM_SCALAR, ICPTGenerator, ICPTDisturber >::__AR(), gum::MCBayesNetGenerator< GUM_SCALAR, ICPTGenerator, ICPTDisturber >::__connect(), gum::learning::Miic::__existsDirectedPath(), gum::prm::gspan::Pattern::__expandCodeIsMinimal(), gum::prm::ClusteredLayerGenerator< GUM_SCALAR >::__generateClass(), gum::prm::LayerGenerator< GUM_SCALAR >::__generateClassDag(), gum::prm::ClusteredLayerGenerator< GUM_SCALAR >::__generateClassDag(), gum::prm::LayerGenerator< GUM_SCALAR >::__generateClasses(), gum::prm::ClusteredLayerGenerator< GUM_SCALAR >::__generateCluster(), gum::prm::gspan::Pattern::__not_rec(), gum::prm::gspan::Pattern::__rec(), gum::EssentialGraph::__strongly_protected(), gum::InfluenceDiagram< GUM_SCALAR >::_copyTables(), gum::credal::CNLoopyPropagation< GUM_SCALAR >::_initialize(), gum::credal::CNLoopyPropagation< GUM_SCALAR >::_makeInferenceNodeToNeighbours(), gum::InfluenceDiagram< GUM_SCALAR >::_moralGraph(), gum::learning::Miic::_orientation_miic(), gum::learning::Miic::_propagatesHead(), gum::BarrenNodesFinder::barrenNodes(), gum::ArcGraphPart::directedPath(), gum::ArcGraphPart::directedUnorientedPath(), gum::learning::BNDatabaseGenerator< GUM_SCALAR >::drawSamples(), gum::ArcGraphPart::eraseParents(), gum::InfluenceDiagram< GUM_SCALAR >::getPartialTemporalOrder(), gum::prm::gspan::Pattern::isMinimal(), gum::learning::Miic::learnStructure(), mixedOrientedPath(), mixedUnorientedPath(), gum::DAG::moralGraph(), gum::prm::gspan::DFSTree< GUM_SCALAR >::parent(), gum::MarkovBlanket::parents(), gum::EssentialGraph::parents(), gum::DAGmodel::parents(), gum::BayesBall::relevantPotentials(), gum::dSeparation::relevantPotentials(), gum::prm::gspan::Pattern::remove(), gum::BayesBall::requisiteNodes(), gum::dSeparation::requisiteNodes(), gum::prm::gspan::Pattern::rightmostPath(), and gum::ArcGraphPart::unvirtualizedEraseParents().
returns the partial graph formed by the nodes given in parameter
Definition at line 139 of file undiGraph.cpp.
References gum::UndiGraph::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 gum::UndiGraph::toDot().
|
inherited |
indicates the number of arcs stored within the ArcGraphPart
Definition at line 37 of file arcGraphPart_inl.h.
References gum::ArcGraphPart::__arcs, and gum::Set< Key, Alloc >::size().
Referenced by gum::MarkovBlanket::sizeArcs(), gum::EssentialGraph::sizeArcs(), gum::DAGmodel::sizeArcs(), gum::prm::gspan::Pattern::sizeArcs(), and gum::InfluenceDiagram< GUM_SCALAR >::toString().
|
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 mixed graph in DOT format
Reimplemented from gum::DiGraph.
Definition at line 217 of file mixedGraph.cpp.
References gum::ArcGraphPart::children(), gum::List< Val, Alloc >::exists(), gum::List< Val, Alloc >::insert(), gum::EdgeGraphPart::neighbours(), and gum::NodeGraphPart::nodes().
The topological order stays the same as long as no variable or arcs are added or erased src the topology.
clear | If false returns the previously created topology. |
InvalidDirectedCycle | Raised if this DiGraph contains cycles. |
Definition at line 91 of file diGraph.cpp.
References gum::DiGraph::__mutableTopologicalOrder, gum::DiGraph::__topologicalOrder(), and gum::SequenceImplementation< Key, Alloc, Gen >::clear().
Referenced by gum::prm::o3prm::O3ClassFactory< GUM_SCALAR >::__setO3ClassCreationOrder(), gum::prm::o3prm::O3InterfaceFactory< GUM_SCALAR >::__setO3InterfaceCreationOrder(), gum::prm::o3prm::O3TypeFactory< GUM_SCALAR >::__setO3TypeCreationOrder(), gum::learning::Miic::learnStructure(), and gum::DAGmodel::topologicalOrder().
|
virtual |
to friendly display the content of the MixedGraph
Reimplemented from gum::DiGraph.
Definition at line 64 of file mixedGraph.cpp.
References gum::EdgeGraphPart::toString(), gum::ArcGraphPart::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 eraseChildren but without any virtual call to an erase
id | the node whose outgoing arcs will be removed |
Definition at line 141 of file arcGraphPart_inl.h.
References gum::ArcGraphPart::__children, gum::Set< Key, Alloc >::beginSafe(), gum::ArcGraphPart::children(), gum::Set< Key, Alloc >::endSafe(), and gum::ArcGraphPart::eraseArc().
Referenced by gum::DiGraph::eraseNode(), and 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 96 of file edgeGraphPart_inl.h.
References gum::EdgeGraphPart::__neighbours, gum::EdgeGraphPart::eraseEdge(), and gum::EdgeGraphPart::neighbours().
Referenced by gum::UndiGraph::eraseNode(), and 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 129 of file arcGraphPart_inl.h.
References gum::ArcGraphPart::__parents, gum::Set< Key, Alloc >::beginSafe(), gum::Set< Key, Alloc >::endSafe(), gum::ArcGraphPart::eraseArc(), and gum::ArcGraphPart::parents().
Referenced by gum::DiGraph::eraseNode(), and eraseNode().
Definition at line 83 of file arcGraphPart.h.
Referenced by gum::ArcGraphPart::addArc(), gum::ArcGraphPart::ArcGraphPart(), and gum::ArcGraphPart::operator=().
Definition at line 84 of file arcGraphPart.h.
Referenced by gum::ArcGraphPart::clearArcs(), and gum::ArcGraphPart::eraseArc().
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().