![]() |
aGrUM 2.3.2
a C++ library for (probabilistic) graphical models
|
Representation of a set. More...
#include <agrum/base/core/set.h>
Public Types | |
| using | value_type = Key |
| Types for STL compliance. | |
| using | reference = Key& |
| Types for STL compliance. | |
| using | const_reference = const Key& |
| Types for STL compliance. | |
| using | pointer = Key* |
| Types for STL compliance. | |
| using | const_pointer = const Key* |
| Types for STL compliance. | |
| using | size_type = std::size_t |
| Types for STL compliance. | |
| using | difference_type = std::ptrdiff_t |
| Types for STL compliance. | |
| using | iterator = SetIterator< Key > |
| Types for STL compliance. | |
| using | const_iterator = SetIterator< Key > |
| Types for STL compliance. | |
| using | iterator_safe = SetIteratorSafe< Key > |
| Types for STL compliance. | |
| using | const_iterator_safe = SetIteratorSafe< Key > |
| Types for STL compliance. | |
Public Member Functions | |
| template<typename... Args> | |
| INLINE void | emplace (Args &&... args) |
Constructors / Destructors | |
| Set (Size capacity=HashTableConst::default_size, bool resize_policy=true) | |
| Default constructor. | |
| Set (std::initializer_list< Key > list) | |
| Initializer list constructor. | |
| Set (const Set< Key > &aHT) | |
| Copy constructor. | |
| Set (Set< Key > &&aHT) | |
| Move constructor. | |
| ~Set () | |
| Class destructor. | |
Operators | |
| Set< Key > & | operator= (const Set< Key > &from) |
| Copy operator. | |
| Set< Key > & | operator= (Set< Key > &&from) |
| Move operator. | |
| bool | operator== (const Set< Key > &s2) const |
| Mathematical equality between two sets. | |
| bool | operator!= (const Set< Key > &s2) const |
| Mathematical inequality between two sets. | |
| const Set< Key > & | operator*= (const Set< Key > &s2) |
| Intersection update operator. | |
| Set< Key > | operator* (const Set< Key > &s2) const |
| Intersection operator. | |
| const Set< Key > & | operator+= (const Set< Key > &s2) |
| Union update operator. | |
| Set< Key > | operator+ (const Set< Key > &s2) const |
| Union operator. | |
| Set< Key > | operator- (const Set< Key > &s2) const |
| Disjunction operator. | |
| Set< Key > & | operator<< (const Key &k) |
| Adds a new element to the set (alias for insert). | |
| Set< Key > & | operator<< (Key &&k) |
| Adds a new element to the set (alias for insert). | |
| Set< Key > & | operator>> (const Key &k) |
| Removes an element from the set (alias for erase). | |
Accessors / Modifiers | |
| void | insert (const Key &k) |
| Inserts a new element into the set. | |
| void | insert (Key &&k) |
| Inserts a new element into the set. | |
| template<typename... Args> | |
| void | emplace (Args &&... args) |
| Emplace a new element in the set. | |
| void | erase (const Key &k) |
| Erases an element from the set. | |
| Key | popFirst () |
| Removes and returns an arbitrary element from the set. | |
| void | erase (const iterator_safe &k) |
| Erases an element from the set. | |
| void | clear () |
| Removes all the elements, if any, from the set. | |
| Size | size () const noexcept |
| Returns the number of elements in the set. | |
| bool | contains (const Key &k) const |
| Indicates whether a given elements belong to the set. | |
| bool | isStrictSubsetOf (const Set< Key > &s) const |
| bool | isStrictSupersetOf (const Set< Key > &s) const |
| bool | isSubsetOrEqual (const Set< Key > &s) const |
| bool | isSupersetOrEqual (const Set< Key > &s) const |
| bool | exists (const Key &k) const |
| Indicates whether a given elements belong to the set. | |
| bool | empty () const noexcept |
| Indicates whether the set is the empty set. | |
| std::string | toString () const |
| Prints the content of the set. | |
Iterators | |
| iterator_safe | beginSafe () const |
| The usual safe begin iterator to parse the set. | |
| const_iterator_safe | cbeginSafe () const |
| The usual safe begin iterator to parse the set. | |
| const iterator_safe & | endSafe () const noexcept |
| The usual safe end iterator to parse the set. | |
| const const_iterator_safe & | cendSafe () const noexcept |
| The usual safe end iterator to parse the set. | |
| iterator | begin () const |
| The usual unsafe begin iterator to parse the set. | |
| const_iterator | cbegin () const |
| The usual unsafe begin iterator to parse the set. | |
| const iterator & | end () const noexcept |
| The usual unsafe end iterator to parse the set. | |
| const const_iterator & | cend () const noexcept |
| The usual unsafe end iterator to parse the set. | |
Fine tuning | |
| Size | capacity () const |
| Returns the capacity of the underlying hash table containing the set. | |
| void | resize (Size new_capacity) |
| Changes the size of the underlying hash table containing the set. | |
| void | setResizePolicy (const bool new_policy) |
| Enables the user to change dynamically the resizing policy of the underlying hash table. | |
| bool | resizePolicy () const |
| Returns the current resizing policy of the underlying hash table. | |
Mapper | |
| template<typename NewKey> | |
| HashTable< Key, NewKey > | hashMap (NewKey(*f)(const Key &), Size capacity=0) const |
| Creates a hashtable of NewKey from the set. | |
| template<typename NewKey> | |
| HashTable< Key, NewKey > | hashMap (const NewKey &val, Size size=0) const |
| Creates a hash table of NewKey from the set. | |
| template<typename NewKey> | |
| List< NewKey > | listMap (NewKey(*f)(const Key &)) const |
| A method to create a List of NewKey from the set. | |
Private Member Functions | |
| Set (const HashTable< Key, bool > &h) | |
| Convert a hash table into a set of keys. | |
Private Attributes | |
| HashTable< Key, bool > | _inside_ |
| A set of X's is actually a hash table whose keys are the X's. | |
Friends | |
| class | SetIterator< Key > |
| Friends to speed up access. | |
| class | SetIteratorSafe< Key > |
| Friends to speed up access. | |
Representation of a set.
A Set is a structure that contains arbitrary elements. Note that, as in mathematics, an element cannot appear twice in a given set. Sets have unsafe and safe iterators. The safe iterators (SetIteratorSafe<> a.k.a. Set<>::iterator_safe are slightly slower than the unsafe ones (SetIterator<> a.k.a. Set<>::iterator) but they guarantee that even if they point to a deleted element, using their operators ++ or * cannot produce a segfault. In such cases, they simply raise an exception. On the contrary, unsafe iterators should never be used on elements that can be deleted because, as in the STL, they will most probably produce a segfault.
| Key | The elements type. |
| using gum::Set< Key >::const_iterator = SetIterator< Key > |
| using gum::Set< Key >::const_iterator_safe = SetIteratorSafe< Key > |
| using gum::Set< Key >::const_pointer = const Key* |
| using gum::Set< Key >::const_reference = const Key& |
| using gum::Set< Key >::difference_type = std::ptrdiff_t |
| using gum::Set< Key >::iterator = SetIterator< Key > |
| using gum::Set< Key >::iterator_safe = SetIteratorSafe< Key > |
| using gum::Set< Key >::pointer = Key* |
| using gum::Set< Key >::reference = Key& |
| using gum::Set< Key >::size_type = std::size_t |
| using gum::Set< Key >::value_type = Key |
|
explicit |
Default constructor.
Sets rely on hashtables to store their items. The optional parameters of this constructor enable a fine memory management of these hashtables.
| capacity | The number of slots allocated to the hashtable (see the HashTable default constructor) |
| resize_policy | Enables the hashtable to resize itself automatically when its number of elements is sufficiently high that it induces slow retrievals of elements. |
Definition at line 300 of file set_tpl.h.
References Set(), _inside_, and capacity().
Referenced by Set(), Set(), Set(), Set(), isStrictSubsetOf(), isStrictSupersetOf(), isSubsetOrEqual(), isSupersetOrEqual(), operator!=(), operator*(), operator*=(), operator+(), operator+=(), operator-(), operator<<(), operator<<(), operator=(), operator=(), operator==(), and operator>>().
| INLINE gum::Set< Key >::Set | ( | std::initializer_list< Key > | list | ) |
Initializer list constructor.
| list | The initializer list. |
Definition at line 310 of file set_tpl.h.
References Set(), _inside_, insert(), and size().
| INLINE gum::Set< Key >::Set | ( | const Set< Key > & | aHT | ) |
| INLINE gum::Set< Key >::Set | ( | Set< Key > && | aHT | ) |
Convert a hash table into a set of keys.
| INLINE Set< Key >::iterator gum::Set< Key >::begin | ( | ) | const |
The usual unsafe begin iterator to parse the set.
Definition at line 438 of file set_tpl.h.
References SetIterator< Key >.
Referenced by gum::StaticTriangulation::_computeMaxPrimeMergings_(), gum::MeekRules::_orientDoubleHeadedArcs_(), gum::MeekRules::_propagatesOrientationInChainOfRemainingEdges_(), gum::StaticTriangulation::_triangulate_(), gum::ArcGraphPart::ancestors(), gum::BarrenNodesFinder::barrenNodes(), gum::MixedGraph::chainComponent(), gum::ArcGraphPart::descendants(), gum::prm::eliminateNode(), gum::EdgeGraphPart::hasUndirectedPath(), gum::EdgeGraphPart::hasUndirectedPath(), gum::EdgeGraphPart::hasUndirectedPath(), gum::DAG::moralizedAncestralGraph(), gum::learning::Miic::orientDoubleHeadedArcs_(), popFirst(), gum::prm::StructuredInference< GUM_SCALAR >::posterior_(), and gum::learning::SimpleMiic::propagatesOrientationInChainOfRemainingEdges_().
| INLINE Set< Key >::iterator_safe gum::Set< Key >::beginSafe | ( | ) | const |
The usual safe begin iterator to parse the set.
Definition at line 414 of file set_tpl.h.
References SetIteratorSafe< Key >.
Referenced by gum::IMDDI< AttributeSelection, isScalar >::_updateNodeSet_(), gum::LeafAggregator::addLeaf(), gum::BarrenNodesFinder::barrenNodes(), gum::EdgeGraphPart::eraseNeighbours(), gum::LeafAggregator::removeLeaf(), gum::VariableSelector::select(), gum::EdgeGraphPart::unvirtualizedEraseNeighbours(), gum::IMDDI< AttributeSelection, isScalar >::updateGraph(), and gum::LeafAggregator::updateLeaf().
Returns the capacity of the underlying hash table containing the set.
The method runs in constant time.
Definition at line 462 of file set_tpl.h.
References _inside_.
Referenced by Set().
| INLINE Set< Key >::const_iterator gum::Set< Key >::cbegin | ( | ) | const |
The usual unsafe begin iterator to parse the set.
Definition at line 444 of file set_tpl.h.
References SetIterator< Key >.
| INLINE Set< Key >::const_iterator_safe gum::Set< Key >::cbeginSafe | ( | ) | const |
The usual safe begin iterator to parse the set.
Definition at line 420 of file set_tpl.h.
References SetIteratorSafe< Key >.
Referenced by gum::NodeDatabase< AttributeSelection, isScalar >::NodeDatabase(), and gum::IncrementalGraphLearner< AttributeSelection, isScalar >::updateNode_().
|
noexcept |
The usual unsafe end iterator to parse the set.
Definition at line 456 of file set_tpl.h.
References SetIterator< Key >.
|
noexcept |
The usual safe end iterator to parse the set.
Definition at line 432 of file set_tpl.h.
References SetIteratorSafe< Key >.
Referenced by gum::NodeDatabase< AttributeSelection, isScalar >::NodeDatabase(), and gum::IncrementalGraphLearner< AttributeSelection, isScalar >::updateNode_().
| INLINE void gum::Set< Key >::clear | ( | ) |
Removes all the elements, if any, from the set.
Definition at line 338 of file set_tpl.h.
References _inside_.
Referenced by gum::MeekRules::_propagatesOrientationInChainOfRemainingEdges_(), gum::IMDDI< AttributeSelection, isScalar >::_updateNodeSet_(), gum::JointTargetedInference< GUM_SCALAR >::jointMutualInformation(), gum::JointTargetedMRFInference< GUM_SCALAR >::jointMutualInformation(), gum::learning::SimpleMiic::propagatesOrientationInChainOfRemainingEdges_(), gum::BayesBall::requisiteNodes(), gum::dSeparationAlgorithm::requisiteNodes(), gum::ITI< AttributeSelection, isScalar >::updateGraph(), and gum::LeafAggregator::updateLeaf().
Indicates whether a given elements belong to the set.
Definition at line 497 of file set_tpl.h.
Referenced by gum::StaticTriangulation::_computeMaxPrimeJunctionTree_(), gum::BayesNet< double >::_copyTensors_(), gum::prm::SVE< GUM_SCALAR >::_initElimOrder_(), gum::prm::SVED< GUM_SCALAR >::_initElimOrder_(), gum::IMarkovRandomField< GUM_SCALAR >::_minimalCondSetVisit_(), gum::DAG::_minimalCondSetVisitDn_(), gum::DAG::_minimalCondSetVisitUp_(), gum::MeekRules::_orientDoubleHeadedArcs_(), gum::MeekRules::_propagatesOrientationInChainOfRemainingEdges_(), gum::ArcGraphPart::ancestors(), gum::Tensor< GUM_SCALAR >::complementVars_(), gum::ArcGraphPart::descendants(), gum::MarginalTargetedInference< GUM_SCALAR >::evidenceImpact(), gum::MarginalTargetedMRFInference< GUM_SCALAR >::evidenceImpact(), gum::Tensor< GUM_SCALAR >::fillWith(), gum::InfluenceDiagram< GUM_SCALAR >::getPartialTemporalOrder(), gum::DiGraph::hasDirectedPath(), gum::Set< const gum::Observation * >::hashMap(), gum::EdgeGraphPart::hasUndirectedPath(), gum::EdgeGraphPart::hasUndirectedPath(), gum::EdgeGraphPart::hasUndirectedPath(), insert(), insert(), isStrictSubsetOf(), gum::learning::SimpleMiic::learnStructure(), gum::DAG::minimalCondSet(), gum::IMarkovRandomField< GUM_SCALAR >::minimalCondSet(), gum::PDAG::moralGraph(), gum::DAG::moralizedAncestralGraph(), gum::learning::Miic::orientDoubleHeadedArcs_(), gum::O3prmBNReader< GUM_SCALAR >::proceed(), gum::learning::SimpleMiic::propagatesOrientationInChainOfRemainingEdges_(), gum::rec_hasMixedReallyOrientedPath(), gum::Estimator< GUM_SCALAR >::setFromBN(), and gum::Estimator< GUM_SCALAR >::setFromLBP().
Emplace a new element in the set.
Emplace is a method that allows to construct directly an element of type Key by passing to its constructor all the arguments it needs.
| args | the arguments passed to the constructor |
| INLINE void gum::Set< Key >::emplace | ( | Args &&... | args | ) |
Indicates whether the set is the empty set.
Definition at line 642 of file set_tpl.h.
References _inside_.
Referenced by gum::MeekRules::_complete_(), gum::prm::SVE< GUM_SCALAR >::_eliminateNodesDownward_(), gum::prm::SVE< GUM_SCALAR >::_initElimOrder_(), gum::prm::SVED< GUM_SCALAR >::_initElimOrder_(), gum::MeekRules::_orientDoubleHeadedArcs_(), gum::MeekRules::_propagates_(), gum::MeekRules::_propagatesOrientationInChainOfRemainingEdges_(), gum::learning::Miic::_propagatingOrientationMiic_(), gum::learning::SimpleMiic::_propagatingOrientationMiic_(), gum::VariableSelector::_removeVar_(), gum::ArcGraphPart::ancestors(), gum::MixedGraph::chainComponent(), gum::ArcGraphPart::descendants(), gum::InfluenceDiagram< GUM_SCALAR >::getPartialTemporalOrder(), gum::EdgeGraphPart::hasUndirectedPath(), gum::EdgeGraphPart::hasUndirectedPath(), gum::EdgeGraphPart::hasUndirectedPath(), gum::credal::CNLoopyPropagation< GUM_SCALAR >::initialize_(), gum::JointTargetedInference< GUM_SCALAR >::jointPosterior(), gum::JointTargetedMRFInference< GUM_SCALAR >::jointPosterior(), gum::learning::SimpleMiic::learnPDAG(), gum::learning::SimpleMiic::learnStructure(), gum::Tensor< GUM_SCALAR >::maxIn(), gum::Tensor< GUM_SCALAR >::minIn(), gum::DAG::moralizedAncestralGraph(), gum::credal::CNLoopyPropagation< GUM_SCALAR >::msgL_(), gum::learning::Miic::orientDoubleHeadedArcs_(), popFirst(), gum::learning::IBNLearner::prepareMiic_(), gum::Tensor< GUM_SCALAR >::prodIn(), gum::learning::SimpleMiic::propagatesOrientationInChainOfRemainingEdges_(), gum::credal::CNLoopyPropagation< GUM_SCALAR >::refreshLMsPIs_(), gum::prm::PRMFactory< GUM_SCALAR >::startClass(), gum::Tensor< GUM_SCALAR >::sumIn(), and gum::IncrementalGraphLearner< AttributeSelection, isScalar >::updateNode_().
|
noexcept |
The usual unsafe end iterator to parse the set.
Definition at line 450 of file set_tpl.h.
References SetIterator< Key >.
Referenced by gum::StaticTriangulation::_computeMaxPrimeMergings_(), and gum::StaticTriangulation::_triangulate_().
|
noexcept |
The usual safe end iterator to parse the set.
Definition at line 426 of file set_tpl.h.
References SetIteratorSafe< Key >.
Referenced by gum::IMDDI< AttributeSelection, isScalar >::_updateNodeSet_(), gum::LeafAggregator::addLeaf(), gum::BarrenNodesFinder::barrenNodes(), gum::EdgeGraphPart::eraseNeighbours(), gum::LeafAggregator::removeLeaf(), gum::VariableSelector::select(), gum::EdgeGraphPart::unvirtualizedEraseNeighbours(), gum::IMDDI< AttributeSelection, isScalar >::updateGraph(), and gum::LeafAggregator::updateLeaf().
| INLINE void gum::Set< Key >::erase | ( | const iterator_safe & | k | ) |
Erases an element from the set.
| k | The iterator pointing to the element to remove. |
Definition at line 603 of file set_tpl.h.
References gum::SetIteratorSafe< Key >::_ht_iter_, _inside_, and SetIteratorSafe< Key >.
| INLINE void gum::Set< Key >::erase | ( | const Key & | k | ) |
Erases an element from the set.
| k | The element to remove. |
Definition at line 582 of file set_tpl.h.
References _inside_.
Referenced by gum::prm::StructuredInference< GUM_SCALAR >::CData::CData(), gum::prm::StructuredInference< GUM_SCALAR >::_buildPatternGraph_(), gum::prm::StructuredInference< GUM_SCALAR >::_buildReduceGraph_(), gum::prm::gspan::StrictSearch< GUM_SCALAR >::_elimination_cost_(), gum::prm::SVE< GUM_SCALAR >::_initLiftedNodes_(), gum::prm::SVED< GUM_SCALAR >::_initLiftedNodes_(), gum::MeekRules::_orientDoubleHeadedArcs_(), gum::MeekRules::_propagatesOrientationInChainOfRemainingEdges_(), gum::prm::StructuredInference< GUM_SCALAR >::_removeNode_(), gum::ArcGraphPart::ancestors(), gum::BarrenNodesFinder::barrenNodes(), gum::MixedGraph::chainComponent(), gum::ArcGraphPart::descendants(), gum::InfluenceDiagram< GUM_SCALAR >::getPartialTemporalOrder(), gum::EdgeGraphPart::hasUndirectedPath(), gum::EdgeGraphPart::hasUndirectedPath(), gum::EdgeGraphPart::hasUndirectedPath(), gum::DAG::moralizedAncestralGraph(), operator>>(), gum::learning::Miic::orientDoubleHeadedArcs_(), popFirst(), gum::learning::SimpleMiic::propagatesOrientationInChainOfRemainingEdges_(), gum::BayesBall::relevantTensors(), gum::dSeparationAlgorithm::relevantTensors(), and gum::ITI< AttributeSelection, isScalar >::updateGraph().
Indicates whether a given elements belong to the set.
Definition at line 533 of file set_tpl.h.
References _inside_.
Referenced by gum::prm::StructuredBayesBall< GUM_SCALAR >::_buildHashKey_(), gum::prm::StructuredInference< GUM_SCALAR >::_buildPatternGraph_(), gum::BinaryJoinTreeConverterDefault::_combinedSize_(), gum::MCBayesNetGenerator< GUM_SCALAR, ICPTGenerator, ICPTDisturber >::_connect_(), gum::MCBayesNetGenerator< GUM_SCALAR, ICPTGenerator, ICPTDisturber >::_directedPath_(), gum::prm::SVE< GUM_SCALAR >::_eliminateNodes_(), gum::prm::SVED< GUM_SCALAR >::_eliminateNodes_(), gum::prm::SVE< GUM_SCALAR >::_eliminateNodesWithEvidence_(), gum::learning::Miic::_existsDirectedPath_(), gum::learning::SimpleMiic::_existsDirectedPath_(), gum::MeekRules::_existsDirectedPath_(), gum::prm::gspan::DFSTree< GUM_SCALAR >::_initialiaze_root_(), gum::prm::SVE< GUM_SCALAR >::_initLiftedNodes_(), gum::prm::SVED< GUM_SCALAR >::_initLiftedNodes_(), gum::prm::StructuredInference< GUM_SCALAR >::_insertNodeInElimLists_(), gum::MCBayesNetGenerator< GUM_SCALAR, ICPTGenerator, ICPTDisturber >::_is_connected_(), gum::prm::StructuredInference< GUM_SCALAR >::_reducePattern_(), gum::prm::StructuredInference< GUM_SCALAR >::_removeBarrenNodes_(), gum::prm::StructuredInference< GUM_SCALAR >::_removeNode_(), gum::DAGCycleDetector::_restrictWeightedSet_(), gum::prm::GSpan< GUM_SCALAR >::_sortPatterns_(), gum::prm::SVE< GUM_SCALAR >::_variableElimination_(), gum::BarrenNodesFinder::barrenNodes(), gum::MixedGraph::chainComponent(), gum::PDAG::cSeparation(), gum::DAG::dSeparation(), gum::prm::gspan::DFSTree< GUM_SCALAR >::growPattern(), gum::DAGmodel::hasSameStructure(), gum::MarkovBlanket::hasSameStructure(), gum::UGmodel::hasSameStructure(), gum::StructuredPlaner< double >::initialize(), gum::Tensor< GUM_SCALAR >::maxOut(), gum::Tensor< GUM_SCALAR >::minOut(), gum::Tensor< GUM_SCALAR >::prodOut(), gum::BayesBall::relevantTensors(), gum::dSeparationAlgorithm::relevantTensors(), gum::BayesBall::requisiteNodes(), gum::dSeparationAlgorithm::requisiteNodes(), gum::Tensor< GUM_SCALAR >::sumOut(), gum::MixedGraph::toDot(), and gum::IncrementalGraphLearner< AttributeSelection, isScalar >::updateNode_().
| HashTable< Key, NewKey > gum::Set< Key >::hashMap | ( | const NewKey & | val, |
| Size | size = 0 ) const |
Creates a hash table of NewKey from the set.
| val | The value taken by all the elements of the resulting hashtable. |
| size | The size of the resulting hash table. When equal to 0, a default size is computed that is a good trade-off between space consumption and efficiency of new elements insertions. |
Definition at line 774 of file set_tpl.h.
References _inside_, gum::HashTable< Key, Val >::insert(), and size().
| HashTable< Key, NewKey > gum::Set< Key >::hashMap | ( | NewKey(* | f )(const Key &), |
| Size | capacity = 0 ) const |
Creates a hashtable of NewKey from the set.
| f | A function that maps Key into a NewKey |
| capacity | The size of the resulting hashtable. When equal to 0, a default size is computed that is a good trade-off between space consumption and efficiency of new elements insertions. |
Definition at line 753 of file set_tpl.h.
References size().
| INLINE void gum::Set< Key >::insert | ( | const Key & | k | ) |
Inserts a new element into the set.
| k | The new element to insert. |
Definition at line 539 of file set_tpl.h.
References _inside_, and contains().
Referenced by gum::prm::StructuredInference< GUM_SCALAR >::CData::CData(), Set(), gum::prm::StructuredInference< GUM_SCALAR >::_addEdgesInReducedGraph_(), gum::prm::gspan::StrictSearch< GUM_SCALAR >::_buildPatternGraph_(), gum::prm::StructuredInference< GUM_SCALAR >::_buildPatternGraph_(), gum::prm::StructuredInference< GUM_SCALAR >::_buildReduceGraph_(), gum::StaticTriangulation::_computeRecursiveThinning_(), gum::MCBayesNetGenerator< GUM_SCALAR, ICPTGenerator, ICPTDisturber >::_connect_(), gum::BayesNet< double >::_copyTensors_(), gum::MCBayesNetGenerator< GUM_SCALAR, ICPTGenerator, ICPTDisturber >::_directedPath_(), gum::MCBayesNetGenerator< GUM_SCALAR, ICPTGenerator, ICPTDisturber >::_directedPath_(), gum::MCBayesNetGenerator< GUM_SCALAR, SimpleCPTGenerator, SimpleCPTDisturber >::_directedPath_(), gum::prm::SVE< GUM_SCALAR >::_eliminateDelayedVariables_(), gum::prm::SVE< GUM_SCALAR >::_eliminateNodes_(), gum::prm::SVED< GUM_SCALAR >::_eliminateNodes_(), gum::prm::SVE< GUM_SCALAR >::_eliminateNodesDownward_(), gum::prm::SVED< GUM_SCALAR >::_eliminateNodesDownward_(), gum::prm::SVED< GUM_SCALAR >::_eliminateNodesUpward_(), gum::prm::SVE< GUM_SCALAR >::_eliminateNodesWithEvidence_(), gum::prm::SVED< GUM_SCALAR >::_eliminateNodesWithEvidence_(), gum::prm::gspan::StrictSearch< GUM_SCALAR >::_elimination_cost_(), gum::learning::Miic::_existsDirectedPath_(), gum::learning::SimpleMiic::_existsDirectedPath_(), gum::MeekRules::_existsDirectedPath_(), gum::prm::StructuredBayesBall< GUM_SCALAR >::_fillMaps_(), gum::prm::ClusteredLayerGenerator< GUM_SCALAR >::_generateClasses_(), gum::prm::LayerGenerator< GUM_SCALAR >::_generateClasses_(), gum::prm::SVE< GUM_SCALAR >::_initElimOrder_(), gum::prm::SVED< GUM_SCALAR >::_initElimOrder_(), gum::prm::gspan::DFSTree< GUM_SCALAR >::_initialiaze_root_(), gum::prm::SVE< GUM_SCALAR >::_initLiftedNodes_(), gum::prm::SVED< GUM_SCALAR >::_initLiftedNodes_(), gum::prm::SVED< GUM_SCALAR >::_initReqSets_(), gum::prm::SVE< GUM_SCALAR >::_insertEvidence_(), gum::prm::SVED< GUM_SCALAR >::_insertEvidence_(), gum::prm::SVE< GUM_SCALAR >::_insertLiftedNodes_(), gum::prm::SVED< GUM_SCALAR >::_insertLiftedNodes_(), gum::prm::StructuredInference< GUM_SCALAR >::_insertNodeInElimLists_(), gum::MCBayesNetGenerator< GUM_SCALAR, ICPTGenerator, ICPTDisturber >::_is_connected_(), gum::OrderedEliminationSequenceStrategy::_isOrderNeeded_(), gum::MeekRules::_orientDoubleHeadedArcs_(), gum::MeekRules::_propagatesOrientationInChainOfRemainingEdges_(), gum::prm::StructuredInference< GUM_SCALAR >::_reduceAloneInstances_(), gum::prm::StructuredInference< GUM_SCALAR >::_reducePattern_(), gum::prm::StructuredInference< GUM_SCALAR >::_removeBarrenNodes_(), gum::prm::GSpan< GUM_SCALAR >::_sortPatterns_(), gum::prm::StructuredInference< GUM_SCALAR >::_translatePotSet_(), gum::StaticTriangulation::_triangulate_(), gum::prm::SVE< GUM_SCALAR >::_variableElimination_(), gum::LeafAggregator::addLeaf(), gum::ArcGraphPart::ancestors(), gum::NodeGraphPart::asNodeSet(), gum::BarrenNodesFinder::barrenNodes(), gum::BarrenNodesFinder::barrenNodes(), gum::BarrenNodesFinder::barrenTensors(), gum::MixedGraph::chainComponent(), gum::BayesNetFragment< GUM_SCALAR >::checkConsistency(), gum::Tensor< GUM_SCALAR >::complementVars_(), gum::PDAG::cSeparation(), gum::ArcGraphPart::descendants(), gum::DAG::dSeparation(), gum::prm::eliminateNode(), gum::Tensor< GUM_SCALAR >::fillWith(), gum::Tensor< GUM_SCALAR >::findAll(), gum::InfluenceDiagram< GUM_SCALAR >::getPartialTemporalOrder(), gum::prm::gspan::DFSTree< GUM_SCALAR >::growPattern(), gum::DAGCycleDetector::hasCycleFromModifications(), gum::DiGraph::hasDirectedPath(), gum::EdgeGraphPart::hasUndirectedPath(), gum::EdgeGraphPart::hasUndirectedPath(), gum::EdgeGraphPart::hasUndirectedPath(), gum::IBayesNet< double >::ids(), gum::FMDPLearner< VariableAttributeSelection, RewardAttributeSelection, LearnerSelection >::initialize(), gum::PartialOrderedEliminationSequenceStrategy::isPartialOrderNeeded_(), gum::JointTargetedInference< GUM_SCALAR >::jointMutualInformation(), gum::JointTargetedMRFInference< GUM_SCALAR >::jointMutualInformation(), gum::JointTargetedMRFInference< GUM_SCALAR >::jointPosterior(), gum::DecisionTensor< GUM_SCALAR >::marginalization(), gum::PDAG::moralGraph(), gum::DAG::moralizedAncestralGraph(), gum::GraphicalModel::nodeset(), operator<<(), operator<<(), gum::IMarkovRandomField< GUM_SCALAR >::operator==(), gum::learning::Miic::orientDoubleHeadedArcs_(), gum::prm::StructuredInference< GUM_SCALAR >::posterior_(), gum::prm::SVE< GUM_SCALAR >::posterior_(), gum::prm::SVED< GUM_SCALAR >::posterior_(), gum::O3prmBNReader< GUM_SCALAR >::proceed(), gum::learning::SimpleMiic::propagatesOrientationInChainOfRemainingEdges_(), gum::rec_hasMixedReallyOrientedPath(), gum::dSeparationAlgorithm::relevantTensors(), gum::BayesBall::requisiteNodes(), gum::dSeparationAlgorithm::requisiteNodes(), gum::prm::PRMFactory< GUM_SCALAR >::startClass(), gum::MixedGraph::toDot(), gum::IMDDI< AttributeSelection, isScalar >::updateGraph(), gum::ITI< AttributeSelection, isScalar >::updateGraph(), and gum::GraphicalModel::variables().
| INLINE void gum::Set< Key >::insert | ( | Key && | k | ) |
Inserts a new element into the set.
| k | The new element to insert. |
Definition at line 557 of file set_tpl.h.
References _inside_, and contains().
Definition at line 502 of file set_tpl.h.
References Set(), contains(), and size().
Referenced by isStrictSupersetOf(), and gum::JointTargetedInference< GUM_SCALAR >::jointPosterior().
| INLINE bool gum::Set< Key >::isStrictSupersetOf | ( | const Set< Key > & | s | ) | const |
Definition at line 512 of file set_tpl.h.
References Set(), and isStrictSubsetOf().
Definition at line 517 of file set_tpl.h.
Referenced by isSupersetOrEqual(), and gum::JointTargetedMRFInference< GUM_SCALAR >::superForJointComputable_().
Definition at line 527 of file set_tpl.h.
References Set(), and isSubsetOrEqual().
| List< NewKey > gum::Set< Key >::listMap | ( | NewKey(* | f )(const Key &) | ) | const |
A method to create a List of NewKey from the set.
| f | A function that maps a Key into a NewKey |
Definition at line 795 of file set_tpl.h.
References _inside_, and gum::List< Val >::pushBack().
Intersection operator.
| s2 | The gum::Set to intersect. |
Definition at line 648 of file set_tpl.h.
References Set(), _inside_, gum::HashTable< Key, Val >::cbegin(), gum::HashTable< Key, Val >::cend(), gum::HashTable< Key, Val >::exists(), gum::HashTable< Key, Val >::insert(), gum::HashTable< Key, Val >::size(), and size().
Intersection update operator.
| s2 | The gum::Set to intersect. |
Definition at line 669 of file set_tpl.h.
References Set(), _inside_, and gum::HashTable< Key, Val >::exists().
Union operator.
| s2 | The gum::Set to union. |
Definition at line 694 of file set_tpl.h.
References Set(), _inside_, gum::HashTable< Key, Val >::cbegin(), gum::HashTable< Key, Val >::cend(), gum::HashTable< Key, Val >::exists(), and gum::HashTable< Key, Val >::insert().
Union update operator.
| s2 | The gum::Set to update |
Definition at line 682 of file set_tpl.h.
References Set(), and _inside_.
Disjunction operator.
| s2 | The gum::Set to disjunct. |
Definition at line 708 of file set_tpl.h.
References Set().
Copy operator.
| from | The gum::Set to copy. |
Definition at line 354 of file set_tpl.h.
References Set().
Mathematical equality between two sets.
| s2 | The gum::Set to test for equality. |
Definition at line 391 of file set_tpl.h.
References Set().
| Key gum::Set< Key >::popFirst | ( | ) |
Removes and returns an arbitrary element from the set.
| NotFound | Raised if the set is empty. |
Definition at line 593 of file set_tpl.h.
References begin(), empty(), erase(), and GUM_ERROR.
Changes the size of the underlying hash table containing the set.
See gum::HashTable::resize(Size) method resize for more details.
| new_capacity | The underlying hash table new size. |
Definition at line 468 of file set_tpl.h.
References _inside_.
Referenced by gum::StaticTriangulation::_triangulate_().
Enables the user to change dynamically the resizing policy of the underlying hash table.
When new_policy is false, the set will not try to change its memory size, hence resulting in tensorly slower accesses.
| new_policy | If true the set updates dynamically its memory consumption to guarantee that its elements are fast to retrieve. |
Definition at line 480 of file set_tpl.h.
References _inside_.
Returns the number of elements in the set.
Definition at line 636 of file set_tpl.h.
References _inside_.
Referenced by gum::prm::StructuredInference< GUM_SCALAR >::CData::CData(), Set(), gum::BinaryJoinTreeConverterDefault::_convertClique_(), gum::MeekRules::_critereMinParents_(), gum::prm::StructuredInference< GUM_SCALAR >::_eliminateObservedNodes_(), gum::prm::StructuredInference< GUM_SCALAR >::_eliminateObservedNodesInSource_(), gum::prm::gspan::StrictSearch< GUM_SCALAR >::_elimination_cost_(), gum::prm::ClusteredLayerGenerator< GUM_SCALAR >::_generateClassDag_(), gum::prm::LayerGenerator< GUM_SCALAR >::_generateClassDag_(), gum::prm::SVE< GUM_SCALAR >::_initLiftedNodes_(), gum::prm::SVED< GUM_SCALAR >::_initLiftedNodes_(), gum::prm::StructuredInference< GUM_SCALAR >::_insertNodeInElimLists_(), gum::OrderedEliminationSequenceStrategy::_isOrderNeeded_(), gum::MeekRules::_propagatesOrientationInChainOfRemainingEdges_(), gum::prm::StructuredInference< GUM_SCALAR >::_reduceAloneInstances_(), gum::prm::StructuredInference< GUM_SCALAR >::_reducePattern_(), gum::StaticTriangulation::_triangulate_(), gum::AggregatorDecomposition< GUM_SCALAR >::addDepthLayer_(), gum::BarrenNodesFinder::barrenNodes(), gum::AggregatorDecomposition< GUM_SCALAR >::decomposeAggregator_(), gum::prm::eliminateNode(), gum::StaticTriangulation::fillIns(), hashMap(), hashMap(), gum::learning::Miic::initiation_(), gum::learning::SimpleMiic::initiation_(), gum::prm::PRMClassElementContainer< double >::isInputNode(), gum::learning::Miic::isMaxIndegree_(), gum::PartialOrderedEliminationSequenceStrategy::isPartialOrderNeeded_(), isStrictSubsetOf(), isSubsetOrEqual(), gum::Tensor< GUM_SCALAR >::maxOut(), gum::Tensor< GUM_SCALAR >::minOut(), gum::credal::CNLoopyPropagation< GUM_SCALAR >::msgL_(), gum::credal::CNLoopyPropagation< GUM_SCALAR >::msgP_(), operator*(), gum::prm::StructuredInference< GUM_SCALAR >::posterior_(), gum::Tensor< GUM_SCALAR >::prodOut(), gum::learning::SimpleMiic::propagatesOrientationInChainOfRemainingEdges_(), gum::DAGCycleDetector::setDAG(), gum::Tensor< GUM_SCALAR >::sumOut(), gum::StaticTriangulation::triangulatedGraph(), and gum::IncrementalGraphLearner< AttributeSelection, isScalar >::updateNode_().
| INLINE std::string gum::Set< Key >::toString | ( | ) | const |
Prints the content of the set.
Definition at line 722 of file set_tpl.h.
Referenced by gum::operator<<().
|
friend |
|
friend |
Friends to speed up access.
Definition at line 546 of file set.h.
Referenced by beginSafe(), cbeginSafe(), cendSafe(), endSafe(), and erase().
A set of X's is actually a hash table whose keys are the X's.
Definition at line 558 of file set.h.
Referenced by Set(), Set(), Set(), Set(), capacity(), clear(), empty(), erase(), erase(), exists(), hashMap(), insert(), insert(), listMap(), operator*(), operator*=(), operator+(), operator+=(), operator=(), resize(), resizePolicy(), setResizePolicy(), and size().