bitvector with runtime compression of bits. More...
#include <bm.h>
Data Structures | |
class | counted_enumerator |
Constant input iterator designed to enumerate "ON" bits counted_enumerator keeps bitcount, ie number of ON bits starting from the position 0 in the bit string up to the currently enumerated bit. More... | |
class | enumerator |
Constant input iterator designed to enumerate "ON" bits. More... | |
class | insert_iterator |
Output iterator iterator designed to set "ON" bits based on input sequence of integers (bit indeces). More... | |
class | iterator_base |
Base class for all iterators. More... | |
class | reference |
Class reference implements an object for bit assignment. More... | |
struct | statistics |
Statistical information about bitset's memory allocation details. More... | |
Public Types | |
enum | optmode { opt_free_0 = 1, opt_free_01 = 2, opt_compress = 3 } |
Optimization mode Every next level means additional checks (better compression vs time). More... | |
typedef Alloc | allocator_type |
typedef blocks_manager< Alloc, MS > | blocks_manager_type |
typedef bm::id_t | size_type |
Type used to count bits in the bit vector. | |
typedef bool | const_reference |
Public Member Functions | |
bvector (strategy strat=BM_BIT, const gap_word_t *glevel_len=bm::gap_len_table< true >::_len, size_type bv_size=bm::id_max, const Alloc &alloc=Alloc()) | |
Constructs bvector class. | |
bvector (size_type bv_size, strategy strat=BM_BIT, const gap_word_t *glevel_len=bm::gap_len_table< true >::_len, const Alloc &alloc=Alloc()) | |
Constructs bvector class. | |
bvector (const bvector< Alloc, MS > &bvect) | |
bvector & | operator= (const bvector< Alloc, MS > &bvect) |
reference | operator[] (bm::id_t n) |
bool | operator[] (bm::id_t n) const |
void | operator&= (const bvector< Alloc, MS > &bvect) |
void | operator^= (const bvector< Alloc, MS > &bvect) |
void | operator|= (const bvector< Alloc, MS > &bvect) |
void | operator-= (const bvector< Alloc, MS > &bvect) |
bool | operator< (const bvector< Alloc, MS > &bvect) const |
bool | operator<= (const bvector< Alloc, MS > &bvect) const |
bool | operator> (const bvector< Alloc, MS > &bvect) const |
bool | operator>= (const bvector< Alloc, MS > &bvect) const |
bool | operator== (const bvector< Alloc, MS > &bvect) const |
bool | operator!= (const bvector< Alloc, MS > &bvect) const |
bvector< Alloc, MS > | operator~ () const |
Alloc | get_allocator () const |
bool | set_bit (bm::id_t n, bool val=true) |
Sets bit n. | |
bool | set_bit_and (bm::id_t n, bool val=true) |
Sets bit n using bit AND with the provided value. | |
bool | set_bit_conditional (bm::id_t n, bool val, bool condition) |
Sets bit n only if current value is equal to the condition. | |
bvector< Alloc, MS > & | set (bm::id_t n, bool val=true) |
Sets bit n if val is true, clears bit n if val is false. | |
bvector< Alloc, MS > & | set () |
Sets every bit in this bitset to 1. | |
bvector< Alloc, MS > & | set_range (bm::id_t left, bm::id_t right, bool value=true) |
Sets all bits in the specified closed interval [left,right] Interval must be inside the bvector's size. This method DOES NOT resize vector. | |
insert_iterator | inserter () |
void | clear_bit (bm::id_t n) |
Clears bit n. | |
void | clear (bool free_mem=false) |
Clears every bit in the bitvector. | |
bvector< Alloc, MS > & | reset () |
Clears every bit in the bitvector. | |
bm::id_t | count () const |
Returns count of bits which are 1. | |
size_type | capacity () const |
Returns bvector's capacity (number of bits it can store). | |
size_type | size () const |
return current size of the vector (bits) | |
void | resize (size_type new_size) |
Change size of the bvector. | |
unsigned | count_blocks (unsigned *arr) const |
Computes bitcount values for all bvector blocks. | |
bm::id_t | count_range (bm::id_t left, bm::id_t right, unsigned *block_count_arr=0) const |
Returns count of 1 bits in the given diapason. | |
bm::id_t | recalc_count () |
void | forget_count () |
bvector< Alloc, MS > & | invert () |
Inverts all bits. | |
bool | get_bit (bm::id_t n) const |
returns true if bit n is set and false is bit n is 0. | |
bool | test (bm::id_t n) const |
returns true if bit n is set and false is bit n is 0. | |
bool | any () const |
Returns true if any bits in this bitset are set, and otherwise returns false. | |
bool | none () const |
Returns true if no bits are set, otherwise returns false. | |
bvector< Alloc, MS > & | flip (bm::id_t n) |
Flips bit n. | |
bvector< Alloc, MS > & | flip () |
Flips all bits. | |
void | swap (bvector< Alloc, MS > &bv) |
Exchanges content of bv and this bitvector. | |
bm::id_t | get_first () const |
Gets number of first bit which is ON. | |
bm::id_t | get_next (bm::id_t prev) const |
Finds the number of the next bit ON. | |
bm::id_t | extract_next (bm::id_t prev) |
Finds the number of the next bit ON and sets it to 0. | |
void | calc_stat (struct bm::bvector< Alloc, MS >::statistics *st) const |
Calculates bitvector statistics. | |
bm::bvector< Alloc, MS > & | bit_or (const bm::bvector< Alloc, MS > &vect) |
Logical OR operation. | |
bm::bvector< Alloc, MS > & | bit_and (const bm::bvector< Alloc, MS > &vect) |
Logical AND operation. | |
bm::bvector< Alloc, MS > & | bit_xor (const bm::bvector< Alloc, MS > &vect) |
Logical XOR operation. | |
bm::bvector< Alloc, MS > & | bit_sub (const bm::bvector< Alloc, MS > &vect) |
Logical SUB operation. | |
void | set_new_blocks_strat (strategy strat) |
Sets new blocks allocation strategy. | |
strategy | get_new_blocks_strat () const |
Returns blocks allocation strategy. | |
void | optimize (bm::word_t *temp_block=0, optmode opt_mode=opt_compress, statistics *stat=0) |
Optimize memory bitvector's memory allocation. | |
void | optimize_gap_size () |
Optimize sizes of GAP blocks. | |
void | set_gap_levels (const gap_word_t *glevel_len) |
Sets new GAP lengths table. All GAP blocks will be reallocated to match the new scheme. | |
int | compare (const bvector< Alloc, MS > &bvect) const |
Lexicographical comparison with a bitvector. | |
bm::word_t * | allocate_tempblock () const |
Allocates temporary block of memory. | |
void | free_tempblock (bm::word_t *block) const |
Frees temporary block of memory. | |
enumerator | first () const |
Returns enumerator pointing on the first non-zero bit. | |
enumerator | end () const |
Returns enumerator pointing on the next bit after the last. | |
const bm::word_t * | get_block (unsigned nb) const |
void | combine_operation (const bm::bvector< Alloc, MS > &bvect, bm::operation opcode) |
void | combine_operation_with_block (unsigned nb, const bm::word_t *arg_blk, int arg_gap, bm::operation opcode) |
const blocks_manager_type & | get_blocks_manager () const |
blocks_manager_type & | get_blocks_manager () |
Friends | |
class | iterator_base |
class | enumerator |
bitvector with runtime compression of bits.
sample1.cpp, sample10.cpp, sample2.cpp, sample3.cpp, sample4.cpp, sample5.cpp, sample6.cpp, sample7.cpp, sample8.cpp, and sample9.cpp.
Definition at line 120 of file bm.h.
typedef Alloc bm::bvector< Alloc, MS >::allocator_type |
typedef blocks_manager<Alloc, MS> bm::bvector< Alloc, MS >::blocks_manager_type |
typedef bool bm::bvector< Alloc, MS >::const_reference |
typedef bm::id_t bm::bvector< Alloc, MS >::size_type |
enum bm::bvector::optmode |
bm::bvector< Alloc, MS >::bvector | ( | strategy | strat = BM_BIT , |
|
const gap_word_t * | glevel_len = bm::gap_len_table<true>::_len , |
|||
size_type | bv_size = bm::id_max , |
|||
const Alloc & | alloc = Alloc() | |||
) | [inline] |
Constructs bvector class.
strat | - operation mode strategy, BM_BIT - default strategy, bvector use plain bitset blocks, (performance oriented strategy). BM_GAP - memory effitent strategy, bvector allocates blocks as array of intervals(gaps) and convert blocks into plain bitsets only when enthropy grows. | |
glevel_len |
| |
bv_size |
|
bm::bvector< Alloc, MS >::bvector | ( | size_type | bv_size, | |
strategy | strat = BM_BIT , |
|||
const gap_word_t * | glevel_len = bm::gap_len_table<true>::_len , |
|||
const Alloc & | alloc = Alloc() | |||
) | [inline] |
bm::bvector< Alloc, MS >::bvector | ( | const bvector< Alloc, MS > & | bvect | ) | [inline] |
bm::word_t* bm::bvector< Alloc, MS >::allocate_tempblock | ( | ) | const [inline] |
Allocates temporary block of memory.
Temp block can be passed to bvector functions requiring some temp memory for their operation. (like serialize)
bool bm::bvector< Alloc, MS >::any | ( | ) | const [inline] |
Returns true if any bits in this bitset are set, and otherwise returns false.
Definition at line 1176 of file bm.h.
References bm::for_each_nzblock_if(), and bm::set_array_size.
Referenced by bm::bvector< Alloc, MS >::none().
bm::bvector<Alloc, MS>& bm::bvector< Alloc, MS >::bit_and | ( | const bm::bvector< Alloc, MS > & | vect | ) | [inline] |
Logical AND operation.
vect | - Argument vector. |
Definition at line 1296 of file bm.h.
References bm::BM_AND, BMCOUNT_VALID, and bm::bvector< Alloc, MS >::combine_operation().
Referenced by bm::operator&(), and bm::bvector< Alloc, MS >::operator&=().
bm::bvector<Alloc, MS>& bm::bvector< Alloc, MS >::bit_or | ( | const bm::bvector< Alloc, MS > & | vect | ) | [inline] |
Logical OR operation.
vect | - Argument vector. |
Definition at line 1285 of file bm.h.
References bm::BM_OR, BMCOUNT_VALID, and bm::bvector< Alloc, MS >::combine_operation().
Referenced by bm::bvector< Alloc, MS >::operator=(), bm::operator|(), and bm::bvector< Alloc, MS >::operator|=().
bm::bvector<Alloc, MS>& bm::bvector< Alloc, MS >::bit_sub | ( | const bm::bvector< Alloc, MS > & | vect | ) | [inline] |
Logical SUB operation.
vect | - Argument vector. |
Definition at line 1318 of file bm.h.
References bm::BM_SUB, BMCOUNT_VALID, and bm::bvector< Alloc, MS >::combine_operation().
Referenced by bm::operator-(), and bm::bvector< Alloc, MS >::operator-=().
bm::bvector<Alloc, MS>& bm::bvector< Alloc, MS >::bit_xor | ( | const bm::bvector< Alloc, MS > & | vect | ) | [inline] |
Logical XOR operation.
vect | - Argument vector. |
Definition at line 1307 of file bm.h.
References bm::BM_XOR, BMCOUNT_VALID, and bm::bvector< Alloc, MS >::combine_operation().
Referenced by bm::operator^(), and bm::bvector< Alloc, MS >::operator^=().
void bm::bvector< Alloc, MS >::calc_stat | ( | struct bm::bvector< Alloc, MS >::statistics * | st | ) | const [inline] |
Calculates bitvector statistics.
st | - pointer on statistics structure to be filled in. |
Function fills statistics structure containing information about how this vector uses memory and estimation of max. amount of memory bvector needs to serialize itself.
Definition at line 2051 of file bm.h.
References bm::bv_statistics::bit_blocks, BM_IS_GAP, BMGAP_PTR, bm::bv_statistics::gap_blocks, bm::gap_capacity(), bm::gap_length(), bm::bv_statistics::gap_length, bm::gap_levels, bm::bv_statistics::gap_levels, IS_VALID_ADDR, bm::bv_statistics::max_serialize_mem, bm::bv_statistics::memory_used, and bm::set_array_size.
Referenced by CreateSets(), FillSets(), bm::bvector< Alloc, MS >::optimize_gap_size(), print_statistics(), and serialize_bvector().
size_type bm::bvector< Alloc, MS >::capacity | ( | ) | const [inline] |
void bm::bvector< Alloc, MS >::clear | ( | bool | free_mem = false |
) | [inline] |
Clears every bit in the bitvector.
free_mem | if "true" (default) bvector frees the memory, otherwise sets blocks to 0. |
Definition at line 1057 of file bm.h.
References BMCOUNT_SET.
Referenced by main(), bm::bvector< Alloc, MS >::operator=(), and bm::bvector< Alloc, MS >::reset().
void bm::bvector< Alloc, MS >::clear_bit | ( | bm::id_t | n | ) | [inline] |
void bm::bvector< Alloc, MS >::combine_operation | ( | const bm::bvector< Alloc, MS > & | bvect, | |
bm::operation | opcode | |||
) | [inline] |
Definition at line 2518 of file bm.h.
References bm::BM_AND, BM_ASSERT, BM_IS_GAP, BM_SET_MMX_GUARD, bm::set_array_size, and bm::bvector< Alloc, MS >::set_range().
Referenced by bm::bvector< Alloc, MS >::bit_and(), bm::bvector< Alloc, MS >::bit_or(), bm::bvector< Alloc, MS >::bit_sub(), and bm::bvector< Alloc, MS >::bit_xor().
void bm::bvector< Alloc, MS >::combine_operation_with_block | ( | unsigned | nb, | |
const bm::word_t * | arg_blk, | |||
int | arg_gap, | |||
bm::operation | opcode | |||
) | [inline] |
Definition at line 1493 of file bm.h.
References BM_IS_GAP, and bm::bvector< Alloc, MS >::get_block().
int bm::bvector< Alloc, MS >::compare | ( | const bvector< Alloc, MS > & | bvect | ) | const [inline] |
Lexicographical comparison with a bitvector.
Function compares current bitvector with the provided argument bit by bit and returns -1 if our bitvector less than the argument, 1 - greater, 0 - equal.
Definition at line 1921 of file bm.h.
References bm::bit_is_all_zero(), bm::bitcmp(), BM_IS_GAP, BMGAP_PTR, bm::gap_convert_to_bitset(), bm::gap_is_all_zero(), bm::gap_max_bits, bm::gapcmp(), bm::set_array_size, and bm::set_block_size_op.
Referenced by bm::bvector< Alloc, MS >::operator!=(), bm::bvector< Alloc, MS >::operator<(), bm::bvector< Alloc, MS >::operator<=(), bm::bvector< Alloc, MS >::operator==(), bm::bvector< Alloc, MS >::operator>(), and bm::bvector< Alloc, MS >::operator>=().
bm::id_t bm::bvector< Alloc, MS >::count | ( | ) | const [inline] |
Returns count of bits which are 1.
Definition at line 1650 of file bm.h.
References BMCOUNT_SET, bm::for_each_nzblock(), and bm::set_array_size.
Referenced by bm::bvector< Alloc, MS >::count_range(), main(), OrSets(), print_statistics(), bm::bvector< Alloc, MS >::recalc_count(), and serialize_bvector().
unsigned bm::bvector< Alloc, MS >::count_blocks | ( | unsigned * | arr | ) | const [inline] |
Computes bitcount values for all bvector blocks.
arr | - pointer on array of block bit counts |
Definition at line 1108 of file bm.h.
References bm::for_each_nzblock(), and bm::set_array_size.
bm::id_t bm::bvector< Alloc, MS >::count_range | ( | bm::id_t | left, | |
bm::id_t | right, | |||
unsigned * | block_count_arr = 0 | |||
) | const [inline] |
Returns count of 1 bits in the given diapason.
left | - index of first bit start counting from | |
right | - index of last bit | |
block_count_arr | - optional parameter (bitcount by bvector blocks) calculated by count_blocks method. Used to improve performance of wide range searches |
Definition at line 1690 of file bm.h.
References bm::bit_block_calc_count_range(), bm::bits_in_block, BM_ASSERT, BM_IS_GAP, BMGAP_PTR, bm::bvector< Alloc, MS >::count(), bm::gap_bit_count_range(), bm::set_block_mask, and bm::set_block_shift.
bvector::enumerator bm::bvector< Alloc, MS >::end | ( | ) | const [inline] |
Returns enumerator pointing on the next bit after the last.
Definition at line 1449 of file bm.h.
Referenced by EnumerateSets(), and main().
bm::id_t bm::bvector< Alloc, MS >::extract_next | ( | bm::id_t | prev | ) | [inline] |
Finds the number of the next bit ON and sets it to 0.
prev | - Index of the previously found bit. |
Definition at line 1262 of file bm.h.
References bm::id_max.
enumerator bm::bvector< Alloc, MS >::first | ( | ) | const [inline] |
Returns enumerator pointing on the first non-zero bit.
Definition at line 1439 of file bm.h.
Referenced by EnumerateSets(), and main().
bvector<Alloc, MS>& bm::bvector< Alloc, MS >::flip | ( | ) | [inline] |
Flips all bits.
Definition at line 1214 of file bm.h.
References bm::bvector< Alloc, MS >::invert().
bvector<Alloc, MS>& bm::bvector< Alloc, MS >::flip | ( | bm::id_t | n | ) | [inline] |
Flips bit n.
Definition at line 1204 of file bm.h.
References bm::bvector< Alloc, MS >::get_bit().
void bm::bvector< Alloc, MS >::forget_count | ( | ) | [inline] |
Disables count cache. Next call to count() or recalc_count() restores count caching.
Definition at line 1144 of file bm.h.
References BMCOUNT_VALID.
void bm::bvector< Alloc, MS >::free_tempblock | ( | bm::word_t * | block | ) | const [inline] |
Frees temporary block of memory.
Alloc bm::bvector< Alloc, MS >::get_allocator | ( | ) | const [inline] |
bool bm::bvector< Alloc, MS >::get_bit | ( | bm::id_t | n | ) | const [inline] |
returns true if bit n is set and false is bit n is 0.
n | - Index of the bit to check. |
Definition at line 1808 of file bm.h.
References BM_ASSERT, BM_IS_GAP, BMGAP_PTR, bm::gap_test(), bm::set_block_mask, bm::set_block_shift, bm::set_word_mask, and bm::set_word_shift.
Referenced by bm::bvector< Alloc, MS >::flip(), bm::bvector< Alloc, MS >::operator[](), and bm::bvector< Alloc, MS >::test().
const bm::word_t* bm::bvector< Alloc, MS >::get_block | ( | unsigned | nb | ) | const [inline] |
Definition at line 1456 of file bm.h.
Referenced by bm::bvector< Alloc, MS >::combine_operation_with_block().
blocks_manager_type& bm::bvector< Alloc, MS >::get_blocks_manager | ( | ) | [inline] |
const blocks_manager_type& bm::bvector< Alloc, MS >::get_blocks_manager | ( | ) | const [inline] |
bm::id_t bm::bvector< Alloc, MS >::get_first | ( | ) | const [inline] |
Gets number of first bit which is ON.
Definition at line 1241 of file bm.h.
Referenced by main(), and print_bvector().
strategy bm::bvector< Alloc, MS >::get_new_blocks_strat | ( | ) | const [inline] |
Returns blocks allocation strategy.
bm::id_t bm::bvector< Alloc, MS >::get_next | ( | bm::id_t | prev | ) | const [inline] |
Finds the number of the next bit ON.
prev | - Index of the previously found bit. |
Definition at line 1250 of file bm.h.
References bm::id_max.
Referenced by main(), and print_bvector().
insert_iterator bm::bvector< Alloc, MS >::inserter | ( | ) | [inline] |
bvector< Alloc, MS > & bm::bvector< Alloc, MS >::invert | ( | ) | [inline] |
Inverts all bits.
Definition at line 1784 of file bm.h.
References BM_SET_MMX_GUARD, BMCOUNT_VALID, bm::for_each_block(), bm::id_max, and bm::set_array_size.
Referenced by bm::bvector< Alloc, MS >::flip().
bool bm::bvector< Alloc, MS >::none | ( | ) | const [inline] |
Returns true if no bits are set, otherwise returns false.
Definition at line 1195 of file bm.h.
References bm::bvector< Alloc, MS >::any().
bool bm::bvector< Alloc, MS >::operator!= | ( | const bvector< Alloc, MS > & | bvect | ) | const [inline] |
Definition at line 937 of file bm.h.
References bm::bvector< Alloc, MS >::compare().
void bm::bvector< Alloc, MS >::operator&= | ( | const bvector< Alloc, MS > & | bvect | ) | [inline] |
Definition at line 892 of file bm.h.
References bm::bvector< Alloc, MS >::bit_and().
void bm::bvector< Alloc, MS >::operator-= | ( | const bvector< Alloc, MS > & | bvect | ) | [inline] |
Definition at line 907 of file bm.h.
References bm::bvector< Alloc, MS >::bit_sub().
bool bm::bvector< Alloc, MS >::operator< | ( | const bvector< Alloc, MS > & | bvect | ) | const [inline] |
Definition at line 912 of file bm.h.
References bm::bvector< Alloc, MS >::compare().
bool bm::bvector< Alloc, MS >::operator<= | ( | const bvector< Alloc, MS > & | bvect | ) | const [inline] |
Definition at line 917 of file bm.h.
References bm::bvector< Alloc, MS >::compare().
bvector& bm::bvector< Alloc, MS >::operator= | ( | const bvector< Alloc, MS > & | bvect | ) | [inline] |
Definition at line 871 of file bm.h.
References bm::bvector< Alloc, MS >::bit_or(), bm::bvector< Alloc, MS >::clear(), bm::bvector< Alloc, MS >::resize(), and bm::bvector< Alloc, MS >::size().
bool bm::bvector< Alloc, MS >::operator== | ( | const bvector< Alloc, MS > & | bvect | ) | const [inline] |
Definition at line 932 of file bm.h.
References bm::bvector< Alloc, MS >::compare().
bool bm::bvector< Alloc, MS >::operator> | ( | const bvector< Alloc, MS > & | bvect | ) | const [inline] |
Definition at line 922 of file bm.h.
References bm::bvector< Alloc, MS >::compare().
bool bm::bvector< Alloc, MS >::operator>= | ( | const bvector< Alloc, MS > & | bvect | ) | const [inline] |
Definition at line 927 of file bm.h.
References bm::bvector< Alloc, MS >::compare().
bool bm::bvector< Alloc, MS >::operator[] | ( | bm::id_t | n | ) | const [inline] |
Definition at line 886 of file bm.h.
References BM_ASSERT, and bm::bvector< Alloc, MS >::get_bit().
reference bm::bvector< Alloc, MS >::operator[] | ( | bm::id_t | n | ) | [inline] |
void bm::bvector< Alloc, MS >::operator^= | ( | const bvector< Alloc, MS > & | bvect | ) | [inline] |
Definition at line 897 of file bm.h.
References bm::bvector< Alloc, MS >::bit_xor().
void bm::bvector< Alloc, MS >::operator|= | ( | const bvector< Alloc, MS > & | bvect | ) | [inline] |
Definition at line 902 of file bm.h.
References bm::bvector< Alloc, MS >::bit_or().
bvector<Alloc, MS> bm::bvector< Alloc, MS >::operator~ | ( | ) | const [inline] |
void bm::bvector< Alloc, MS >::optimize | ( | bm::word_t * | temp_block = 0 , |
|
optmode | opt_mode = opt_compress , |
|||
statistics * | stat = 0 | |||
) | [inline] |
Optimize memory bitvector's memory allocation.
Function analyze all blocks in the bitvector, compresses blocks with a regular structure, frees some memory. This function is recommended after a bulk modification of the bitvector using set_bit, clear_bit or logical operations.
Optionally function can calculate vector post optimization statistics
Definition at line 1842 of file bm.h.
References bm::bv_statistics::bit_blocks, bm::for_each_nzblock(), bm::bv_statistics::gap_blocks, bm::gap_levels, bm::bv_statistics::gap_levels, bm::bv_statistics::max_serialize_mem, bm::bv_statistics::memory_used, and bm::set_array_size.
Referenced by main(), and serialize_bvector().
void bm::bvector< Alloc, MS >::optimize_gap_size | ( | ) | [inline] |
Optimize sizes of GAP blocks.
This method runs an analysis to find optimal GAP levels for the specific vector. Current GAP compression algorithm uses several fixed GAP sizes. By default bvector uses some reasonable preset.
Definition at line 1884 of file bm.h.
References bm::bvector< Alloc, MS >::calc_stat(), bm::gap_levels, bm::improve_gap_levels(), and bm::bvector< Alloc, MS >::set_gap_levels().
bm::id_t bm::bvector< Alloc, MS >::recalc_count | ( | ) | [inline] |
Definition at line 1131 of file bm.h.
References BMCOUNT_VALID, and bm::bvector< Alloc, MS >::count().
Referenced by bm::bvector< Alloc, MS >::swap().
bvector<Alloc, MS>& bm::bvector< Alloc, MS >::reset | ( | ) | [inline] |
Clears every bit in the bitvector.
Definition at line 1067 of file bm.h.
References bm::bvector< Alloc, MS >::clear().
void bm::bvector< Alloc, MS >::resize | ( | size_type | new_size | ) | [inline] |
Change size of the bvector.
new_size | - new size in bits |
Definition at line 1672 of file bm.h.
References bm::bvector< Alloc, MS >::set_range().
Referenced by bm::bvector< Alloc, MS >::operator=().
bvector<Alloc, MS>& bm::bvector< Alloc, MS >::set | ( | ) | [inline] |
Sets every bit in this bitset to 1.
Definition at line 1010 of file bm.h.
References BMCOUNT_VALID, and bm::bvector< Alloc, MS >::set_range().
bvector<Alloc, MS>& bm::bvector< Alloc, MS >::set | ( | bm::id_t | n, | |
bool | val = true | |||
) | [inline] |
Sets bit n if val is true, clears bit n if val is false.
n | - index of the bit to be set | |
val | - new bit value |
Definition at line 998 of file bm.h.
References bm::bvector< Alloc, MS >::set_bit().
Referenced by main().
bool bm::bvector< Alloc, MS >::set_bit | ( | bm::id_t | n, | |
bool | val = true | |||
) | [inline] |
Sets bit n.
n | - index of the bit to be set. | |
val | - new bit value |
Definition at line 959 of file bm.h.
References BM_ASSERT.
Referenced by fill_bvector(), and bm::bvector< Alloc, MS >::set().
bool bm::bvector< Alloc, MS >::set_bit_and | ( | bm::id_t | n, | |
bool | val = true | |||
) | [inline] |
bool bm::bvector< Alloc, MS >::set_bit_conditional | ( | bm::id_t | n, | |
bool | val, | |||
bool | condition | |||
) | [inline] |
void bm::bvector< Alloc, MS >::set_gap_levels | ( | const gap_word_t * | glevel_len | ) | [inline] |
Sets new GAP lengths table. All GAP blocks will be reallocated to match the new scheme.
glevel_len | - pointer on C-style array keeping GAP block sizes. |
Definition at line 1905 of file bm.h.
References bm::for_each_nzblock(), and bm::set_array_size.
Referenced by bm::bvector< Alloc, MS >::optimize_gap_size().
void bm::bvector< Alloc, MS >::set_new_blocks_strat | ( | strategy | strat | ) | [inline] |
bvector< Alloc, MS > & bm::bvector< Alloc, MS >::set_range | ( | bm::id_t | left, | |
bm::id_t | right, | |||
bool | value = true | |||
) | [inline] |
Sets all bits in the specified closed interval [left,right] Interval must be inside the bvector's size. This method DOES NOT resize vector.
left | - interval start | |
right | - interval end (closed interval) | |
value | - value to set interval in |
Definition at line 1627 of file bm.h.
References BM_ASSERT, BM_SET_MMX_GUARD, and BMCOUNT_VALID.
Referenced by bm::bvector< Alloc, MS >::combine_operation(), bm::bvector< Alloc, MS >::resize(), and bm::bvector< Alloc, MS >::set().
size_type bm::bvector< Alloc, MS >::size | ( | ) | const [inline] |
return current size of the vector (bits)
Definition at line 1091 of file bm.h.
Referenced by bm::bvector< Alloc, MS >::operator=().
void bm::bvector< Alloc, MS >::swap | ( | bvector< Alloc, MS > & | bv | ) | [inline] |
Exchanges content of bv and this bitvector.
Definition at line 1221 of file bm.h.
References BMCOUNT_VALID, bm::bvector< Alloc, MS >::recalc_count(), and bm::xor_swap().
bool bm::bvector< Alloc, MS >::test | ( | bm::id_t | n | ) | const [inline] |
returns true if bit n is set and false is bit n is 0.
n | - Index of the bit to check. |
Definition at line 1167 of file bm.h.
References bm::bvector< Alloc, MS >::get_bit().
friend class enumerator [friend] |
friend class iterator_base [friend] |