#include <bmblocks.h>
Definition at line 45 of file bmblocks.h.
Public Types | |
| typedef Alloc | allocator_type |
Public Member Functions | |
| blocks_manager (const gap_word_t *glevel_len, bm::id_t max_bits, const Alloc &alloc=Alloc()) | |
| blocks_manager (const blocks_manager &blockman) | |
| ~blocks_manager () | |
| void | free_ptr (bm::word_t **ptr) |
| unsigned | compute_top_block_size (bm::id_t bits_to_store) |
| Compute size of the block array needed to store bits. | |
| bm::id_t | capacity () const |
| Returns current capacity (bits). | |
| bm::word_t * | get_block (unsigned nb) const |
| Finds block in 2-level blocks array. | |
| bm::word_t * | get_block (unsigned nb, int *no_more_blocks) const |
| Finds block in 2-level blocks array Specilized version of get_block(unsigned), returns an additional condition when there are no more blocks. | |
| void | get_block_coord (unsigned nb, unsigned *i, unsigned *j) const |
| Recalculate absolute block address into coordinates. | |
| unsigned | find_next_nz_block (unsigned nb, bool deep_scan=true) const |
| Find the next non-zero block starting from nb. | |
| const bm::word_t * | get_block (unsigned i, unsigned j) const |
| Finds block in 2-level blocks array. | |
| const bm::word_t *const * | get_topblock (unsigned i) const |
| Function returns top-level block in 2-level blocks array. | |
| bm::word_t *** | get_rootblock () const |
| Returns root block in the tree. | |
| void | set_block_all_set (unsigned nb) |
| bm::word_t * | make_bit_block (unsigned nb) |
| Create all-zeros bit block. | |
| bm::word_t * | check_allocate_block (unsigned nb, unsigned content_flag, int initial_block_type, int *actual_block_type, bool allow_null_ret=true) |
| Function checks if block is not yet allocated, allocates it and sets to all-zero or all-one bits. | |
| void | set_all_zero (bool free_mem) |
| Fills all blocks with 0. | |
| void | set_all_one () |
| bm::word_t * | set_block (unsigned nb, bm::word_t *block) |
| Places new block into descriptors table, returns old block's address. | |
| bm::word_t * | set_block (unsigned nb, bm::word_t *block, bool gap) |
| Places new block into descriptors table, returns old block's address. | |
| void | set_block_ptr (unsigned nb, bm::word_t *block) |
| Places new block into blocks table. | |
| bm::word_t * | convert_gap2bitset (unsigned nb, gap_word_t *gap_block=0) |
| Converts block from type gap to conventional bitset block. | |
| bm::word_t * | deoptimize_block (unsigned nb) |
| Make sure block turns into true bit-block if it is GAP or a full block. | |
| bm::word_t * | zero_block (unsigned nb) |
| Free block, make it zero pointer in the tree. | |
| bm::id_t | block_bitcount (const bm::word_t *block, unsigned idx) const |
| Count number of bits ON in the block. | |
| bm::gap_word_t * | extend_gap_block (unsigned nb, gap_word_t *blk) |
| Extends GAP block to the next level or converts it to bit block. | |
| bool | is_block_gap (unsigned nb) const |
| void | set_block_bit (unsigned nb) |
| void | set_block_gap (unsigned nb) |
| bool | is_block_zero (unsigned nb, const bm::word_t *blk, bool deep_scan=true) const |
| bool | is_block_one (unsigned nb, const bm::word_t *blk, bool deep_scan=true) const |
| Checks if block has only 1 bits. | |
| bm::word_t * | check_allocate_tempblock () |
| void | set_glen (const gap_word_t *glevel_len) |
| bm::gap_word_t * | allocate_gap_block (unsigned level, gap_word_t *src=0, const gap_word_t *glevel_len=0) |
| unsigned | mem_used () const |
| bool | is_subblock_null (unsigned nsub) const |
| Returns true if second level block pointer is 0. | |
| bm::word_t *** | blocks_root () |
| const gap_word_t * | glen () const |
| Returns current GAP level vector. | |
| unsigned | glen (unsigned level) const |
| Returns GAP level length for specified level. | |
| void | swap (blocks_manager &bm) |
| Swaps content. | |
| unsigned | top_block_size () const |
| Returns size of the top block array in the tree. | |
| unsigned | effective_top_block_size () const |
| Returns effective size of the top block array in the tree Effective size excludes NULL pointers at the top descriptor end. | |
| void | reserve (unsigned max_bits) |
| reserve capacity for specified number of bits | |
| void | reserve_top_blocks (unsigned top_blocks) |
| Make sure blocks manager has enough blocks capacity. | |
| allocator_type & | get_allocator () |
| Returns reference on the allocator. | |
| allocator_type | get_allocator () const |
| Returns allocator. | |
Private Member Functions | |
| void | operator= (const blocks_manager &) |
| void | deinit_tree () |
Private Attributes | |
| bm::word_t *** | blocks_ |
| Tree of blocks. | |
| unsigned | top_block_size_ |
| Size of the top level block array in blocks_ tree. | |
| unsigned | effective_top_block_size_ |
| Effective size of the top level block array in blocks_ tree. | |
| bm::word_t * | temp_block_ |
| Temp block. | |
| gap_word_t | glevel_len_ [bm::gap_levels] |
| vector defines gap block lengths for different levels | |
| allocator_type | alloc_ |
| allocator | |
Classes | |
| class | block_any_func |
| Functor detects if any bit set. More... | |
| class | block_copy_func |
| Block copy functor. More... | |
| class | block_count_arr_func |
| Bitcounting functor filling the block counts array. More... | |
| class | block_count_base |
| Base class for bitcounting functors. More... | |
| class | block_count_change_func |
| bit value change counting functor More... | |
| class | block_count_func |
| Bitcounting functor. More... | |
| class | block_free_func |
| Block deallocation functor. More... | |
| class | block_invert_func |
| Bitblock invert functor. More... | |
| class | block_one_func |
| Fill block with all-one bits functor. More... | |
| class | block_opt_func |
| class | block_zero_func |
| Set block zero functor. More... | |
| class | bm_func_base |
| Base functor class (block visitor). More... | |
| class | bm_func_base_const |
| Base functor class connected for "constant" functors. More... | |
| class | gap_level_func |
|
|||||
|
Definition at line 49 of file bmblocks.h. |
|
||||||||||||||||||||
|
Definition at line 642 of file bmblocks.h. |
|
||||||||||
|
Definition at line 668 of file bmblocks.h. References bm::blocks_manager< Alloc, MS >::blocks_root(), endif, bm::for_each_nzblock(), bm::blocks_manager< Alloc, MS >::glevel_len_, and bm::set_array_size. |
|
|||||||||
|
Definition at line 693 of file bmblocks.h. |
|
||||||||||||||||||||
|
Definition at line 1309 of file bmblocks.h. References bm::gap_length(), and len. Referenced by bm::bvector< Alloc, MS >::combine_operation_with_block(), bm::blocks_manager< Alloc, MS >::block_opt_func::operator()(), and bm::blocks_manager< Alloc, MS >::gap_level_func::operator()(). |
|
||||||||||||||||
|
Count number of bits ON in the block.
Definition at line 1145 of file bmblocks.h. References bm::bit_block_calc_count(), bm::bits_in_block, BM_IS_GAP, BMGAP_PTR, bm::gap_bit_count(), IS_FULL_BLOCK, and bm::set_block_size. Referenced by bm::blocks_manager< Alloc, MS >::block_count_base::block_count(). |
|
|||||||||
|
|||||||||
|
Returns current capacity (bits).
Definition at line 726 of file bmblocks.h. References bm::bits_in_block, bm::id_max, and bm::set_array_size. |
|
||||||||||||||||||||||||||||
|
Function checks if block is not yet allocated, allocates it and sets to all-zero or all-one bits. If content_flag == 1 (ALLSET block) requested and taken block is already ALLSET, function will return NULL initial_block_type and actual_block_type : 0 - bitset, 1 - gap Definition at line 900 of file bmblocks.h. References bm::bit_block_set(), BM_IS_GAP, bm::gap_max_bits, bm::gap_set_all(), IS_FULL_BLOCK, and IS_VALID_ADDR. Referenced by bm::bvector< Alloc, MS >::and_bit_no_check(), bm::bvector< Alloc, MS >::combine_operation_with_block(), bm::bvector< Alloc, MS >::set_bit_conditional_impl(), and bm::bvector< Alloc, MS >::set_bit_no_check(). |
|
|||||||||
|
Returns temporary block, allocates if needed. Definition at line 1296 of file bmblocks.h. Referenced by bm::bvector< Alloc, MS >::optimize(). |
|
||||||||||
|
Compute size of the block array needed to store bits.
Definition at line 709 of file bmblocks.h. References bm::id_max, bm::set_array_size, and bm::set_block_size. |
|
||||||||||||||||
|
Converts block from type gap to conventional bitset block.
Definition at line 1074 of file bmblocks.h. References BM_ASSERT, BMGAP_PTR, bm::gap_convert_to_bitset(), IS_VALID_ADDR, and bm::set_block_bit. Referenced by bm::bvector< Alloc, MS >::combine_operation_with_block(). |
|
|||||||||
|
Definition at line 1483 of file bmblocks.h. References bm::for_each_nzblock(), and bm::set_array_size. |
|
||||||||||
|
Make sure block turns into true bit-block if it is GAP or a full block.
Definition at line 1105 of file bmblocks.h. References bm::bit_block_copy(), BM_IS_GAP, and IS_FULL_BLOCK. |
|
|||||||||
|
Returns effective size of the top block array in the tree Effective size excludes NULL pointers at the top descriptor end.
Definition at line 1412 of file bmblocks.h. Referenced by bm::bvector< Alloc, MS >::calc_stat(), bm::bvector< Alloc, MS >::combine_operation(), bm::bvector< Alloc, MS >::compare(), bm::bvector< Alloc, MS >::count(), and bm::bvector< Alloc, MS >::optimize(). |
|
||||||||||||||||
|
Extends GAP block to the next level or converts it to bit block.
Definition at line 1174 of file bmblocks.h. References BMSET_PTRGAP, bm::gap_length(), bm::gap_level(), bm::gap_max_buff_len, bm::gap_max_level, and len. Referenced by bm::bvector< Alloc, MS >::combine_operation_with_block(). |
|
||||||||||||||||
|
Find the next non-zero block starting from nb.
Definition at line 789 of file bmblocks.h. References bm::set_array_size. |
|
||||||||||
|
Definition at line 699 of file bmblocks.h. |
|
|||||||||
|
Returns allocator.
Definition at line 1477 of file bmblocks.h. |
|
|||||||||
|
||||||||||||||||
|
Finds block in 2-level blocks array.
Definition at line 821 of file bmblocks.h. |
|
||||||||||||||||
|
Finds block in 2-level blocks array Specilized version of get_block(unsigned), returns an additional condition when there are no more blocks.
Definition at line 758 of file bmblocks.h. References bm::set_array_mask, and bm::set_array_shift. |
|
||||||||||
|
Finds block in 2-level blocks array.
Definition at line 738 of file bmblocks.h. References bm::set_array_mask, and bm::set_array_shift. Referenced by bm::bvector< Alloc, MS >::count_range(), bm::bvector< Alloc, MS >::get_bit(), and bm::bvector< Alloc, MS >::set_range_no_check(). |
|
||||||||||||||||||||
|
Recalculate absolute block address into coordinates.
Definition at line 774 of file bmblocks.h. References BM_ASSERT, bm::set_array_mask, and bm::set_array_shift. |
|
|||||||||
|
Returns root block in the tree.
Definition at line 841 of file bmblocks.h. References bm::blocks_manager< Alloc, MS >::blocks_root(). Referenced by bm::bvector< Alloc, MS >::count(), bm::bvector< Alloc, MS >::invert(), and bm::blocks_manager< Alloc, MS >::block_opt_func::on_empty_top(). |
|
||||||||||
|
Function returns top-level block in 2-level blocks array.
Definition at line 833 of file bmblocks.h. Referenced by bm::bvector< Alloc, MS >::calc_stat(), and bm::bvector< Alloc, MS >::compare(). |
|
||||||||||
|
Returns GAP level length for specified level.
Definition at line 1371 of file bmblocks.h. |
|
|||||||||
|
||||||||||
|
Definition at line 1197 of file bmblocks.h. References BMPTR_TESTBIT0. Referenced by bm::blocks_manager< Alloc, MS >::block_copy_func::operator()(). |
|
||||||||||||||||||||
|
Checks if block has only 1 bits.
Definition at line 1270 of file bmblocks.h. References BM_IS_GAP, BMGAP_PTR, bm::gap_is_all_one(), bm::gap_max_bits, bm::is_bits_one(), IS_FULL_BLOCK, and bm::set_block_size. |
|
||||||||||||||||||||
|
Definition at line 1238 of file bmblocks.h. References BM_IS_GAP, BMGAP_PTR, bm::gap_is_all_zero(), bm::gap_max_bits, and bm::set_block_size. |
|
||||||||||
|
Returns true if second level block pointer is 0.
Definition at line 1350 of file bmblocks.h. Referenced by bm::bvector< Alloc, MS >::check_or_next(), and bm::bvector< Alloc, MS >::check_or_next_extract(). |
|
||||||||||
|
Create all-zeros bit block. Old block (if exists) is deleted. Definition at line 872 of file bmblocks.h. References bm::bit_block_set(), BM_IS_GAP, BMGAP_PTR, and IS_VALID_ADDR. |
|
|||||||||
|
Definition at line 1330 of file bmblocks.h. References bm::set_array_size, and bm::set_block_size. Referenced by bm::bvector< Alloc, MS >::optimize(). |
|
||||||||||
|
|
|
||||||||||
|
reserve capacity for specified number of bits
Definition at line 1439 of file bmblocks.h. Referenced by bm::bvector< Alloc, MS >::resize(). |
|
||||||||||
|
Make sure blocks manager has enough blocks capacity.
Definition at line 1451 of file bmblocks.h. References BM_ASSERT, and bm::set_array_size. Referenced by bm::bvector< Alloc, MS >::combine_operation(). |
|
|||||||||
|
Replaces all blocks with ALL_ONE block. Definition at line 953 of file bmblocks.h. References bm::for_each_block(), and bm::set_array_size. |
|
||||||||||
|
Fills all blocks with 0.
Definition at line 944 of file bmblocks.h. References bm::for_each_nzblock(), and bm::set_array_size. |
|
||||||||||||||||||||
|
Places new block into descriptors table, returns old block's address. Old block is not deleted. Definition at line 1003 of file bmblocks.h. References BMPTR_CLEARBIT0, BMPTR_SETBIT0, bm::set_array_mask, bm::set_array_shift, and bm::set_array_size. |
|
||||||||||||||||
|
Places new block into descriptors table, returns old block's address. Old block is not deleted. Definition at line 964 of file bmblocks.h. References bm::set_array_mask, bm::set_array_shift, and bm::set_array_size. Referenced by bm::blocks_manager< Alloc, MS >::block_invert_func::operator()(), and bm::bvector< Alloc, MS >::set_range_no_check(). |
|
||||||||||
|
Definition at line 848 of file bmblocks.h. References BM_IS_GAP, BMGAP_PTR, FULL_BLOCK_ADDR, and bm::set_block_bit. Referenced by bm::blocks_manager< Alloc, MS >::block_one_func::operator()(). |
|
||||||||||
|
Definition at line 1207 of file bmblocks.h. References BMPTR_CLEARBIT0. Referenced by bm::blocks_manager< Alloc, MS >::block_opt_func::free_block(), bm::blocks_manager< Alloc, MS >::gap_level_func::operator()(), and bm::bvector< Alloc, MS >::set_range_no_check(). |
|
||||||||||
|
Definition at line 1218 of file bmblocks.h. References BMPTR_SETBIT0. Referenced by bm::blocks_manager< Alloc, MS >::block_opt_func::operator()(). |
|
||||||||||||||||
|
Places new block into blocks table.
Definition at line 1061 of file bmblocks.h. References BM_ASSERT, bm::set_array_mask, and bm::set_array_shift. Referenced by bm::bvector< Alloc, MS >::combine_operation_with_block(), bm::blocks_manager< Alloc, MS >::block_zero_func::operator()(), bm::blocks_manager< Alloc, MS >::block_invert_func::operator()(), bm::blocks_manager< Alloc, MS >::block_opt_func::operator()(), and bm::blocks_manager< Alloc, MS >::gap_level_func::operator()(). |
|
||||||||||
|
Assigns new GAP lengths vector Definition at line 1303 of file bmblocks.h. Referenced by bm::bvector< Alloc, MS >::set_gap_levels(). |
|
||||||||||
|
Swaps content.
Definition at line 1379 of file bmblocks.h. References bm::blocks_manager< Alloc, MS >::blocks_, BM_ASSERT, bm::blocks_manager< Alloc, MS >::effective_top_block_size_, bm::gap_levels, bm::blocks_manager< Alloc, MS >::glevel_len_, bm::blocks_manager< Alloc, MS >::top_block_size_, and bm::xor_swap(). |
|
|||||||||
|
Returns size of the top block array in the tree.
Definition at line 1404 of file bmblocks.h. Referenced by bm::bvector< Alloc, MS >::combine_operation(), bm::bvector< Alloc, MS >::enumerator::go_first(), bm::bvector< Alloc, MS >::invert(), and bm::bvector< Alloc, MS >::set_gap_levels(). |
|
||||||||||
|
Free block, make it zero pointer in the tree.
Definition at line 1125 of file bmblocks.h. References BM_IS_GAP, and BMGAP_PTR. Referenced by bm::bvector< Alloc, MS >::combine_operation_with_block(). |
|
|||||
|
allocator
Definition at line 1516 of file bmblocks.h. |
|
|||||
|
Tree of blocks.
Definition at line 1502 of file bmblocks.h. Referenced by bm::blocks_manager< Alloc, MS >::swap(). |
|
|||||
|
Effective size of the top level block array in blocks_ tree.
Definition at line 1506 of file bmblocks.h. Referenced by bm::blocks_manager< Alloc, MS >::swap(). |
|
|||||
|
vector defines gap block lengths for different levels
Definition at line 1514 of file bmblocks.h. Referenced by bm::blocks_manager< Alloc, MS >::blocks_manager(), and bm::blocks_manager< Alloc, MS >::swap(). |
|
|||||
|
Temp block.
Definition at line 1512 of file bmblocks.h. |
|
|||||
|
Size of the top level block array in blocks_ tree.
Definition at line 1504 of file bmblocks.h. Referenced by bm::blocks_manager< Alloc, MS >::swap(). |
1.4.6
Modified on Wed Dec 09 08:20:18 2009 by modify_doxy.py rev. 173732