File vector_bit.hpp

class BitVector : public ClearableViewDecorator<VectorDecorator<AllocatedVector<uint32>>>
#include <vector_bit.hpp>

An one-dimension vector that stores binary data in a space-efficient way.

Public Functions

BitVector(uint32 numElements, bool init = false)
Parameters:
  • numElements – The number of elements in the vector

  • init – True, if all elements in the vector should be value-initialized, false otherwise

bool operator[](uint32 pos) const

Returns the value of the element at a specific position.

Parameters:

pos – The position of the element

Returns:

The value of the specified element

void set(uint32 pos, bool value)

Sets a value to the element at a specific position.

Parameters:
  • pos – The position of the element

  • value – The value to be set

uint32 getNumElements() const

Returns the number of elements in the vector.

Returns:

The number of elements in the vector

Private Members

const uint32 numElements_