Go to the documentation of this file. 1 #ifndef BMSPARSEVEC_H__INCLUDED__
2 #define BMSPARSEVEC_H__INCLUDED__
32 #ifndef BM__H__INCLUDED__
35 # error missing include (bm.h or bm64.h)
80 template<
class Val,
class BV>
131 {
return bool(*
this) == bool(ref); }
178 {
return (pos_ == it.pos_) && (sv_ == it.sv_); }
182 {
return pos_ < it.pos_; }
184 {
return pos_ <= it.pos_; }
186 {
return pos_ > it.pos_; }
188 {
return pos_ >= it.pos_; }
228 n_buf_size = 1024 * 8
278 this->
flush(); sv_ = bi.sv_; bv_null_ = bi. bv_null_;
336 n_buf_size = 1024 * 8
415 {
return reference(*
this, idx); }
423 {
return this->
get(idx); }
542 bool set_not_null =
true);
552 bool set_not_null =
true);
580 bool zero_mem =
true)
const;
817 bool zero_mem = true) const;
826 bool zero_mem = true) const;
905 *idx_from = from; *idx_to = to;
return true;
921 template<
class Val,
class BV>
932 template<
class Val,
class BV>
940 template<
class Val,
class BV>
943 parent_type::swap(sv);
951 template<
class Val,
class BV>
957 template<
class Val,
class BV>
960 parent_type::swap(sv);
965 template<
class Val,
class BV>
969 throw std::range_error(err_msg);
977 template<
class Val,
class BV>
980 BV::throw_bad_alloc();
985 template<
class Val,
class BV>
993 template<
class Val,
class BV>
999 unsigned char b_list[
sizeof(Val)*8];
1000 unsigned row_len[
sizeof(Val)*8] = {0, };
1002 const unsigned transpose_window = 256;
1006 throw_range_error(
"sparse_vector range error (import size 0)");
1008 if (offset < this->size_)
1011 this->clear_range(offset, offset + arr_size - 1);
1021 for (i = 0; i < arr_size; ++i)
1026 for (
unsigned j = 0; j < bcnt; ++j)
1028 unsigned p = b_list[j];
1029 unsigned rl = row_len[p];
1030 tm.row(p)[rl] = bit_idx;
1033 if (rl == transpose_window)
1046 for (
unsigned k = 0; k < tm.rows(); ++k)
1048 unsigned rl = row_len[k];
1058 if (i + offset > this->size_)
1059 this->size_ = i + offset;
1065 bv_null->
set_range(offset, offset + arr_size - 1);
1071 template<
class Val,
class BV>
1076 this->
import(arr, arr_size, this->size(), set_not_null);
1081 template<
class Val,
class BV>
1086 bool zero_mem)
const
1088 return extract(arr, dec_size, idx_from, zero_mem);
1093 template<
class Val,
class BV>
1106 arr[0] = this->get(idx[0]);
1109 ::memset(arr, 0,
sizeof(value_type)*size);
1113 bool sorted_block =
true;
1128 sorted_block = !(idx[r] < idx_prev);
1134 sorted_block =
false;
1135 for (; r < size; ++r)
1160 arr[i] = this->get(idx[i]);
1170 unsigned eff_plains = this->effective_plains();
1171 for (
unsigned j = 0; j < eff_plains; ++j)
1173 const bm::word_t* blk = this->bmatr_.get_block(j, i0, j0);
1177 const value_type mask1 = 1;
1198 unsigned gap_value = gap_blk[gidx];
1201 arr[k] |= vm = (mask1 << j);
1202 for (++k; k < r; ++k)
1225 arr[k] |= (value_type(
bool(is_set)) << j);
1242 template<
class Val,
class BV>
1247 bool zero_mem)
const
1252 ::memset(arr, 0,
sizeof(value_type)*size);
1256 if (end > this->size_)
1272 for (
unsigned j = 0; j <
sizeof(Val)*8; ++j)
1274 blk = this->bmatr_.get_block(j, i0, j0);
1285 blk = this->bmatr_.get_block(j, i0, j0);
1306 is_set = (blk[nword] & mask0);
1310 value_type vm = (bool) is_set;
1322 template<
class Val,
class BV>
1327 bool zero_mem)
const
1333 ::memset(arr, 0,
sizeof(value_type)*size);
1337 if (end > this->size_)
1342 for (
size_type i = 0; i < parent_type::value_bits(); ++i)
1348 value_type mask = 1;
1350 typename BV::enumerator en(bv, offset);
1351 for (;en.valid(); ++en)
1367 template<
class Val,
class BV>
1377 struct sv_decode_visitor_func
1379 sv_decode_visitor_func(value_type*
BMRESTRICT varr,
1382 : arr_(varr), mask_(mask), sv_off_(off)
1386 const unsigned char* bits,
unsigned bits_size)
BMNOEXCEPT
1390 value_type m = mask_;
1391 for (
unsigned i = 0; i < bits_size; ++i)
1392 arr_[bits[i] + base] |= m;
1396 auto base = bv_offset - sv_off_;
1397 value_type m = mask_;
1399 arr_[i + base] |= m;
1411 ::memset(arr, 0,
sizeof(value_type)*size);
1414 if (end > this->size_)
1417 sv_decode_visitor_func func(arr, 0, offset);
1419 for (
size_type i = 0; i < parent_type::value_bits(); ++i)
1424 func.mask_ = (value_type(1) << i);
1427 return end - offset;
1432 template<
class Val,
class BV>
1436 if (idx >= this->size_)
1437 throw_range_error(
"sparse vector range error");
1438 return this->get(idx);
1443 template<
class Val,
class BV>
1452 unsigned eff_plains = this->effective_plains();
1453 for (
unsigned j = 0; j < eff_plains; j+=4)
1455 bool b = this->bmatr_.test_4rows(j);
1458 value_type vm = (value_type)this->bmatr_.get_half_octet(i, j);
1468 template<
class Val,
class BV>
1473 this->size_ = idx+1;
1480 template<
class Val,
class BV>
1484 this->size_ = idx+1;
1486 set_value(idx, (value_type)0);
1491 bv_null->
set(idx,
false);
1497 template<
class Val,
class BV>
1500 set_value(this->size_, v);
1506 template<
class Val,
class BV>
1513 this->size_ += count;
1519 template<
class Val,
class BV>
1524 this->size_ = idx+1;
1528 insert_value(idx, v);
1533 template<
class Val,
class BV>
1536 insert_value_no_null(idx, v);
1537 this->insert_null(idx,
true);
1542 template<
class Val,
class BV>
1546 value_type mask = 1u;
1548 for (; i <= bsr; ++i)
1564 unsigned eff_plains = this->effective_plains();
1565 for (; i < eff_plains; ++i)
1577 template<
class Val,
class BV>
1581 if (idx >= this->size_)
1583 this->erase_column(idx);
1590 template<
class Val,
class BV>
1593 set_value_no_null(this->size_, v);
1599 template<
class Val,
class BV>
1602 set_value_no_null(idx, v);
1610 template<
class Val,
class BV>
1620 unsigned eff_plains = this->effective_plains();
1623 for (
unsigned i = bsr; i < eff_plains; ++i)
1625 const bm::word_t* blk = this->bmatr_.get_block(i, i0, j0);
1636 value_type mask = 1u;
1637 for (
unsigned j = 0; j <= bsr; ++j)
1646 const bm::word_t* blk = this->bmatr_.get_block(j, i0, j0);
1660 template<
class Val,
class BV>
1663 if (idx >= this->size_)
1664 this->size_ = idx+1;
1666 for (
unsigned i = 0; i < parent_type::sv_value_plains; ++i)
1669 bool carry_over = bv->
inc(idx);
1680 template<
class Val,
class BV>
1683 parent_type::clear();
1688 template<
class Val,
class BV>
1698 template<
class Val,
class BV>
1705 parent_type::clear_range(left, right, set_null);
1711 template<
class Val,
class BV>
1717 parent_type::calc_stat(&stbv);
1727 template<
class Val,
class BV>
1735 parent_type::optimize(temp_block, opt_mode, st ? &stbv : 0);
1746 template<
class Val,
class BV>
1749 unsigned stored_plains = this->stored_plains();
1750 for (
unsigned j = 0; j < stored_plains; ++j)
1762 template<
class Val,
class BV>
1767 if (this->size_ < arg_size)
1774 plains = this->stored_plains();
1776 plains = this->plains();
1778 for (
unsigned j = 0; j < plains; ++j)
1785 bv = this->get_plain(j);
1801 template<
class Val,
class BV>
1806 if (this->size_ < arg_size)
1813 plains = this->stored_plains();
1815 plains = this->plains();
1817 for (
unsigned j = 0; j < plains; ++j)
1824 bv = this->get_plain(j);
1840 template<
class Val,
class BV>
1849 this->copy_range_plains(sv, left, right, splice_null);
1850 this->resize(sv.
size());
1854 template<
class Val,
class BV>
1862 plains = this->stored_plains();
1866 plains = this->plains();
1868 for (
unsigned j = 0; j < plains; ++j)
1878 template<
class Val,
class BV>
1883 value_type sv_value = get(idx);
1884 return (sv_value > val) - (sv_value < val);
1889 template<
class Val,
class BV>
1893 return parent_type::equal(sv, null_able);
1898 template<
class Val,
class BV>
1903 return it_type(
this);
1908 template<
class Val,
class BV>
1912 this->bmatr_.set_allocator_pool(pool_ptr);
1921 template<
class Val,
class BV>
1923 : sv_(0), pos_(
bm::
id_max), buf_ptr_(0)
1928 template<
class Val,
class BV>
1931 : sv_(it.sv_), pos_(it.pos_), buf_ptr_(0)
1936 template<
class Val,
class BV>
1940 : sv_(sv), buf_ptr_(0)
1948 template<
class Val,
class BV>
1949 sparse_vector<Val, BV>::const_iterator::const_iterator(
1950 const typename sparse_vector<Val, BV>::const_iterator::sparse_vector_type* sv,
1951 typename sparse_vector<Val, BV>::size_type pos)
BMNOEXCEPT
1952 : sv_(sv), buf_ptr_(0)
1960 template<
class Val,
class BV>
1963 pos_ = (!sv_ || pos >= sv_->size()) ?
bm::id_max : pos;
1969 template<
class Val,
class BV>
1975 if (pos_ >= sv_->size())
1983 if (buf_ptr_ - ((
value_type*)buffer_.data()) >= n_buf_size)
1991 template<
class Val,
class BV>
2000 buffer_.reserve(n_buf_size *
sizeof(
value_type));
2002 sv_->extract(buf_ptr_, n_buf_size, pos_,
true);
2010 template<
class Val,
class BV>
2021 if (++buf_ptr_ < buf_end)
2026 if (pos_ >= sv_->size())
2031 if (buf_ptr_ >= buf_end)
2038 template<
class Val,
class BV>
2041 return sv_->is_null(pos_);
2050 template<
class Val,
class BV>
2052 : sv_(0), bv_null_(0), buf_ptr_(0), prev_nb_(0), set_not_null_(true)
2057 template<
class Val,
class BV>
2060 : sv_(sv), buf_ptr_(0), set_not_null_(true)
2065 bv_null_ = sv_->get_null_bvect();
2069 bv_null_ = 0; prev_nb_ = 0;
2075 template<
class Val,
class BV>
2078 : sv_(bi.sv_), bv_null_(bi.bv_null_), buf_ptr_(0), prev_nb_(bi.prev_nb_),
2079 set_not_null_(bi.set_not_null_)
2086 template<
class Val,
class BV>
2094 template<
class Val,
class BV>
2098 size_type buf_idx = this->add_value_no_null(v);
2102 bv_null_->set_bit_no_check(sz + buf_idx);
2108 template<
class Val,
class BV>
2116 buffer_.reserve(n_buf_size *
sizeof(
value_type));
2122 if (buf_ptr_ - ((
value_type*)buffer_.data()) >= n_buf_size)
2136 template<
class Val,
class BV>
2145 template<
class Val,
class BV>
2157 sv_->push_back_null(count);
2163 template<
class Val,
class BV>
2166 return (!buf_ptr_ || !sv_);
2171 template<
class Val,
class BV>
2177 sv_->import_back(d,
size_type(buf_ptr_ - d),
false);
2183 sv_->optimize_block(prev_nb_);
bool inc(size_type n)
Increment the specified element.
bm::byte_buffer< allocator_type > buffer_type
sparse_vector< Val, BV > & clear_range(size_type left, size_type right, bool set_null=false)
clear range (assign bit 0 for all plains)
void push_back_null(size_type count)
push back specified amount of NULL values
bvector< Alloc > & set_range(size_type left, size_type right, bool value=true)
Sets all bits in the specified closed interval [left,right] Interval must be inside the bvector's siz...
void insert_value(size_type idx, value_type v)
insert value without checking boundaries
void optimize(bm::word_t *temp_block=0, typename bvector_type::optmode opt_mode=bvector_type::opt_compress, typename sparse_vector< Val, BV >::statistics *stat=0)
run memory optimization for all vector plains
void set_value_no_null(size_type idx, value_type v)
set value without checking boundaries or support of NULL
bvector_type * get_null_bvect() const BMNOEXCEPT
Get access to not-null vector.
bmatrix_type bmatr_
bit-transposed matrix
friend back_insert_iterator
sparse vector de-serializer
bool operator!=(const const_iterator &it) const BMNOEXCEPT
size_t remap_size() const BMNOEXCEPT
unsigned char * init_remap_buffer() BMNOEXCEPT
optmode
Optimization mode Every next level means additional checks (better compression vs time)
sparse_vector_type::size_type size_type
sparse vector with runtime compression using bit transposition method
back_insert_iterator & operator++(int)
noop
bool operator==(const const_iterator &it) const BMNOEXCEPT
const_iterator() BMNOEXCEPT
Base class for bit-transposed sparse vector construction.
bm::bvector< Alloc > & bit_and(const bm::bvector< Alloc > &bv1, const bm::bvector< Alloc > &bv2, typename bm::bvector< Alloc >::optmode opt_mode)
3-operand AND : this := bv1 AND bv2
value_type operator[](size_type idx) const BMNOEXCEPT
get specified element without bounds checking
@ no_null
do not support NULL values
bvector_type::allocator_type::allocator_pool_type allocator_pool_type
@ BM_SORTED_UNIFORM
sorted and in one block (internal!)
void resize_internal(size_type sz)
sparse_vector_type * sparse_vector_type_ptr
bvector_type * bvector_type_ptr
void set_bit_no_check(size_type n)
Set bit without checking preconditions (size, etc)
@ BM_SORTED
input set is sorted (ascending order)
bm::basic_bmatrix< BV > bmatrix_type
bool resolve_range(size_type from, size_type to, size_type *idx_from, size_type *idx_to) const BMNOEXCEPT
bvector_type::block_idx_type block_idx_type
Constant iterator designed to enumerate "ON" bits.
void push_back_no_null(value_type v)
push value back into vector without NULL semantics
algorithms for sparse_vector scan/search
void insert_value_no_null(size_type idx, value_type v)
insert value without checking boundaries or support of NULL
void sync(bool)
syncronize internal structures
bvector_type::block_idx_type block_idx_type
#define BM_ASSERT_THROW(x, xerrcode)
sparse_vector< Val, BV > sparse_vector_type
void disable_set_null() BMNOEXCEPT
Reconfшпгку back inserter not to touch the NULL vector.
static bool is_compressed() BMNOEXCEPT
trait if sparse vector is "compressed" (false)
const unsigned set_word_shift
static void throw_bad_alloc()
throw bad alloc
void flush()
flush the accumulated buffer
bm::byte_buffer< allocator_type > buffer_type
sparse_vector_type * sparse_vector_type_ptr
back_insert_iterator & operator*()
noop
BV::allocator_type allocator_type
bool is_null() const BMNOEXCEPT
bvector_type::allocation_policy allocation_policy_type
static size_type translate_address(size_type i) BMNOEXCEPT
address translation for this type of container
void add(value_type v)
add value to the container
std::input_iterator_tag iterator_category
back_insert_iterator & operator=(value_type v)
push value to the vector
bool equal(const sparse_vector< Val, BV > &sv, bm::null_support null_able=bm::use_null) const BMNOEXCEPT
check if another sparse vector has the same content and size
allocator_type::allocator_pool_type allocator_pool_type
void set_allocator_pool(allocator_pool_type *pool_ptr) BMNOEXCEPT
Set allocator pool for local (non-threaded) memory cyclic(lots of alloc-free ops) opertations.
sparse_vector_type::size_type size_type
unsigned short bitscan(V w, B *bits) BMNOEXCEPT
bool is_remap() const BMNOEXCEPT
bool operator==(const reference &ref) const BMNOEXCEPT
const_iterator & operator++(int)
Advance to the next available value.
const_iterator get_const_iterator(size_type idx) const BMNOEXCEPT
Get const_itertor re-positioned to specific element.
size_type extract(value_type *arr, size_type size, size_type offset=0, bool zero_mem=true) const BMNOEXCEPT2
Bulk export list of elements to a C-style array.
pre-processor un-defines to avoid global space pollution (internal)
int compare(size_type idx, const value_type val) const BMNOEXCEPT
Compare vector element with argument.
size_type gather(value_type *arr, const size_type *idx, size_type size, bm::sort_order sorted_idx) const
Gather elements to a C-style array.
const_iterator & operator++() BMNOEXCEPT
Advance to the next available value.
back_insert_iterator & operator=(const back_insert_iterator &bi)
@ use_null
support "non-assigned" or "NULL" logic
bm::id64_t idx_arr_block_lookup_u64(const bm::id64_t *idx, bm::id64_t size, bm::id64_t nb, bm::id64_t start) BMNOEXCEPT
block boundaries look ahead U32
bvector< Alloc > & set(size_type n, bool val=true)
Sets bit n if val is true, clears bit n if val is false.
@ BM_UNKNOWN
sort order unknown
bvector_type::allocator_type allocator_type
const unsigned set_block_mask
void set_null(size_type idx)
set specified element to unassigned value (NULL)
const unsigned set_array_mask
size_type extract_range(value_type *arr, size_type size, size_type offset, bool zero_mem=true) const
extract small window without use of masking vector
const_iterator end() const BMNOEXCEPT
Provide const iterator access to the end
void xor_swap(W &x, W &y) BMNOEXCEPT
XOR swap two scalar variables.
bool is_nullable() const BMNOEXCEPT
check if container supports NULL(unassigned) values
~sparse_vector() BMNOEXCEPT
allocator_type::allocator_pool_type allocator_pool_type
Const iterator to traverse the sparse vector.
bvector_type::allocator_type::allocator_pool_type allocator_pool_type
sparse_vector_type::bvector_type bvector_type
bvector_type::block_idx_type block_idx_type
size_type effective_size() const BMNOEXCEPT
size of sparse vector (may be different for RSC)
bvector_type_const_ptr get_row(size_type i) const BMNOEXCEPT
unsigned idx_arr_block_lookup_u32(const unsigned *idx, unsigned size, unsigned nb, unsigned start) BMNOEXCEPT
block boundaries look ahead U32
void add_null()
add NULL (no-value) to the container
sparse_vector_type::value_type value_type
void go_to(size_type pos) BMNOEXCEPT
re-position to a specified position
void bit_block_gather_scatter(unsigned *BMRESTRICT arr, const bm::word_t *BMRESTRICT blk, const unsigned *BMRESTRICT idx, unsigned size, unsigned start, unsigned bit_idx) BMNOEXCEPT
bit index to word gather-scatter algorithm (SIMD)
bool operator<=(const const_iterator &it) const BMNOEXCEPT
@ opt_compress
compress blocks when possible (GAP/prefix sum)
const typedef value_type & const_reference
void invalidate() BMNOEXCEPT
Invalidate current iterator.
bool operator<(const const_iterator &it) const BMNOEXCEPT
#define FULL_BLOCK_FAKE_ADDR
size_type size_
array size
size_type size_internal() const BMNOEXCEPT
unsigned short gap_word_t
void optimize_gap_size()
Optimize sizes of GAP blocks.
size_type size() const BMNOEXCEPT
return size of the vector
void resize(size_type new_size)
const unsigned set_array_shift
void erase(size_type idx)
erase specified element from container
void calc_stat(struct sparse_vector< Val, BV >::statistics *st) const BMNOEXCEPT
Calculates memory statistics.
bool empty() const
return true if insertion buffer is empty
const_iterator begin() const BMNOEXCEPT
Provide const iterator access to container content
sparse_vector< Val, BV > sparse_vector_type
value_type get(size_type idx) const BMNOEXCEPT
get specified element without bounds checking
void insert(size_type idx, value_type v)
insert specified element into container
bool insert(size_type n, bool value)
Insert bit into specified position All the vector content after insert position is shifted right.
void push_back(value_type v)
push value back into vector
sparse_vector_type::value_type value_type
Basic dense bit-matrix class.
size_type add_value_no_null(value_type v)
add value to the buffer without changing the NULL vector
back_insert_iterator & operator++()
noop
void copy_from(const base_sparse_vector< Val, BV, MAX_SIZE > &bsv)
sparse_vector(bm::null_support null_able=bm::no_null, allocation_policy_type ap=allocation_policy_type(), size_type bv_max_size=bm::id_max, const allocator_type &alloc=allocator_type())
Sparse vector constructor.
unsigned gap_test_unr(const T *BMRESTRICT buf, const unsigned pos) BMNOEXCEPT
Tests if bit = pos is true. Analog of bm::gap_test with SIMD unrolling.
reference(sparse_vector< Val, BV > &sv, size_type idx) BMNOEXCEPT
sparse_vector_type::bvector_type bvector_type
const typedef bvector_type * bvector_type_const_ptr
size_type pos() const BMNOEXCEPT
Current position (index) in the vector.
void skip_zero_values() BMNOEXCEPT
Mini-matrix for bit transposition purposes.
void copy_range(const sparse_vector< Val, BV > &sv, size_type left, size_type right, bm::null_support splice_null=bm::use_null)
copy range of values from another sparse vector
back_insert_iterator get_back_inserter()
Provide back insert iterator Back insert iterator implements buffered insertion, which is faster,...
Rank-Select compressed sparse vector.
sparse_vector< Val, BV > & operator=(const sparse_vector< Val, BV > &sv)
sparse_vector< Val, BV > & merge(sparse_vector< Val, BV > &sv)
merge with another sparse vector using OR operation Merge is different from join(),...
bool advance() BMNOEXCEPT
advance iterator forward by one
void reset() BMNOEXCEPT
Reset statisctics.
unsigned gap_bfind(const T *BMRESTRICT buf, unsigned pos, unsigned *BMRESTRICT is_set) BMNOEXCEPT
void clear_bit_no_check(size_type n)
Clears bit n without precondiion checks.
basic bit-matrix class and utilities
reference & operator=(const reference &ref)
bool operator>(const const_iterator &it) const BMNOEXCEPT
const unsigned set_block_shift
base_sparse_vector< Val, BV, 1 > parent_type
value_type operator*() const
Get current position (value)
size_type effective_vector_max() const BMNOEXCEPT
Always 1 (non-matrix type)
value_type at(size_type idx) const
access specified element with bounds checking
blocks_manager_type::block_idx_type block_idx_type
#define IS_FULL_BLOCK(addr)
void merge(bm::bvector< Alloc > &bvect)
Merge/move content from another vector.
sort_order
Sort order declaration.
void optimize_gap_size()
Optimize sizes of GAP blocks.
static void throw_range_error(const char *err_msg)
throw range error
size_type decode(value_type *arr, size_type idx_from, size_type dec_size, bool zero_mem=true) const
Bulk export list of elements to a C-style array.
bool valid() const BMNOEXCEPT
Returns true if iterator is at a valid position.
void set_remap() BMNOEXCEPT
bool empty() const BMNOEXCEPT
return true if vector is empty
const bvector_type * row(size_type i) const BMNOEXCEPT
unsigned bit_scan_reverse(T value) BMNOEXCEPT
Reference class to access elements via common [] operator.
null_support
NULL-able value support.
size_type extract_plains(value_type *arr, size_type size, size_type offset, bool zero_mem=true) const
extract medium window without use of masking vector
void clear() BMNOEXCEPT
resize to zero, free memory
Utilities for bit transposition (internal) (experimental!)
void filter(const bvector_type &bv_mask)
Apply value filter, defined by mask vector.
void import_back(const value_type *arr, size_type arr_size, bool set_not_null=true)
Import list of elements from a C-style array (pushed back)
void set_value(size_type idx, value_type v)
set value without checking boundaries
const unsigned set_word_mask
sparse_vector< Val, BV > & join(const sparse_vector< Val, BV > &sv)
join all with another sparse vector using OR operation
value_type value() const
Get current position (value)
bool is_null() const BMNOEXCEPT
Get NULL status.
bvector_type::enumerator bvector_enumerator_type
bool operator>=(const const_iterator &it) const BMNOEXCEPT
void set(size_type idx, value_type v)
set specified element with bounds checking and automatic resize
reference & operator=(value_type val)
bvector_type::size_type size_type
Structure with statistical information about memory allocation footprint, serialization projection,...
bvector_type::allocator_type allocator_type
bm::bvector<> ::size_type size_type
void inc(size_type idx)
increment specified element by one
void add(const bv_statistics &st) BMNOEXCEPT
Sum data from another sttructure.
void swap(sparse_vector< Val, BV > &sv) BMNOEXCEPT
content exchange
@ BM_UNSORTED
input set is NOT sorted
Statistical information about bitset's memory allocation details.
bm::bvector<> ::allocator_type allocator_type
const unsigned char * get_remap_buffer() const BMNOEXCEPT
static bool find_rank(size_type rank, size_type &pos) BMNOEXCEPT
find position of compressed element by its rank
void for_each_bit_range_no_check(const BV &bv, typename BV::size_type left, typename BV::size_type right, Func &bit_functor)
Implementation of for_each_bit_range without boilerplave checks.
Back insert iterator implements buffered insert, faster than generic access assignment.
std::output_iterator_tag iterator_category
void resize(size_type sz)
resize vector