|
A library for working with phylogenetic and population genetic data.
v0.32.0
|
|
Go to the documentation of this file. 1 #ifndef GENESIS_UTILS_MATH_TWOBIT_VECTOR_ITERATOR_DELETIONS_H_
2 #define GENESIS_UTILS_MATH_TWOBIT_VECTOR_ITERATOR_DELETIONS_H_
120 if( pos_ < vec_.
size() ) {
122 auto tmp = vec_.
get( pos_ );
133 vec_.
set( pos_, cur_ );
159 return ( origin_ == other.origin_ ) && ( pos_ == other.pos_ );
164 return !( other == *this );
231 #endif // include guard
bool operator==(self_type const &other) const
bool operator!=(self_type const &other) const
uint64_t WordType
Underlying word type for the bitvector.
utils::Range< IteratorDeletions > iterate_deletions(TwobitVector const &vector)
~IteratorDeletions()=default
std::forward_iterator_tag iterator_category
void set(size_t index, ValueType value)
Set a value at a position in the vector.
TwobitVector::WordType hash() const
Get the hash value of the current vector.
value_type const & operator*()
Take a TwobitVector sequence and iterate over all possible deletions of its values.
void clear()
Clear the vector, so that it contains no data.
IteratorDeletions & operator=(IteratorDeletions const &)=default
ValueType
Value Type enumeration for the elements of a TwobitVector.
Simple wrapper for typical begin() and end() iterators, to be used in range-based for loops.
Container namespace for all symbols of genesis in order to keep them separate when used as a library.
static const size_t kValuesPerWord
Constant that holds the number of values (of tyoe ValueType) that are stored in a single word in the ...
IteratorDeletions(TwobitVector const &vector)
void remove_at(size_t index)
Remove the value at a position.
WordType hash() const
Calculate a hash value of the vector, based on its size() and the xor of all its words.
size_t size() const
Return the size of the vector, that is, how many values (of type ValueType) it currently holds.
ValueType get(size_t index) const
Get the value at a position in the vector.
value_type const * operator->()
TwobitVector const & vector() const
Get the current vector.
size_t position() const
Get the position that is currently deleted.