![]() |
aGrUM
0.16.0
|
The internal class for storing (ordered) sequences of objects. More...
#include <agrum/core/sequence.h>
Public Member Functions | |
template<typename OtherAlloc > | |
INLINE void | __copy (const SequenceImplementation< Key, OtherAlloc, Gen > &aSeq) |
template<typename OtherAlloc > | |
INLINE | SequenceImplementation (const SequenceImplementation< Key, OtherAlloc, Gen > &aSeq) |
template<typename OtherAlloc > | |
INLINE SequenceImplementation< Key, Alloc, Gen > & | operator= (const SequenceImplementation< Key, OtherAlloc, Gen > &aSeq) |
template<typename... Args> | |
INLINE void | emplace (Args &&... args) |
template<typename OtherAlloc > | |
INLINE bool | operator!= (const SequenceImplementation< Key, OtherAlloc, Gen > &k) const |
template<typename OtherAlloc > | |
INLINE void | __copy (const SequenceImplementation< Key, OtherAlloc, true > &aSeq) |
template<typename Key, typename Alloc> | |
SequenceImplementation (const SequenceImplementation< Key, Alloc, true > &aSeq) | |
template<typename OtherAlloc > | |
SequenceImplementation (const SequenceImplementation< Key, OtherAlloc, true > &aSeq) | |
template<typename Key, typename Alloc> | |
INLINE | SequenceImplementation (SequenceImplementation< Key, Alloc, true > &&aSeq) |
template<typename OtherAlloc > | |
INLINE SequenceImplementation< Key, Alloc, true > & | operator= (const SequenceImplementation< Key, OtherAlloc, true > &aSeq) |
template<typename OtherAlloc > | |
bool | operator== (const SequenceImplementation< Key, OtherAlloc, true > &k) const |
template<typename OtherAlloc > | |
INLINE bool | operator!= (const SequenceImplementation< Key, OtherAlloc, true > &k) const |
Destructor | |
~SequenceImplementation () noexcept | |
Class destructor. More... | |
Iterators | |
iterator_safe | beginSafe () const |
Returns a safe begin iterator. More... | |
iterator_safe | rbeginSafe () const |
Returns a safe rbegin iterator. More... | |
const iterator_safe & | endSafe () const noexcept |
Returns the safe end iterator. More... | |
const iterator_safe & | rendSafe () const noexcept |
Returns the safe rend iterator. More... | |
iterator | begin () const |
Returns an unsafe begin iterator. More... | |
iterator | rbegin () const |
Returns an unsafe rbegin iterator. More... | |
const iterator & | end () const noexcept |
Returns the unsafe end iterator. More... | |
const iterator & | rend () const noexcept |
Returns the unsafe rend iterator. More... | |
Operators | |
SequenceImplementation< Key, Alloc, Gen > & | operator<< (const Key &k) |
Insert k at the end of the sequence (synonym for insert). More... | |
SequenceImplementation< Key, Alloc, Gen > & | operator<< (Key &&k) |
Insert k at the end of the sequence (synonym for insert). More... | |
SequenceImplementation< Key, Alloc, Gen > & | operator>> (const Key &k) |
Remove k in the sequence (synonym for erase). More... | |
const Key & | operator[] (Idx i) const |
Returns the element at position i (synonym for atPos). More... | |
template<typename OtherAlloc > | |
bool | operator== (const SequenceImplementation< Key, OtherAlloc, Gen > &k) const |
Returns true if the content of k equals that of *this. More... | |
template<typename OtherAlloc > | |
bool | operator!= (const SequenceImplementation< Key, OtherAlloc, Gen > &k) const |
Returns true if the content of k is different from that of *this. More... | |
Accessors / Modifiers | |
void | clear () |
Clear the sequence. More... | |
Size | size () const noexcept |
Returns the size of the sequence. More... | |
bool | empty () const noexcept |
Return true if empty. More... | |
bool | exists (const Key &k) const |
Check the existence of k in the sequence. More... | |
void | insert (const Key &k) |
Insert an element at the end of the sequence. More... | |
void | insert (Key &&k) |
Move an element at the end of the sequence. More... | |
template<typename... Args> | |
void | emplace (Args &&... args) |
Emplace a new element in the sequence. More... | |
void | erase (const Key &k) |
Remove an element from the sequence. More... | |
void | erase (const iterator_safe &k) |
Remove from the sequence the element pointed to by the iterator. More... | |
const Key & | atPos (Idx i) const |
Returns the object at the pos i. More... | |
Idx | pos (const Key &key) const |
Returns the position of the object passed in argument (if it exists). More... | |
void | setAtPos (Idx i, const Key &newKey) |
Change the value. More... | |
void | setAtPos (Idx i, Key &&newKey) |
Change the value. More... | |
void | swap (Idx i, Idx j) |
Swap index. More... | |
const Key & | front () const |
Returns the first element of the element. More... | |
const Key & | back () const |
Returns the last element of the sequence. More... | |
std::string | toString () const |
Displays the content of the sequence. More... | |
void | resize (Size new_size) |
Modifies the size of the internal structures of the sequence. More... | |
Public Types | |
using | value_type = Key |
Types for STL compliance. More... | |
using | reference = Key & |
Types for STL compliance. More... | |
using | const_reference = const Key & |
Types for STL compliance. More... | |
using | pointer = Key * |
Types for STL compliance. More... | |
using | const_pointer = const Key * |
Types for STL compliance. More... | |
using | size_type = std::size_t |
Types for STL compliance. More... | |
using | difference_type = std::ptrdiff_t |
Types for STL compliance. More... | |
using | allocator_type = Alloc |
Types for STL compliance. More... | |
using | iterator = SequenceIterator< Key > |
Types for STL compliance. More... | |
using | const_iterator = SequenceIterator< Key > |
Types for STL compliance. More... | |
using | iterator_safe = SequenceIteratorSafe< Key > |
Types for STL compliance. More... | |
using | const_iterator_safe = SequenceIteratorSafe< Key > |
Types for STL compliance. More... | |
Friends | |
template<typename K , typename A , bool > | |
class | SequenceImplementation |
Friends to speed up access. More... | |
class | SequenceIteratorSafe< Key > |
Friends to speed up access. More... | |
class | Sequence< Key, Alloc > |
Friends to speed up access. More... | |
The internal class for storing (ordered) sequences of objects.
A SequenceImplementation<Key,Alloc,bool Gen> is a specialized version of of a Sequence<Key,Alloc>. It shall not be used by itself but rather through the Sequence class. A SequenceImplementation is quite similar to a vector<Key> in that it stores an ordered set of elements. The main difference between these two data structures lies in the fact that, given a key, it is possible to retrieve from a SequenceImplementation the index in the vector where the key lies in O(1). As a result, it is not possible to insert a given element twice in the sequence, that is, all the Keys must be different.
When the Boolean template parameter gen is false, SequenceImplementation implements a very generic sequence. This allows having Sequences containing elements of virtually any class or type. When the Boolean gen is equal to true, the SequenceImplementation shall contain only scalar types (integers, floats, pointers, etc). As such, knowning that the element is a scalar enables to optimize the code of the sequences. Determining whether gen should be set to true or false is not left to the developper but is determined by the compiler itself at compile time.
Key | The elements type stored in the sequence. |
Alloc | The values allocator. |
Gen | Used for meta-programation. |
Definition at line 90 of file sequence.h.
using gum::SequenceImplementation< Key, Alloc, Gen >::allocator_type = Alloc |
Types for STL compliance.
Definition at line 109 of file sequence.h.
using gum::SequenceImplementation< Key, Alloc, Gen >::const_iterator = SequenceIterator< Key > |
Types for STL compliance.
Definition at line 111 of file sequence.h.
using gum::SequenceImplementation< Key, Alloc, Gen >::const_iterator_safe = SequenceIteratorSafe< Key > |
Types for STL compliance.
Definition at line 113 of file sequence.h.
using gum::SequenceImplementation< Key, Alloc, Gen >::const_pointer = const Key* |
Types for STL compliance.
Definition at line 106 of file sequence.h.
using gum::SequenceImplementation< Key, Alloc, Gen >::const_reference = const Key& |
Types for STL compliance.
Definition at line 104 of file sequence.h.
using gum::SequenceImplementation< Key, Alloc, Gen >::difference_type = std::ptrdiff_t |
Types for STL compliance.
Definition at line 108 of file sequence.h.
using gum::SequenceImplementation< Key, Alloc, Gen >::iterator = SequenceIterator< Key > |
Types for STL compliance.
Definition at line 110 of file sequence.h.
using gum::SequenceImplementation< Key, Alloc, Gen >::iterator_safe = SequenceIteratorSafe< Key > |
Types for STL compliance.
Definition at line 112 of file sequence.h.
using gum::SequenceImplementation< Key, Alloc, Gen >::pointer = Key* |
Types for STL compliance.
Definition at line 105 of file sequence.h.
using gum::SequenceImplementation< Key, Alloc, Gen >::reference = Key& |
Types for STL compliance.
Definition at line 103 of file sequence.h.
using gum::SequenceImplementation< Key, Alloc, Gen >::size_type = std::size_t |
Types for STL compliance.
Definition at line 107 of file sequence.h.
using gum::SequenceImplementation< Key, Alloc, Gen >::value_type = Key |
Types for STL compliance.
Definition at line 102 of file sequence.h.
|
private |
Default constructor.
size_param | The intial size of the gum::SequenceImplementation. |
Definition at line 294 of file sequence_tpl.h.
|
private |
Initializer list constructor.
list | The initializer list. |
Definition at line 306 of file sequence_tpl.h.
|
private |
Copy constructor.
aSeq | The sequence the elements of which will be copied. |
Definition at line 319 of file sequence_tpl.h.
|
private |
Generalised copy constructor.
OtherAlloc | The other gum::SequenceImplementation allocator. |
aSeq | The sequence the elements of which will be copied. |
|
private |
Move constructor.
aSeq | The gum::SequenceImplementation to move/ |
Definition at line 344 of file sequence_tpl.h.
|
noexcept |
Class destructor.
Definition at line 357 of file sequence_tpl.h.
INLINE gum::SequenceImplementation< Key, Alloc, Gen >::SequenceImplementation | ( | const SequenceImplementation< Key, OtherAlloc, Gen > & | aSeq | ) |
Definition at line 332 of file sequence_tpl.h.
gum::SequenceImplementation< Key, Alloc, Gen >::SequenceImplementation | ( | const SequenceImplementation< Key, Alloc, true > & | aSeq | ) |
Definition at line 753 of file sequence_tpl.h.
gum::SequenceImplementation< Key, Alloc, Gen >::SequenceImplementation | ( | const SequenceImplementation< Key, OtherAlloc, true > & | aSeq | ) |
Definition at line 766 of file sequence_tpl.h.
INLINE gum::SequenceImplementation< Key, Alloc, Gen >::SequenceImplementation | ( | SequenceImplementation< Key, Alloc, true > && | aSeq | ) |
Definition at line 778 of file sequence_tpl.h.
INLINE void gum::SequenceImplementation< Key, Alloc, Gen >::__copy | ( | const SequenceImplementation< Key, OtherAlloc, Gen > & | aSeq | ) |
Definition at line 280 of file sequence_tpl.h.
|
private |
Clears the current sequence and fill it with copies the element of aSeq.
OtherAlloc | The other gum::SequenceImplementation allocator. |
aSeq | The gum::SequenceImplementation to copy. |
INLINE void gum::SequenceImplementation< Key, Alloc, Gen >::__copy | ( | const SequenceImplementation< Key, OtherAlloc, true > & | aSeq | ) |
Definition at line 714 of file sequence_tpl.h.
|
private |
Insert an element at the end of the sequence.
bucket | The bucket holing the store to insert. |
|
privatenoexcept |
A method to update the end iterator after changes in the sequence.
Definition at line 265 of file sequence_tpl.h.
INLINE const Key & gum::SequenceImplementation< Key, Alloc >::atPos | ( | Idx | i | ) | const |
Returns the object at the pos i.
i | The position of the element to return. |
NotFound | Raised if the element does not exist. |
Definition at line 500 of file sequence_tpl.h.
Referenced by gum::ArgMaxSet< GUM_SCALAR_VAL, GUM_SCALAR_SEQ >::operator[]().
INLINE const Key & gum::SequenceImplementation< Key, Alloc >::back | ( | ) | const |
Returns the last element of the sequence.
NotFound | Raised if the sequence is empty. |
Definition at line 568 of file sequence_tpl.h.
Referenced by gum::prm::StructuredInference< GUM_SCALAR >::__removeBarrenNodes(), and gum::DiGraph::__topologicalOrder().
INLINE SequenceIterator< Key > gum::SequenceImplementation< Key, Alloc >::begin | ( | ) | const |
Returns an unsafe begin iterator.
Definition at line 657 of file sequence_tpl.h.
Referenced by gum::InfluenceDiagramGenerator< GUM_SCALAR >::__checkTemporalOrder(), and gum::InfluenceDiagram< GUM_SCALAR >::decisionOrderExists().
INLINE SequenceIteratorSafe< Key > gum::SequenceImplementation< Key, Alloc >::beginSafe | ( | ) | const |
Returns a safe begin iterator.
Definition at line 627 of file sequence_tpl.h.
Referenced by gum::FMDP< double >::beginActions(), gum::TaxiSimulator::beginActions(), gum::FactorySimulator::beginActions(), and gum::ArgMaxSet< GUM_SCALAR_VAL, GUM_SCALAR_SEQ >::beginSafe().
INLINE void gum::SequenceImplementation< Key, Alloc >::clear | ( | ) |
Clear the sequence.
Definition at line 271 of file sequence_tpl.h.
Referenced by gum::GibbsOperator< GUM_SCALAR >::__updateSamplingNodes(), gum::SequenceImplementation< gum::prm::PRMClassElement< double > *, std::allocator< gum::prm::PRMClassElement< double > *>, std::is_scalar< gum::prm::PRMClassElement< double > *>::value >::resize(), and gum::DiGraph::topologicalOrder().
void gum::SequenceImplementation< Key, Alloc, Gen >::emplace | ( | Args &&... | args | ) |
Emplace a new element in the sequence.
The 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 types passed to the constructor. |
args | The arguments passed to the constructor. |
DuplicateElement | Raised if the sequence contains already k. |
INLINE void gum::SequenceImplementation< Key, Alloc >::emplace | ( | Args &&... | args | ) |
Definition at line 427 of file sequence_tpl.h.
|
noexcept |
Return true if empty.
Definition at line 44 of file sequence_tpl.h.
|
noexcept |
Returns the unsafe end iterator.
Definition at line 664 of file sequence_tpl.h.
Referenced by gum::InfluenceDiagramGenerator< GUM_SCALAR >::__checkTemporalOrder(), and gum::InfluenceDiagram< GUM_SCALAR >::decisionOrderExists().
|
noexcept |
Returns the safe end iterator.
Definition at line 634 of file sequence_tpl.h.
Referenced by gum::FMDP< double >::endActions(), gum::TaxiSimulator::endActions(), gum::FactorySimulator::endActions(), and gum::ArgMaxSet< GUM_SCALAR_VAL, GUM_SCALAR_SEQ >::endSafe().
INLINE void gum::SequenceImplementation< Key, Alloc, Gen >::erase | ( | const Key & | k | ) |
Remove an element from the sequence.
If the element cannot be found, the function does nothing. In particular, it throws no exception. Complexity \(o(n)\) (need to change the position of at most the n elements).
k | The element to remove. |
Definition at line 453 of file sequence_tpl.h.
Referenced by gum::prm::StructuredInference< GUM_SCALAR >::__removeBarrenNodes(), gum::MultiDimFunctionGraphManager< bool, ExactTerminalNodePolicy >::clean(), gum::SequenceImplementation< gum::prm::PRMClassElement< double > *, std::allocator< gum::prm::PRMClassElement< double > *>, std::is_scalar< gum::prm::PRMClassElement< double > *>::value >::erase(), and gum::SequenceImplementation< gum::prm::PRMClassElement< double > *, std::allocator< gum::prm::PRMClassElement< double > *>, std::is_scalar< gum::prm::PRMClassElement< double > *>::value >::operator=().
INLINE void gum::SequenceImplementation< Key, Alloc >::erase | ( | const iterator_safe & | k | ) |
Remove from the sequence the element pointed to by the iterator.
If the element cannot be found, the function does nothing. In particular, it throws no exception. Complexity \(o(n)\) (need to change the position of at most the n elements)
k | The iterator poiting to the element to remove. |
Definition at line 474 of file sequence_tpl.h.
INLINE bool gum::SequenceImplementation< Key, Alloc >::exists | ( | const Key & | k | ) | const |
Check the existence of k in the sequence.
The complexity is \(o(1)\).
k | The key to check for existence. |
Definition at line 402 of file sequence_tpl.h.
Referenced by gum::DiGraph::__topologicalOrder(), gum::ArgMaxSet< GUM_SCALAR_VAL, GUM_SCALAR_SEQ >::exists(), gum::SequenceImplementation< gum::prm::PRMClassElement< double > *, std::allocator< gum::prm::PRMClassElement< double > *>, std::is_scalar< gum::prm::PRMClassElement< double > *>::value >::exists(), and gum::SequenceImplementation< gum::prm::PRMClassElement< double > *, std::allocator< gum::prm::PRMClassElement< double > *>, std::is_scalar< gum::prm::PRMClassElement< double > *>::value >::operator=().
INLINE const Key & gum::SequenceImplementation< Key, Alloc >::front | ( | ) | const |
Returns the first element of the element.
NotFound | Raised if the sequence is empty. |
Definition at line 562 of file sequence_tpl.h.
INLINE void gum::SequenceImplementation< Key, Alloc, Gen >::insert | ( | const Key & | k | ) |
Insert an element at the end of the sequence.
The complexity is \(o(1)\).
k | The element to insert. |
DuplicateElement | Raised if the sequence contains already k. |
Definition at line 408 of file sequence_tpl.h.
Referenced by gum::prm::SVED< GUM_SCALAR >::__initElimOrder(), gum::prm::SVE< GUM_SCALAR >::__initElimOrder(), gum::prm::StructuredInference< GUM_SCALAR >::__removeBarrenNodes(), gum::DiGraph::__topologicalOrder(), gum::GibbsOperator< GUM_SCALAR >::__updateSamplingNodes(), gum::InfluenceDiagram< GUM_SCALAR >::_getChildrenDecision(), gum::ActionSet::ActionSet(), gum::ArgMaxSet< GUM_SCALAR_VAL, GUM_SCALAR_SEQ >::ArgMaxSet(), gum::ActionSet::operator=(), gum::SequenceImplementation< gum::prm::PRMClassElement< double > *, std::allocator< gum::prm::PRMClassElement< double > *>, std::is_scalar< gum::prm::PRMClassElement< double > *>::value >::operator=(), and gum::TaxiSimulator::TaxiSimulator().
INLINE void gum::SequenceImplementation< Key, Alloc, Gen >::insert | ( | Key && | k | ) |
Move an element at the end of the sequence.
The complexity is \(o(1)\).
k | The element to insert. |
DuplicateElement | Raised if the sequence contains already k. |
Definition at line 417 of file sequence_tpl.h.
bool gum::SequenceImplementation< Key, Alloc, Gen >::operator!= | ( | const SequenceImplementation< Key, OtherAlloc, Gen > & | k | ) | const |
Returns true if the content of k is different from that of *this.
Note that two sequences are equal if and only if they contain the same variables (using Key::operator==) in the same order.
OtherAlloc | The other gum::SequenceImplementation allocator. |
k | The other gum::SequenceImplementation. Returns true if both gum::SequenceImplementation are not equal. |
INLINE bool gum::SequenceImplementation< Key, Alloc, Gen >::operator!= | ( | const SequenceImplementation< Key, OtherAlloc, Gen > & | k | ) | const |
Definition at line 611 of file sequence_tpl.h.
INLINE bool gum::SequenceImplementation< Key, Alloc, Gen >::operator!= | ( | const SequenceImplementation< Key, OtherAlloc, true > & | k | ) | const |
Definition at line 1011 of file sequence_tpl.h.
INLINE SequenceImplementation< Key, Alloc, Gen > & gum::SequenceImplementation< Key, Alloc, Gen >::operator<< | ( | const Key & | k | ) |
Insert k at the end of the sequence (synonym for insert).
k | The key we wish to insert in the sequence. |
DuplicateElement | Raised if the sequence contains already k. |
Definition at line 438 of file sequence_tpl.h.
INLINE SequenceImplementation< Key, Alloc, Gen > & gum::SequenceImplementation< Key, Alloc, Gen >::operator<< | ( | Key && | k | ) |
Insert k at the end of the sequence (synonym for insert).
k | The key we wish to insert in the sequence. |
DuplicateElement | Raised if the sequence contains already k. |
Definition at line 446 of file sequence_tpl.h.
|
private |
Copy operator.
aSeq | The sequence to copy. |
Definition at line 365 of file sequence_tpl.h.
|
private |
Generalized opy operator.
OtherAlloc | The other gum::SequenceImplementation allocator. |
aSeq | The sequence to copy. |
|
private |
Move operator.
aSeq | The sequence to move. |
Definition at line 388 of file sequence_tpl.h.
INLINE SequenceImplementation< Key, Alloc, Gen >& gum::SequenceImplementation< Key, Alloc, Gen >::operator= | ( | const SequenceImplementation< Key, OtherAlloc, Gen > & | aSeq | ) |
Definition at line 379 of file sequence_tpl.h.
INLINE SequenceImplementation< Key, Alloc, true >& gum::SequenceImplementation< Key, Alloc, Gen >::operator= | ( | const SequenceImplementation< Key, OtherAlloc, true > & | aSeq | ) |
Definition at line 810 of file sequence_tpl.h.
bool gum::SequenceImplementation< Key, Alloc, Gen >::operator== | ( | const SequenceImplementation< Key, OtherAlloc, Gen > & | k | ) | const |
Returns true if the content of k equals that of *this.
Note that two sequences are equal if and only if they contain the same Keys (using Key::operator==) in the same order.
OtherAlloc | The other gum::SequenceImplementation allocator. |
k | The other gum::SequenceImplementation. Returns true if both gum::SequenceImplementation are equal. |
Definition at line 596 of file sequence_tpl.h.
bool gum::SequenceImplementation< Key, Alloc, Gen >::operator== | ( | const SequenceImplementation< Key, OtherAlloc, true > & | k | ) | const |
Definition at line 996 of file sequence_tpl.h.
INLINE SequenceImplementation< Key, Alloc, true > & gum::SequenceImplementation< Key, Alloc >::operator>> | ( | const Key & | k | ) |
Remove k in the sequence (synonym for erase).
If the element cannot be found, the function does nothing. In particular, it throws no exception.
k | The key we wish to remove. |
Definition at line 493 of file sequence_tpl.h.
INLINE const Key & gum::SequenceImplementation< Key, Alloc >::operator[] | ( | Idx | i | ) | const |
Returns the element at position i (synonym for atPos).
i | The position of the element to return. |
OutOfBounds | Raised if the element does not exist. |
Definition at line 512 of file sequence_tpl.h.
INLINE Idx gum::SequenceImplementation< Key, Alloc >::pos | ( | const Key & | key | ) | const |
Returns the position of the object passed in argument (if it exists).
key | The element for which the positon is returned. |
NotFound | Raised if the element does not exist. |
Definition at line 518 of file sequence_tpl.h.
Referenced by gum::prm::SVED< GUM_SCALAR >::__checkElimOrder(), gum::prm::SVE< GUM_SCALAR >::__checkElimOrder(), and gum::learning::genericBNLearner::__learnDAG().
INLINE SequenceIterator< Key > gum::SequenceImplementation< Key, Alloc >::rbegin | ( | ) | const |
Returns an unsafe rbegin iterator.
Definition at line 671 of file sequence_tpl.h.
INLINE SequenceIteratorSafe< Key > gum::SequenceImplementation< Key, Alloc >::rbeginSafe | ( | ) | const |
Returns a safe rbegin iterator.
Definition at line 641 of file sequence_tpl.h.
|
noexcept |
Returns the unsafe rend iterator.
Definition at line 680 of file sequence_tpl.h.
|
noexcept |
Returns the safe rend iterator.
Definition at line 650 of file sequence_tpl.h.
INLINE void gum::SequenceImplementation< Key, Alloc >::resize | ( | Size | new_size | ) |
Modifies the size of the internal structures of the sequence.
This function is provided for optimization issues. When you know you will have to insert elements into the sequence, it may be faster to use this function prior to the additions because it will change once and for all the sizes of all the internal containers. Note that if you provide a size that is smaller than the number of elements of the sequence, the function will not modify anything.
new_size | The internal structure new size. |
Definition at line 686 of file sequence_tpl.h.
Referenced by gum::operator<<(), and gum::SequenceImplementation< gum::prm::PRMClassElement< double > *, std::allocator< gum::prm::PRMClassElement< double > *>, std::is_scalar< gum::prm::PRMClassElement< double > *>::value >::resize().
INLINE void gum::SequenceImplementation< Key, Alloc, Gen >::setAtPos | ( | Idx | i, |
const Key & | newKey | ||
) |
Change the value.
i | The element's position. |
newKey | The element's new value. |
NotFound | Raised if the element does not exist. |
DuplicateElement | Raised if newKey alreay exists. |
Definition at line 525 of file sequence_tpl.h.
Referenced by gum::prm::PRMClass< double >::__inheritClass().
INLINE void gum::SequenceImplementation< Key, Alloc, Gen >::setAtPos | ( | Idx | i, |
Key && | newKey | ||
) |
Change the value.
i | The element's position. |
newKey | The element's new value. |
NotFound | Raised if the element does not exist. |
DuplicateElement | Raised if newKey alreay exists. |
Definition at line 536 of file sequence_tpl.h.
|
noexcept |
Returns the size of the sequence.
Definition at line 38 of file sequence_tpl.h.
Referenced by gum::SequenceImplementation< gum::prm::PRMClassElement< double > *, std::allocator< gum::prm::PRMClassElement< double > *>, std::is_scalar< gum::prm::PRMClassElement< double > *>::value >::__copy(), gum::prm::StructuredInference< GUM_SCALAR >::__removeBarrenNodes(), gum::DiGraph::__topologicalOrder(), gum::GibbsOperator< GUM_SCALAR >::__updateSamplingNodes(), gum::SequenceImplementation< gum::prm::PRMClassElement< double > *, std::allocator< gum::prm::PRMClassElement< double > *>, std::is_scalar< gum::prm::PRMClassElement< double > *>::value >::empty(), gum::GibbsOperator< GUM_SCALAR >::nextSample(), gum::SequenceImplementation< gum::prm::PRMClassElement< double > *, std::allocator< gum::prm::PRMClassElement< double > *>, std::is_scalar< gum::prm::PRMClassElement< double > *>::value >::operator==(), and gum::ArgMaxSet< GUM_SCALAR_VAL, GUM_SCALAR_SEQ >::size().
INLINE void gum::SequenceImplementation< Key, Alloc >::swap | ( | Idx | i, |
Idx | j | ||
) |
Swap index.
i | The index of the first elt to swap. |
j | The index of the other elt to swap. |
Definition at line 547 of file sequence_tpl.h.
std::string gum::SequenceImplementation< Key, Alloc >::toString | ( | ) | const |
Displays the content of the sequence.
Definition at line 574 of file sequence_tpl.h.
Referenced by gum::operator<<().
|
friend |
Friends to speed up access.
Definition at line 94 of file sequence.h.
|
friend |
Friends to speed up access.
Definition at line 96 of file sequence.h.
|
friend |
Friends to speed up access.
Definition at line 95 of file sequence.h.
|
private |
Stores the end iterator for fast access.
Definition at line 510 of file sequence.h.
|
private |
Keep track of the position of the element in v (for fast retrieval).
Definition at line 500 of file sequence.h.
|
private |
Stores the rend iterator for fast access.
Definition at line 513 of file sequence.h.
|
private |
The set of the elements stored into the sequence.
Definition at line 503 of file sequence.h.
Referenced by gum::SequenceImplementation< gum::prm::PRMClassElement< double > *, std::allocator< gum::prm::PRMClassElement< double > *>, std::is_scalar< gum::prm::PRMClassElement< double > *>::value >::__copy(), gum::SequenceImplementation< gum::prm::PRMClassElement< double > *, std::allocator< gum::prm::PRMClassElement< double > *>, std::is_scalar< gum::prm::PRMClassElement< double > *>::value >::operator=(), and gum::SequenceImplementation< gum::prm::PRMClassElement< double > *, std::allocator< gum::prm::PRMClassElement< double > *>, std::is_scalar< gum::prm::PRMClassElement< double > *>::value >::operator==().