Bit vector
0.9
Fast and space efficient dynamic bit vector library.
|
Type defintions for dynamic bit vectors. More...
#include "internal/allocator.hpp"
#include "internal/bit_vector.hpp"
#include "internal/leaf.hpp"
#include "internal/node.hpp"
Go to the source code of this file.
Typedefs | |
template<uint8_t buffer_size, uint64_t leaf_size, uint8_t branching_factor, bool avx = true> | |
using | bv::simple_bv = bit_vector< leaf< buffer_size, avx >, node< leaf< buffer_size >, uint64_t, leaf_size, branching_factor >, malloc_alloc, leaf_size, branching_factor, uint64_t > |
Helper type definition template for bit vector with at most 2^63 elements. More... | |
template<uint8_t buffer_size, uint64_t leaf_size, uint8_t branching_factor, bool avx = true> | |
using | bv::small_bv = bit_vector< leaf< buffer_size, avx >, node< leaf< buffer_size >, uint32_t, leaf_size, branching_factor >, malloc_alloc, leaf_size, branching_factor, uint32_t > |
Helper type definition template for bit vector with at most 2^31 elements. More... | |
typedef simple_bv< 8, 16384, 64 > | bv::bv |
Default dynamic bit vector type. More... | |
Type defintions for dynamic bit vectors.
This file is intended to be included by projects wanting to use dynamic bit vectors by providing more approachable type definitions based on the bv::bit_vector class.
Use the bv::bv type to easily get started working with reasonable default values.
#include "bit_vector/bv.hpp" ... bv::bv bv; bv.insert(0, true); bv.insert(0, false); assert(bv.at(0) == false); assert(bv.at(1) == true); bv.remove(0); assert(bv.at(0) == true); assert(bv.size() == 1);
typedef simple_bv<8, 16384, 64> bv::bv |
Default dynamic bit vector type.
Convenience type based on bv::simple_bv with reasonable default template parameters.
Buffer size = 8, leaf size = 2^14 and branching factor = 64
using bv::simple_bv = typedef bit_vector<leaf<buffer_size, avx>, node<leaf<buffer_size>, uint64_t, leaf_size, branching_factor>, malloc_alloc, leaf_size, branching_factor, uint64_t> |
Helper type definition template for bit vector with at most 2^63 elements.
Uses the default allocator, internal node and leaf implementations packaged in the default bit vector root
buffer_size | Size of the insert/remove buffer in the leaf elements. Needs to be in the [0, 64) range. |
leaf_size | Maximum number of elements stored in a single leaf. Needs to be divisible by 64 and in the [265, 16777215) range. |
branching_factor | Maximum number of children for an internal node. Needs to be one of {8, 16, 32, 64, 128}. |
avx | Should avx population counting be used for rank. |
using bv::small_bv = typedef bit_vector<leaf<buffer_size, avx>, node<leaf<buffer_size>, uint32_t, leaf_size, branching_factor>, malloc_alloc, leaf_size, branching_factor, uint32_t> |
Helper type definition template for bit vector with at most 2^31 elements.
Uses the default allocator, internal node and leaf implementations packaged in the default bit vector root
This implementation uses slightly less space and is slightly faster than bv::simple_bv due to using 32 bit words for internal bookkeeping instead of 64 bit words.
buffer_size | Size of the insert/remove buffer in the leaf elements. 0 <= buffer_size < 64. |
leaf_size | Maximum number of elements stored in a single leaf. 265 <= leaf_size < 16777215. |
branching_factor | Maximum number of children for an internal node. Needs to be one 8, 16, 32, 64 or 128. |
avx | Should avx population counting be used for rank. |