Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
BitVector Class Reference

Custom class to handle packed vectors of bits. More...

#include <bitvector.hpp>

Public Member Functions

 BitVector (size_t num_bits)
 
BB_INLINE void set (size_t index, bool value) noexcept
 
BB_INLINE bool get (size_t index) const noexcept
 
void clear ()
 
size_t size () const
 
uint64_traw_data ()
 
const uint64_traw_data () const
 

Private Attributes

size_t num_bits_
 
std::vector< uint64_tdata_
 

Detailed Description

Custom class to handle packed vectors of bits.

The cpp std::vector<bool> does not guarantee memory adjacency of values, and has no fast primitive for clearing all bits in the vector. This is to avoid needing to clear all Pippenger buckets every round

Definition at line 15 of file bitvector.hpp.

Constructor & Destructor Documentation

◆ BitVector()

BitVector::BitVector ( size_t  num_bits)
inline

Definition at line 17 of file bitvector.hpp.

Member Function Documentation

◆ clear()

void BitVector::clear ( )
inline

Definition at line 44 of file bitvector.hpp.

◆ get()

BB_INLINE bool BitVector::get ( size_t  index) const
inlinenoexcept

Definition at line 36 of file bitvector.hpp.

◆ raw_data() [1/2]

uint64_t * BitVector::raw_data ( )
inline

Definition at line 54 of file bitvector.hpp.

◆ raw_data() [2/2]

const uint64_t * BitVector::raw_data ( ) const
inline

Definition at line 55 of file bitvector.hpp.

◆ set()

BB_INLINE void BitVector::set ( size_t  index,
bool  value 
)
inlinenoexcept

Definition at line 22 of file bitvector.hpp.

◆ size()

size_t BitVector::size ( ) const
inline

Definition at line 51 of file bitvector.hpp.

Member Data Documentation

◆ data_

std::vector<uint64_t> BitVector::data_
private

Definition at line 59 of file bitvector.hpp.

◆ num_bits_

size_t BitVector::num_bits_
private

Definition at line 58 of file bitvector.hpp.


The documentation for this class was generated from the following file: