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
TwobitVector & operator=(TwobitVector const &)=default
void insert_at(size_t index, ValueType value)
Insert a value at a position.
bool operator==(TwobitVector const &other) const
Equality operator.
size_t data_size() const
Return the number of words (of type WordType) that are used to store the values in the vector...
static const size_t kValuesPerWord
Constant that holds the number of values (of tyoe ValueType) that are stored in a single word in the ...
size_t size() const
Return the size of the vector, that is, how many values (of type ValueType) it currently holds...
WordType const & data_at(size_t index) const
Return a single word of the vector.
void remove_at(size_t index)
Remove the value at a position.
uint64_t WordType
Underlying word type for the bitvector.
void set(size_t index, ValueType value)
Set a value at a position in the vector.
ValueType operator[](size_t index) const
Alias for get().
WordType hash() const
Calculate a hash value of the vector, based on its size() and the xor of all its words.
bool validate() const
Validation function that checks some basic invariants.
void clear()
Clear the vector, so that it contains no data.
ValueType
Value Type enumeration for the elements of a TwobitVector.
bool operator!=(TwobitVector const &other) const
Inequality operator, opposite of operator==().