51#ifndef DOXYGEN_SHOULD_SKIP_THIS
65 const std::size_t
size = _ids_.size();
66 for (std::size_t i = _nb_lhs_ids_; i <
size; ++i)
67 set._ids_ << _ids_[i];
68 set._end_safe_._gotoEnd_();
75 const std::size_t
size = _ids_.size();
76 std::size_t
pos = std::size_t(0);
78 if (_ids_[
pos] ==
id)
break;
83 _ids_.erase(SequenceIteratorSafe< NodeId >(_ids_,
pos));
84 if (
pos < _nb_lhs_ids_) --_nb_lhs_ids_;
85 _end_safe_._gotoEnd_();
91 std::stringstream str;
96 for (std::size_t i = std::size_t(0); i < _nb_lhs_ids_; ++i) {
97 if (deja) str <<
" , ";
103 for (
auto iter = _ids_.begin() + _nb_lhs_ids_; iter != _ids_.end(); ++iter) {
104 if (deja) str <<
" , ";
121 for (
auto i = std::size_t(0); i < _ids_.size(); ++i)
122 if (i < _nb_lhs_ids_) left.
insert(_ids_[i]);
123 else right.
insert(_ids_[i]);
124 return {left, right};
129 if (set._ids_.size() > _ids_.size())
return false;
130 for (
const auto node: set._ids_) {
131 if (!_ids_.exists(node))
return false;
138 return stream << idset.toString();
146 const Sequence< NodeId >& vect = key.ids();
147 const std::size_t size = vect.size();
149 std::size_t i = std::size_t(0);
static Size castToSize(const learning::IdCondSet &key)
Returns the value of a key as a Size.
void insert(const Key &k)
Inserts a new element into the set.
A class for storing a pair of sets of NodeIds, the second one corresponding to a conditional set.
bool contains(const IdCondSet &set) const
indicates whether the IdCondSet contains the IdCondSet passed in argument
IdCondSet conditionalIdCondSet() const
returns the idSet at the right hand side of the conditioning bar
std::size_t pos(const NodeId id) const
returns the position of a given node in the IdCondSet
std::string toString() const
returns the content of the set as a string
std::pair< NodeSet, NodeSet > toNodeSets() const
returns the pair of conditioned gum::NodeSet and conditioning gum::NodeSet
void erase(const NodeId id)
erase a node in the idset
std::size_t size() const
returns the number of variables (both left and right hand side)
IdCondSet()
default constructor
std::size_t Size
In aGrUM, hashed values are unsigned long int.
Size NodeId
Type for node ids.
Set< NodeId > NodeSet
Some typdefs and define for shortcuts ...
A class used by learning caches to represent uniquely sets of variables.
Template implementation of idSets.
include the inlined functions if necessary
std::ostream & operator<<(std::ostream &stream, const IdCondSet &idset)
the display operator
gum is the global namespace for all aGrUM entities