|
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_INSERTIONS_H_
2 #define GENESIS_UTILS_MATH_TWOBIT_VECTOR_ITERATOR_INSERTIONS_H_
135 hash_ ^= ( hash_xor << shift );
141 }
else if( pos_ < vec_.
size() - 1 ) {
145 auto next = vec_.
get( pos_ + 1 );
146 vec_.
set( pos_, next );
151 hash_ ^= ( hash_xor << shift );
160 hash_ ^= ( hash_xor << shift );
188 return ( origin_ == other.origin_ ) && ( pos_ == other.pos_ ) && ( cnt_ == other.cnt_ );
193 return !( other == *this );
260 #endif // include guard
bool operator!=(self_type const &other) const
size_t position() const
Get the position that is currently deleted.
WordType const & data_at(size_t index) const
Return a single word of the vector.
~IteratorInsertions()=default
std::forward_iterator_tag iterator_category
utils::Range< IteratorInsertions > iterate_insertions(TwobitVector const &vector)
uint64_t WordType
Underlying word type for the bitvector.
void insert_at(size_t index, ValueType value)
Insert a value at a position.
void set(size_t index, ValueType value)
Set a value at a position in the vector.
IteratorInsertions(TwobitVector const &vector)
TwobitVector const & vector() const
Get the current vector.
value_type const & operator*()
void clear()
Clear the vector, so that it contains no data.
TwobitVector::WordType hash() const
Get the hash value of the current vector.
IteratorInsertions & operator=(IteratorInsertions const &)=default
bool operator==(self_type const &other) const
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 ...
value_type const * operator->()
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.