|
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_SUBSTITUTIONS_H_
2 #define GENESIS_UTILS_MATH_TWOBIT_VECTOR_ITERATOR_SUBSTITUTIONS_H_
123 auto cycle = [&] (
size_t pos,
size_t& cnt ) {
134 hash_ ^= ( xor_val << shift );
146 if( pos_ < vec_.
size() - 1 ) {
178 return ( origin_ == other.origin_ ) && ( pos_ == other.pos_ ) && ( cnt_ == other.cnt_ );
183 return !( other == *this );
250 #endif // include guard
~IteratorSubstitutions()=default
WordType const & data_at(size_t index) const
Return a single word of the vector.
uint64_t WordType
Underlying word type for the bitvector.
IteratorSubstitutions(TwobitVector const &vector)
std::forward_iterator_tag iterator_category
TwobitVector const & vector() const
Get the current vector.
void clear()
Clear the vector, so that it contains no data.
utils::Range< IteratorSubstitutions > iterate_substitutions(TwobitVector const &vector)
size_t position() const
Get the position that is currently deleted.
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 ...
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.
value_type const * operator->()
TwobitVector::WordType hash() const
Get the hash value of the current vector.
IteratorSubstitutions & operator=(IteratorSubstitutions const &)=default
bool operator==(self_type const &other) const
bool operator!=(self_type const &other) const
value_type const & operator*()