|
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_H_
2 #define GENESIS_UTILS_MATH_TWOBIT_VECTOR_H_
145 std::vector<WordType> data_;
152 #endif // include guard
WordType const & data_at(size_t index) const
Return a single word of the vector.
size_t data_size() const
Return the number of words (of type WordType) that are used to store the values in the 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.
bool operator!=(TwobitVector const &other) const
Inequality operator, opposite of operator==().
bool validate() const
Validation function that checks some basic invariants.
ValueType operator[](size_t index) const
Alias for get().
void clear()
Clear the vector, so that it contains no data.
bool operator==(TwobitVector const &other) const
Equality operator.
ValueType
Value Type enumeration for the elements of a TwobitVector.
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 ...
void remove_at(size_t index)
Remove the value at a position.
TwobitVector & operator=(TwobitVector const &)=default
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.