![]() |
aGrUM 3.1.1
a C++ library for (probabilistic) graphical models
|
Class for node sets in graph. More...
#include <nodeGraphPart.h>
Public Types | |
| using | NodeIterator = NodeGraphPartIterator |
| using | NodeConstIterator = NodeGraphPartIterator |
| using | NodeIteratorSafe = NodeGraphPartIteratorSafe |
| using | NodeConstIteratorSafe = NodeGraphPartIteratorSafe |
| using | node_iterator = NodeGraphPartIterator |
| types for STL compliance | |
| using | node_const_iterator = NodeGraphPartIterator |
| types for STL compliance | |
| using | node_iterator_safe = NodeGraphPartIteratorSafe |
| types for STL compliance | |
| using | node_const_iterator_safe = NodeGraphPartIteratorSafe |
| types for STL compliance | |
Public Member Functions | |
Constructors / Destructors | |
| NodeGraphPart (Size holes_size=HashTableConst::default_size, bool holes_resize_policy=true) | |
| default constructor | |
| NodeGraphPart (const NodeGraphPart &s) | |
| copy constructor | |
| NodeGraphPart (NodeGraphPart &&s) | |
| move constructor | |
| virtual | ~NodeGraphPart () |
| destructor | |
Operators | |
| NodeGraphPart & | operator= (const NodeGraphPart &p) |
| copy operator | |
| NodeGraphPart & | operator= (NodeGraphPart &&p) |
| move assignment operator | |
| bool | operator== (const NodeGraphPart &p) const |
| check whether two NodeGraphParts contain the same 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 | |
| virtual void | eraseNode (const NodeId id) |
| erase the 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 | |
| virtual void | clear () |
| alias for clearNodes | |
| 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 | |
| virtual std::string | toString () const |
| a function to display the set of nodes | |
| std::string | nameFromId (NodeId id) const |
| returns the name of node id, or "<id>" if no name is set | |
| std::optional< NodeId > | idFromName (const std::string &name) const |
| returns the id of the node with the given name, or std::nullopt | |
| void | setName (NodeId id, const std::string &name) |
| sets the name of node id | |
| bool | hasName (NodeId id) const |
| returns true iff node id has an explicit name | |
| std::string | dotNodeLabel (NodeId id) const |
| returns " [label=\"...\"]" with DOT-escaped name, or "" if no name | |
| 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)) | |
Public Attributes | |
| Signaler< NodeId > | onNodeAdded |
| Signaler< NodeId > | onNodeDeleted |
Private Member Functions | |
| void | _updateEndIteratorSafe_ () |
| updating endIterator (always at max+1) | |
| void | _clearNodes_ () |
| code for clearing nodes (called twice) | |
| void | _eraseHole_ (NodeId id) |
| to delete hole. | |
| void | _addHole_ (NodeId id) |
| to add a hole. | |
| std::unique_ptr< Bijection< NodeId, std::string > > | _cloneNames_ () const |
| clone the names bijection (returns nullptr when no name has been set) | |
Introspection | |
| bool | _inHoles_ (NodeId id) const |
| Size | _sizeHoles_ () const |
Private Attributes | |
| NodeSet * | _holes_ |
| the set of nodes not contained in the NodeGraphPart in the interval 1. | |
| std::unique_ptr< Bijection< NodeId, std::string > > | _names_ |
| optional node names — null when no name has been set | |
| Size | _holes_size_ |
| value for holes configuration | |
| bool | _holes_resize_policy_ |
| value for holes configuration | |
| NodeGraphPartIteratorSafe | _endIteratorSafe_ |
| the end iterator (used to speed-up parsings of the NodeGraphPart) | |
| NodeId | _boundVal_ |
| the id below which NodeIds may belong to the NodeGraphPart | |
Friends | |
| class | NodeGraphPartIterator |
| class | NodeGraphPartIteratorSafe |
Class for node sets in graph.
NodeGraphPart represents the set of nodes of all the graphs. It is built to be as light as possible and it implements its own NodeId factory. The set of NodeId is 0 ... ( bound-1) minus the NodeIds in holes.
Definition at line 263 of file nodeGraphPart.h.
types for STL compliance
Definition at line 268 of file nodeGraphPart.h.
types for STL compliance
Definition at line 270 of file nodeGraphPart.h.
types for STL compliance
Definition at line 267 of file nodeGraphPart.h.
types for STL compliance
Definition at line 269 of file nodeGraphPart.h.
Definition at line 277 of file nodeGraphPart.h.
Definition at line 279 of file nodeGraphPart.h.
Definition at line 276 of file nodeGraphPart.h.
Definition at line 278 of file nodeGraphPart.h.
|
explicit |
default constructor
A NodeGrphPart does not store all its nodes. To be lighter in terms of memory consumption, it store its maximal NodeId and the set of NodeIds between 0 and this maximum that do not actually belong to the set of its nodes (the so-called set of holes). In practice, it turns out that the set of holes is most often very small.
| holes_size | the size of the hash table used to store all holes |
| holes_resize_policy | the resizing policy of this hash table |
Definition at line 57 of file nodeGraphPart.cpp.
References NodeGraphPart(), _boundVal_, _endIteratorSafe_, _holes_, _holes_resize_policy_, _holes_size_, and _updateEndIteratorSafe_().
Referenced by gum::DiGraph::DiGraph(), gum::DiGraph::DiGraph(), gum::DiGraph::DiGraph(), NodeGraphPart(), NodeGraphPart(), NodeGraphPart(), gum::UndiGraph::UndiGraph(), gum::UndiGraph::UndiGraph(), gum::UndiGraph::UndiGraph(), ~NodeGraphPart(), nodes(), gum::prm::gspan::Pattern::nodes(), operator=(), operator=(), operator==(), populateNodes(), and populateNodesFromProperty().
| gum::NodeGraphPart::NodeGraphPart | ( | const NodeGraphPart & | s | ) |
copy constructor
| s | the NodeGraphPart to be copied |
Definition at line 65 of file nodeGraphPart.cpp.
References NodeGraphPart(), _boundVal_, _cloneNames_(), _endIteratorSafe_, _holes_, _holes_resize_policy_, _holes_size_, _names_, and _updateEndIteratorSafe_().
| gum::NodeGraphPart::NodeGraphPart | ( | NodeGraphPart && | s | ) |
move constructor
Definition at line 79 of file nodeGraphPart.cpp.
References NodeGraphPart(), _boundVal_, _endIteratorSafe_, _holes_, _holes_resize_policy_, _holes_size_, _names_, and _updateEndIteratorSafe_().
|
virtual |
destructor
Definition at line 91 of file nodeGraphPart.cpp.
References NodeGraphPart(), and _holes_.
|
private |
to add a hole.
Definition at line 112 of file nodeGraphPart.cpp.
References _boundVal_, _holes_, _holes_resize_policy_, _holes_size_, and _updateEndIteratorSafe_().
Referenced by eraseNode(), and NodeGraphPartIteratorSafe.
|
private |
code for clearing nodes (called twice)
Definition at line 237 of file nodeGraphPart.cpp.
References _boundVal_, _holes_, _inHoles_(), _names_, _updateEndIteratorSafe_(), bound(), GUM_EMIT1, and onNodeDeleted.
Referenced by clear(), clearNodes(), and NodeGraphPartIteratorSafe.
|
private |
clone the names bijection (returns nullptr when no name has been set)
Definition at line 389 of file nodeGraphPart_inl.h.
References _names_.
Referenced by NodeGraphPart(), and populateNodes().
|
private |
to delete hole.
Definition at line 255 of file nodeGraphPart_inl.h.
References _holes_.
Referenced by addNode(), addNodeWithId(), and NodeGraphPartIteratorSafe.
Definition at line 383 of file nodeGraphPart_inl.h.
References _holes_.
Referenced by _clearNodes_(), addNodeWithId(), asNodeSet(), existsNode(), NodeGraphPartIteratorSafe, and toString().
|
private |
Definition at line 386 of file nodeGraphPart_inl.h.
References _holes_.
Referenced by NodeGraphPartIteratorSafe.
|
private |
updating endIterator (always at max+1)
Definition at line 340 of file nodeGraphPart_inl.h.
References _boundVal_, and _endIteratorSafe_.
Referenced by NodeGraphPart(), NodeGraphPart(), NodeGraphPart(), _addHole_(), _clearNodes_(), addNode(), addNodeWithId(), NodeGraphPartIteratorSafe, operator=(), and populateNodes().
|
virtual |
insert a new node and return its id
Reimplemented in gum::CliqueGraph.
Definition at line 269 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_(), gum::prm::gspan::DFSTree< GUM_SCALAR >::addRoot(), and populateNodesFromProperty().
insert n nodes
| n | the number of nodes to add |
Definition at line 287 of file nodeGraphPart_inl.h.
Referenced by gum::DiGraph::completeGraph(), gum::UndiGraph::completeGraph(), and populateNodesFromProperty().
|
virtual |
try to insert a node with the given id
| DuplicateElement | exception if the id already exists |
Reimplemented in gum::CliqueGraph.
Definition at line 214 of file nodeGraphPart.cpp.
References _boundVal_, _eraseHole_(), _holes_, _holes_resize_policy_, _holes_size_, _inHoles_(), _updateEndIteratorSafe_(), GUM_EMIT1, GUM_ERROR, and onNodeAdded.
Referenced by gum::EssentialGraph::_buildEssentialGraph_(), gum::prm::GSpan< GUM_SCALAR >::_sortPatterns_(), gum::prm::gspan::Pattern::addNodeWithLabel(), gum::InfluenceDiagram< GUM_SCALAR >::getDecisionGraph(), gum::Separation::isForwardSeparated(), gum::learning::IBNLearner::learnDag_(), gum::learning::FCI::learnPAG(), gum::learning::SimpleMiic::learnStructure(), gum::graph::markovBlanket(), gum::UndiGraph::partialUndiGraph(), populateNodesFromProperty(), gum::learning::IBNLearner::prepareFCI_(), gum::learning::IBNLearner::prepareMiic_(), gum::learning::IBNLearner::preparePC_(), gum::MeekRules::propagateToCPDAG(), gum::MeekRules::propagateToDAG(), gum::learning::StructuralConstraintDAG::setGraphAlone(), gum::EssentialGraph::skeleton(), and gum::PAG::toMixedGraph().
| INLINE NodeSet gum::NodeGraphPart::asNodeSet | ( | ) | const |
returns a copy of the set of nodes represented by the NodeGraphPart
Definition at line 367 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(), gum::DoCalculus< GUM_SCALAR >::_ancestorsIn_(), populateNodesFromProperty(), and gum::ImportanceSampling< GUM_SCALAR >::unsharpenBN_().
|
noexcept |
a begin iterator to parse the set of nodes contained in the NodeGraphPart
Definition at line 346 of file nodeGraphPart_inl.h.
References NodeGraphPartIterator, and gum::NodeGraphPartIterator::validate_().
Referenced by gum::Estimator< GUM_SCALAR >::Estimator(), gum::learning::ConstraintBasedLearning::initGraph_(), populateNodesFromProperty(), and gum::Estimator< GUM_SCALAR >::setFromBN().
| INLINE NodeGraphPartIteratorSafe gum::NodeGraphPart::beginSafe | ( | ) | const |
a begin iterator to parse the set of nodes contained in the NodeGraphPart
Definition at line 334 of file nodeGraphPart_inl.h.
References NodeGraphPartIteratorSafe, and gum::NodeGraphPartIterator::validate_().
Referenced by populateNodesFromProperty().
| INLINE NodeId gum::NodeGraphPart::bound | ( | ) | const |
returns a number n such that all node ids are strictly lower than n
Definition at line 323 of file nodeGraphPart_inl.h.
References _boundVal_.
Referenced by _clearNodes_(), and populateNodesFromProperty().
|
virtual |
alias for clearNodes
Reimplemented in gum::CliqueGraph, gum::DiGraph, gum::MixedGraph, gum::PAG, and gum::UndiGraph.
Definition at line 332 of file nodeGraphPart_inl.h.
References _clearNodes_().
Referenced by populateNodes(), and populateNodesFromProperty().
|
virtual |
remove all the nodes from the NodeGraphPart
Definition at line 325 of file nodeGraphPart_inl.h.
References _clearNodes_().
Referenced by gum::DiGraph::clear(), gum::MixedGraph::clear(), gum::UndiGraph::clear(), gum::MixedGraph::operator=(), operator=(), and populateNodesFromProperty().
| std::string gum::NodeGraphPart::dotNodeLabel | ( | NodeId | id | ) | const |
returns " [label=\"...\"]" with DOT-escaped name, or "" if no name
Definition at line 188 of file nodeGraphPart.cpp.
References _names_, and hasName().
Referenced by populateNodesFromProperty(), gum::DiGraph::toDot(), gum::MixedGraph::toDot(), gum::PAG::toDot(), gum::PDAG::toDot(), and gum::UndiGraph::toDot().
| INLINE bool gum::NodeGraphPart::empty | ( | ) | const |
alias for emptyNodes
Definition at line 321 of file nodeGraphPart_inl.h.
References emptyNodes().
Referenced by asNodeSet(), populateNodesFromProperty(), gum::prm::gspan::Pattern::remove(), and gum::PDAG::toDot().
| INLINE bool gum::NodeGraphPart::emptyNodes | ( | ) | const |
indicates whether there exists nodes in the NodeGraphPart
Definition at line 319 of file nodeGraphPart_inl.h.
References sizeNodes().
Referenced by empty(), and populateNodesFromProperty().
|
noexcept |
the end iterator to parse the set of nodes contained in the NodeGraphPart
Definition at line 352 of file nodeGraphPart_inl.h.
References _endIteratorSafe_, and NodeGraphPartIterator.
Referenced by gum::Estimator< GUM_SCALAR >::Estimator(), gum::learning::ConstraintBasedLearning::initGraph_(), populateNodesFromProperty(), and gum::Estimator< GUM_SCALAR >::setFromBN().
|
noexcept |
the end iterator to parse the set of nodes contained in the NodeGraphPart
Definition at line 342 of file nodeGraphPart_inl.h.
References _endIteratorSafe_, and NodeGraphPartIteratorSafe.
Referenced by populateNodesFromProperty().
|
virtual |
erase the node with the given id
If the NodeGraphPart does not contain the nodeId, then nothing is done. In particular, no exception is raised. However, the signal onNodeDeleted is fired only if a node is effectively removed.
Reimplemented in gum::CliqueGraph, gum::DiGraph, gum::MixedGraph, gum::PAG, and gum::UndiGraph.
Definition at line 309 of file nodeGraphPart_inl.h.
References _addHole_(), _names_, existsNode(), GUM_EMIT1, and onNodeDeleted.
Referenced by gum::DiGraph::eraseNode(), gum::MixedGraph::eraseNode(), gum::UndiGraph::eraseNode(), and populateNodesFromProperty().
alias for existsNode
Definition at line 307 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::learning::IBNLearner::learnDag_(), and populateNodesFromProperty().
returns true iff the NodeGraphPart contains the given nodeId
Definition at line 301 of file nodeGraphPart_inl.h.
References _boundVal_, and _inHoles_().
Referenced by eraseNode(), gum::PAG::eraseNode(), exists(), gum::InfluenceDiagram< GUM_SCALAR >::getDecisionGraph(), gum::Separation::isForwardSeparated(), gum::graph::markovBlanket(), gum::graph::moralizedAncestralGraph(), gum::UndiGraph::partialUndiGraph(), populateNodesFromProperty(), gum::Separation::reduceForDSeparation(), and setName().
returns true iff node id has an explicit name
Definition at line 186 of file nodeGraphPart.cpp.
References _names_.
Referenced by dotNodeLabel(), and populateNodesFromProperty().
| std::optional< NodeId > gum::NodeGraphPart::idFromName | ( | const std::string & | name | ) | const |
returns the id of the node with the given name, or std::nullopt
Definition at line 165 of file nodeGraphPart.cpp.
References _names_.
Referenced by populateNodesFromProperty().
| List< VAL > gum::NodeGraphPart::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))
| f | a function assigning a VAL to any node |
References listMapNodes().
Referenced by listMapNodes().
| std::string gum::NodeGraphPart::nameFromId | ( | NodeId | id | ) | const |
returns the name of node id, or "<id>" if no name is set
Definition at line 160 of file nodeGraphPart.cpp.
References _names_.
Referenced by populateNodesFromProperty().
| INLINE NodeId gum::NodeGraphPart::nextNodeId | ( | ) | const |
returns a new node id, not yet used by any node
Definition at line 243 of file nodeGraphPart_inl.h.
References _boundVal_, and _holes_.
Referenced by populateNodesFromProperty().
| INLINE const NodeGraphPart & gum::NodeGraphPart::nodes | ( | ) | const |
return *this as a NodeGraphPart
Definition at line 379 of file nodeGraphPart_inl.h.
References NodeGraphPart().
Referenced by gum::DoCalculus< GUM_SCALAR >::_ancestorsIn_(), 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::prm::GSpan< GUM_SCALAR >::_sortPatterns_(), gum::prm::PRMFactory< GUM_SCALAR >::addAttribute(), gum::DoorCriteria::enumerateBackdoorSets(), gum::learning::ConstraintBasedLearning::initGraph_(), gum::learning::FCI::learnPAG(), gum::DAG::moralizedAncestralGraph(), gum::graph::moralizedAncestralGraph(), gum::PDAG::moralizedAncestralGraph(), gum::prm::gspan::Pattern::nodes(), operator<<(), gum::learning::ConstraintBasedLearning::orientDoubleHeadedArcs_(), gum::UndiGraph::partialUndiGraph(), populateNodesFromProperty(), gum::learning::IBNLearner::prepareFCI_(), gum::learning::IBNLearner::prepareMiic_(), gum::learning::IBNLearner::preparePC_(), gum::learning::FCI::ruleR10_(), gum::learning::FCI::ruleR1_(), gum::learning::FCI::ruleR2_(), gum::learning::FCI::ruleR3_(), gum::learning::FCI::ruleR4_(), gum::learning::FCI::ruleR5_(), gum::learning::FCI::ruleR6_(), gum::learning::FCI::ruleR7_(), gum::learning::FCI::ruleR8_(), gum::learning::FCI::ruleR9_(), gum::DiGraph::toDot(), gum::MixedGraph::toDot(), gum::PAG::toDot(), gum::PDAG::toDot(), gum::UndiGraph::toDot(), and gum::PAG::toMixedGraph().
| NodeProperty< VAL > gum::NodeGraphPart::nodesPropertyFromFunction | ( | VAL(* | f )(const NodeId &), |
| Size | size = 0 ) const |
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().
| NodeProperty< VAL > gum::NodeGraphPart::nodesPropertyFromVal | ( | const VAL & | a, |
| Size | size = 0 ) const |
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(), and nodesPropertyFromVal().
| INLINE NodeGraphPart & gum::NodeGraphPart::operator= | ( | const NodeGraphPart & | p | ) |
copy operator
| p | the NodeGraphPart to be copied |
Definition at line 220 of file nodeGraphPart_inl.h.
References NodeGraphPart(), and populateNodes().
Referenced by gum::DiGraph::operator=(), gum::DiGraph::operator=(), gum::MixedGraph::operator=(), gum::MixedGraph::operator=(), gum::UndiGraph::operator=(), and gum::UndiGraph::operator=().
| INLINE NodeGraphPart & gum::NodeGraphPart::operator= | ( | NodeGraphPart && | p | ) |
move assignment operator
Definition at line 227 of file nodeGraphPart_inl.h.
References NodeGraphPart(), _boundVal_, _holes_, _holes_resize_policy_, _holes_size_, _names_, _updateEndIteratorSafe_(), and clearNodes().
| INLINE bool gum::NodeGraphPart::operator== | ( | const NodeGraphPart & | p | ) | const |
check whether two NodeGraphParts contain the same nodes
| p | the NodeGraphPart to be compared with "this" |
Definition at line 356 of file nodeGraphPart_inl.h.
References NodeGraphPart(), _boundVal_, and _holes_.
Referenced by gum::DiGraph::operator==(), gum::MixedGraph::operator==(), and gum::UndiGraph::operator==().
| void gum::NodeGraphPart::populateNodes | ( | const NodeGraphPart & | s | ) |
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 97 of file nodeGraphPart.cpp.
References NodeGraphPart(), _boundVal_, _cloneNames_(), _holes_, _holes_resize_policy_, _holes_size_, _names_, _updateEndIteratorSafe_(), and clear().
Referenced by operator=().
| void gum::NodeGraphPart::populateNodesFromProperty | ( | const NodeProperty< T > & | h | ) |
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(), addNode(), addNodes(), addNodeWithId(), asNodeSet(), begin(), beginSafe(), bound(), clear(), clearNodes(), dotNodeLabel(), empty(), emptyNodes(), end(), endSafe(), eraseNode(), exists(), existsNode(), hasName(), idFromName(), nameFromId(), nextNodeId(), nodes(), setName(), size(), sizeNodes(), and toString().
| void gum::NodeGraphPart::setName | ( | NodeId | id, |
| const std::string & | name ) |
sets the name of node id
| DuplicateElement | if name is already used by another node |
Definition at line 170 of file nodeGraphPart.cpp.
References _names_, existsNode(), and GUM_ERROR.
Referenced by gum::GraphicalModel::_nameNodes_(), gum::CausalModel< GUM_SCALAR >::causalDAG(), populateNodesFromProperty(), and gum::EssentialGraph::skeleton().
| INLINE Size gum::NodeGraphPart::size | ( | ) | const |
alias for sizeNodes
Definition at line 299 of file nodeGraphPart_inl.h.
References sizeNodes().
Referenced by gum::StaticTriangulation::StaticTriangulation(), gum::prm::gspan::DFSTree< GUM_SCALAR >::_addChild_(), gum::StaticTriangulation::_triangulate_(), nodesPropertyFromFunction(), nodesPropertyFromVal(), populateNodesFromProperty(), gum::BayesBall::relevantTensors(), gum::dSeparationAlgorithm::relevantTensors(), gum::dSeparationAlgorithm::requisiteNodes(), gum::prm::gspan::Pattern::size(), and gum::UndiGraph::toDot().
| INLINE Size gum::NodeGraphPart::sizeNodes | ( | ) | const |
returns the number of nodes in the NodeGraphPart
Definition at line 295 of file nodeGraphPart_inl.h.
References _boundVal_, and _holes_.
Referenced by gum::BinaryJoinTreeConverterDefault::_markConnectedComponent_(), asNodeSet(), gum::BinaryJoinTreeConverterDefault::convert(), emptyNodes(), populateNodesFromProperty(), and size().
|
virtual |
a function to display the set of nodes
Reimplemented in gum::CliqueGraph, gum::DiGraph, gum::MixedGraph, gum::PAG, and gum::UndiGraph.
Definition at line 140 of file nodeGraphPart.cpp.
References _boundVal_, _inHoles_(), and _names_.
Referenced by gum::operator<<(), populateNodesFromProperty(), gum::DiGraph::toString(), gum::MixedGraph::toString(), gum::PAG::toString(), and gum::UndiGraph::toString().
|
friend |
Definition at line 490 of file nodeGraphPart.h.
References NodeGraphPartIterator.
Referenced by begin(), end(), and NodeGraphPartIterator.
|
friend |
Definition at line 491 of file nodeGraphPart.h.
References _addHole_(), _clearNodes_(), _eraseHole_(), _inHoles_(), _sizeHoles_(), _updateEndIteratorSafe_(), and NodeGraphPartIteratorSafe.
Referenced by beginSafe(), endSafe(), and NodeGraphPartIteratorSafe.
|
private |
the id below which NodeIds may belong to the NodeGraphPart
Definition at line 540 of file nodeGraphPart.h.
Referenced by NodeGraphPart(), NodeGraphPart(), NodeGraphPart(), _addHole_(), _clearNodes_(), _updateEndIteratorSafe_(), addNode(), addNodeWithId(), asNodeSet(), bound(), existsNode(), nextNodeId(), operator=(), operator==(), populateNodes(), sizeNodes(), and toString().
|
private |
the end iterator (used to speed-up parsings of the NodeGraphPart)
Definition at line 537 of file nodeGraphPart.h.
Referenced by NodeGraphPart(), NodeGraphPart(), NodeGraphPart(), _updateEndIteratorSafe_(), end(), and endSafe().
|
private |
the set of nodes not contained in the NodeGraphPart in the interval 1.
. max
Definition at line 523 of file nodeGraphPart.h.
Referenced by NodeGraphPart(), NodeGraphPart(), NodeGraphPart(), ~NodeGraphPart(), _addHole_(), _clearNodes_(), _eraseHole_(), _inHoles_(), _sizeHoles_(), addNode(), addNodeWithId(), nextNodeId(), operator=(), operator==(), populateNodes(), and sizeNodes().
|
private |
value for holes configuration
Definition at line 534 of file nodeGraphPart.h.
Referenced by NodeGraphPart(), NodeGraphPart(), NodeGraphPart(), _addHole_(), addNodeWithId(), operator=(), and populateNodes().
|
private |
value for holes configuration
Definition at line 531 of file nodeGraphPart.h.
Referenced by NodeGraphPart(), NodeGraphPart(), NodeGraphPart(), _addHole_(), addNodeWithId(), operator=(), and populateNodes().
optional node names — null when no name has been set
Definition at line 526 of file nodeGraphPart.h.
Referenced by NodeGraphPart(), NodeGraphPart(), _clearNodes_(), _cloneNames_(), dotNodeLabel(), eraseNode(), hasName(), idFromName(), nameFromId(), operator=(), populateNodes(), setName(), and toString().
Definition at line 281 of file nodeGraphPart.h.
Referenced by addNode(), and addNodeWithId().
Definition at line 282 of file nodeGraphPart.h.
Referenced by _clearNodes_(), and eraseNode().