dlvhex
2.5.0
|
bitvector blocks manager Embedded class managing bit-blocks on very low level. Includes number of functor classes used in different bitset algorithms. More...
#include <vs10/bm/bmblocks.h>
Data Structures | |
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 |
Public Types | |
typedef Alloc | allocator_type |
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 | free_block (bm::word_t *block) |
void | set_block_all_set (unsigned nb) |
bm::word_t * | alloc_bit_block (unsigned nb) |
Create(allocate) bit block. | |
bm::word_t * | make_bit_block (unsigned nb) |
Create all-zeros bit block. | |
bm::word_t * | copy_bit_block (unsigned nb, const bm::word_t *block_src, int is_src_gap) |
Create bit block as a copy of source block (bit or gap). | |
bm::word_t * | copy_block (unsigned idx, const blocks_manager &bm_src) |
Copy block from another vector. | |
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_gap_block (unsigned nb, const gap_word_t *gap_block_src, int level) |
Allocate an place new GAP block (copy of provided block) | |
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, const gap_word_t *gap_block=0, unsigned gap_len=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::word_t * | zero_block (unsigned i, unsigned j) |
Free block, make it zero pointer in the tree. | |
bm::id_t | block_bitcount (const bm::word_t *block) 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, const 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. | |
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 | free_block (bm::word_t *block) |
void | set_block_all_set (unsigned nb) |
bm::word_t * | alloc_bit_block (unsigned nb) |
Create(allocate) bit block. | |
bm::word_t * | make_bit_block (unsigned nb) |
Create all-zeros bit block. | |
bm::word_t * | copy_bit_block (unsigned nb, const bm::word_t *block_src, int is_src_gap) |
Create bit block as a copy of source block (bit or gap). | |
bm::word_t * | copy_block (unsigned idx, const blocks_manager &bm_src) |
Copy block from another vector. | |
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_gap_block (unsigned nb, const gap_word_t *gap_block_src, int level) |
Allocate an place new GAP block (copy of provided block) | |
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, const gap_word_t *gap_block=0, unsigned gap_len=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::word_t * | zero_block (unsigned i, unsigned j) |
Free block, make it zero pointer in the tree. | |
bm::id_t | block_bitcount (const bm::word_t *block) 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, const 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 () |
void | free_top_block () |
void | init_tree () |
allocate first level of descr. of blocks | |
void | operator= (const blocks_manager &) |
void | deinit_tree () |
void | free_top_block () |
void | init_tree () |
allocate first level of descr. of blocks | |
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 |
bitvector blocks manager Embedded class managing bit-blocks on very low level. Includes number of functor classes used in different bitset algorithms.
Definition at line 51 of file bmblocks.h.
typedef Alloc bm::blocks_manager< Alloc >::allocator_type |
Definition at line 55 of file bmblocks.h.
typedef Alloc bm::blocks_manager< Alloc >::allocator_type |
Definition at line 55 of file bmblocks.h.
bm::blocks_manager< Alloc >::blocks_manager | ( | const gap_word_t * | glevel_len, |
bm::id_t | max_bits, | ||
const Alloc & | alloc = Alloc() |
||
) | [inline] |
Definition at line 634 of file bmblocks.h.
References bm::blocks_manager< Alloc >::blocks_, bm::blocks_manager< Alloc >::compute_top_block_size(), bm::blocks_manager< Alloc >::effective_top_block_size_, bm::blocks_manager< Alloc >::glevel_len_, bm::blocks_manager< Alloc >::init_tree(), and bm::blocks_manager< Alloc >::top_block_size_.
bm::blocks_manager< Alloc >::blocks_manager | ( | const blocks_manager< Alloc > & | blockman | ) | [inline] |
Definition at line 653 of file bmblocks.h.
References bm::blocks_manager< Alloc >::blocks_root(), bm::for_each_nzblock(), bm::blocks_manager< Alloc >::glevel_len_, bm::blocks_manager< Alloc >::init_tree(), and bm::blocks_manager< Alloc >::top_block_size_.
bm::blocks_manager< Alloc >::~blocks_manager | ( | ) | [inline] |
Definition at line 676 of file bmblocks.h.
References bm::blocks_manager< Alloc >::alloc_, bm::blocks_manager< Alloc >::deinit_tree(), and bm::blocks_manager< Alloc >::temp_block_.
bm::blocks_manager< Alloc >::blocks_manager | ( | const gap_word_t * | glevel_len, |
bm::id_t | max_bits, | ||
const Alloc & | alloc = Alloc() |
||
) | [inline] |
Definition at line 634 of file bmblocks.h.
References bm::blocks_manager< Alloc >::blocks_, bm::blocks_manager< Alloc >::compute_top_block_size(), bm::blocks_manager< Alloc >::effective_top_block_size_, bm::blocks_manager< Alloc >::glevel_len_, bm::blocks_manager< Alloc >::init_tree(), and bm::blocks_manager< Alloc >::top_block_size_.
bm::blocks_manager< Alloc >::blocks_manager | ( | const blocks_manager< Alloc > & | blockman | ) | [inline] |
Definition at line 653 of file bmblocks.h.
References bm::for_each_nzblock(), bm::blocks_manager< Alloc >::glevel_len_, bm::blocks_manager< Alloc >::init_tree(), and bm::blocks_manager< Alloc >::top_block_size_.
bm::blocks_manager< Alloc >::~blocks_manager | ( | ) | [inline] |
Definition at line 676 of file bmblocks.h.
References bm::blocks_manager< Alloc >::alloc_, bm::blocks_manager< Alloc >::deinit_tree(), and bm::blocks_manager< Alloc >::temp_block_.
bm::word_t* bm::blocks_manager< Alloc >::alloc_bit_block | ( | unsigned | nb | ) | [inline] |
Create(allocate) bit block.
Old block (if exists) gets deleted.
Definition at line 849 of file bmblocks.h.
References bm::blocks_manager< Alloc >::free_block(), bm::blocks_manager< Alloc >::get_allocator(), IS_VALID_ADDR, and bm::blocks_manager< Alloc >::set_block().
Referenced by bm::blocks_manager< Alloc >::copy_bit_block(), and bm::blocks_manager< Alloc >::make_bit_block().
bm::word_t* bm::blocks_manager< Alloc >::alloc_bit_block | ( | unsigned | nb | ) | [inline] |
Create(allocate) bit block.
Old block (if exists) gets deleted.
Definition at line 849 of file bmblocks.h.
References bm::blocks_manager< Alloc >::free_block(), bm::blocks_manager< Alloc >::get_allocator(), IS_VALID_ADDR, and bm::blocks_manager< Alloc >::set_block().
bm::gap_word_t* bm::blocks_manager< Alloc >::allocate_gap_block | ( | unsigned | level, |
const gap_word_t * | src = 0 , |
||
const gap_word_t * | glevel_len = 0 |
||
) | [inline] |
Definition at line 1355 of file bmblocks.h.
References bm::blocks_manager< Alloc >::alloc_, bm::gap_length(), and bm::blocks_manager< Alloc >::glevel_len_.
Referenced by bm::blocks_manager< Alloc >::check_allocate_block(), bm::blocks_manager< Alloc >::extend_gap_block(), bm::blocks_manager< Alloc >::gap_level_func::operator()(), and bm::blocks_manager< Alloc >::block_opt_func::operator()().
bm::gap_word_t* bm::blocks_manager< Alloc >::allocate_gap_block | ( | unsigned | level, |
const gap_word_t * | src = 0 , |
||
const gap_word_t * | glevel_len = 0 |
||
) | [inline] |
Definition at line 1355 of file bmblocks.h.
References bm::blocks_manager< Alloc >::alloc_, bm::gap_length(), and bm::blocks_manager< Alloc >::glevel_len_.
bm::id_t bm::blocks_manager< Alloc >::block_bitcount | ( | const bm::word_t * | block | ) | const [inline] |
Count number of bits ON in the block.
Definition at line 1209 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.
bm::id_t bm::blocks_manager< Alloc >::block_bitcount | ( | const bm::word_t * | block | ) | const [inline] |
Count number of bits ON in the block.
Definition at line 1209 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 >::block_count_base::block_count().
bm::word_t*** bm::blocks_manager< Alloc >::blocks_root | ( | ) | [inline] |
Definition at line 1398 of file bmblocks.h.
References bm::blocks_manager< Alloc >::blocks_.
Referenced by bm::blocks_manager< Alloc >::blocks_manager(), bm::blocks_manager< Alloc >::get_rootblock(), bm::bvector< Alloc >::enumerator::go_first(), and bm::bvector< Alloc >::set_gap_levels().
bm::word_t*** bm::blocks_manager< Alloc >::blocks_root | ( | ) | [inline] |
Definition at line 1398 of file bmblocks.h.
References bm::blocks_manager< Alloc >::blocks_.
bm::id_t bm::blocks_manager< Alloc >::capacity | ( | ) | const [inline] |
Returns current capacity (bits)
Definition at line 708 of file bmblocks.h.
References bm::bits_in_block, bm::id_max, bm::set_array_size, and bm::blocks_manager< Alloc >::top_block_size_.
Referenced by bm::bvector< Alloc >::capacity().
bm::id_t bm::blocks_manager< Alloc >::capacity | ( | ) | const [inline] |
Returns current capacity (bits)
Definition at line 708 of file bmblocks.h.
References bm::bits_in_block, bm::id_max, bm::set_array_size, and bm::blocks_manager< Alloc >::top_block_size_.
bm::word_t* bm::blocks_manager< Alloc >::check_allocate_block | ( | unsigned | nb, |
unsigned | content_flag, | ||
int | initial_block_type, | ||
int * | actual_block_type, | ||
bool | allow_null_ret = true |
||
) | [inline] |
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 946 of file bmblocks.h.
References bm::blocks_manager< Alloc >::alloc_, bm::blocks_manager< Alloc >::allocate_gap_block(), bm::bit_block_set(), BM_IS_GAP, bm::gap_max_bits, bm::gap_set_all(), bm::blocks_manager< Alloc >::get_block(), IS_FULL_BLOCK, IS_VALID_ADDR, and bm::blocks_manager< Alloc >::set_block().
bm::word_t* bm::blocks_manager< Alloc >::check_allocate_block | ( | unsigned | nb, |
unsigned | content_flag, | ||
int | initial_block_type, | ||
int * | actual_block_type, | ||
bool | allow_null_ret = true |
||
) | [inline] |
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 946 of file bmblocks.h.
References bm::blocks_manager< Alloc >::alloc_, bm::blocks_manager< Alloc >::allocate_gap_block(), bm::bit_block_set(), BM_IS_GAP, bm::gap_max_bits, bm::gap_set_all(), bm::blocks_manager< Alloc >::get_block(), IS_FULL_BLOCK, IS_VALID_ADDR, and bm::blocks_manager< Alloc >::set_block().
bm::word_t* bm::blocks_manager< Alloc >::check_allocate_tempblock | ( | ) | [inline] |
Returns temporary block, allocates if needed.
Definition at line 1342 of file bmblocks.h.
References bm::blocks_manager< Alloc >::alloc_, and bm::blocks_manager< Alloc >::temp_block_.
bm::word_t* bm::blocks_manager< Alloc >::check_allocate_tempblock | ( | ) | [inline] |
Returns temporary block, allocates if needed.
Definition at line 1342 of file bmblocks.h.
References bm::blocks_manager< Alloc >::alloc_, and bm::blocks_manager< Alloc >::temp_block_.
unsigned bm::blocks_manager< Alloc >::compute_top_block_size | ( | bm::id_t | bits_to_store | ) | [inline] |
Compute size of the block array needed to store bits.
bits_to_store | - supposed capacity (number of bits) |
Definition at line 692 of file bmblocks.h.
References bm::id_max, bm::set_array_size, bm::set_block_size, and bm::blocks_manager< Alloc >::top_block_size().
Referenced by bm::blocks_manager< Alloc >::blocks_manager(), and bm::blocks_manager< Alloc >::reserve().
unsigned bm::blocks_manager< Alloc >::compute_top_block_size | ( | bm::id_t | bits_to_store | ) | [inline] |
Compute size of the block array needed to store bits.
bits_to_store | - supposed capacity (number of bits) |
Definition at line 692 of file bmblocks.h.
References bm::id_max, bm::set_array_size, bm::set_block_size, and bm::blocks_manager< Alloc >::top_block_size().
bm::word_t* bm::blocks_manager< Alloc >::convert_gap2bitset | ( | unsigned | nb, |
const gap_word_t * | gap_block = 0 , |
||
unsigned | gap_len = 0 |
||
) | [inline] |
Converts block from type gap to conventional bitset block.
nb | - Block's index. |
gap_block | - Pointer to the gap block, if NULL block nb will be taken |
gap_len | - GAP block length (optional) |
Definition at line 1129 of file bmblocks.h.
References bm::blocks_manager< Alloc >::alloc_, BMGAP_PTR, bm::gap_convert_to_bitset_l(), bm::blocks_manager< Alloc >::get_block(), bm::blocks_manager< Alloc >::glen(), IS_VALID_ADDR, bm::blocks_manager< Alloc >::set_block(), and bm::blocks_manager< Alloc >::set_block_ptr().
bm::word_t* bm::blocks_manager< Alloc >::convert_gap2bitset | ( | unsigned | nb, |
const gap_word_t * | gap_block = 0 , |
||
unsigned | gap_len = 0 |
||
) | [inline] |
Converts block from type gap to conventional bitset block.
nb | - Block's index. |
gap_block | - Pointer to the gap block, if NULL block nb will be taken |
gap_len | - GAP block length (optional) |
Definition at line 1129 of file bmblocks.h.
References bm::blocks_manager< Alloc >::alloc_, BMGAP_PTR, bm::gap_convert_to_bitset_l(), bm::blocks_manager< Alloc >::get_block(), bm::blocks_manager< Alloc >::glen(), IS_VALID_ADDR, bm::blocks_manager< Alloc >::set_block(), and bm::blocks_manager< Alloc >::set_block_ptr().
Referenced by bm::blocks_manager< Alloc >::deoptimize_block(), and bm::blocks_manager< Alloc >::extend_gap_block().
bm::word_t* bm::blocks_manager< Alloc >::copy_bit_block | ( | unsigned | nb, |
const bm::word_t * | block_src, | ||
int | is_src_gap | ||
) | [inline] |
Create bit block as a copy of source block (bit or gap).
Old block (if exists) gets deleted.
Definition at line 874 of file bmblocks.h.
References bm::blocks_manager< Alloc >::alloc_bit_block(), bm::bit_block_copy(), BMGAP_PTR, bm::gap_convert_to_bitset(), and bm::blocks_manager< Alloc >::zero_block().
bm::word_t* bm::blocks_manager< Alloc >::copy_bit_block | ( | unsigned | nb, |
const bm::word_t * | block_src, | ||
int | is_src_gap | ||
) | [inline] |
Create bit block as a copy of source block (bit or gap).
Old block (if exists) gets deleted.
Definition at line 874 of file bmblocks.h.
References bm::blocks_manager< Alloc >::alloc_bit_block(), bm::bit_block_copy(), BMGAP_PTR, bm::gap_convert_to_bitset(), and bm::blocks_manager< Alloc >::zero_block().
bm::word_t* bm::blocks_manager< Alloc >::copy_block | ( | unsigned | idx, |
const blocks_manager< Alloc > & | bm_src | ||
) | [inline] |
Copy block from another vector.
Note:Target block is always replaced through re-allocation.
Definition at line 899 of file bmblocks.h.
References bm::bit_block_copy(), BM_IS_GAP, BMGAP_PTR, FULL_BLOCK_ADDR, bm::gap_length(), bm::gap_level(), bm::blocks_manager< Alloc >::get_allocator(), bm::blocks_manager< Alloc >::get_block(), bm::blocks_manager< Alloc >::glen(), IS_FULL_BLOCK, bm::blocks_manager< Alloc >::set_block(), bm::set_gap_level(), and bm::blocks_manager< Alloc >::zero_block().
bm::word_t* bm::blocks_manager< Alloc >::copy_block | ( | unsigned | idx, |
const blocks_manager< Alloc > & | bm_src | ||
) | [inline] |
Copy block from another vector.
Note:Target block is always replaced through re-allocation.
Definition at line 899 of file bmblocks.h.
References bm::bit_block_copy(), BM_IS_GAP, BMGAP_PTR, FULL_BLOCK_ADDR, bm::gap_length(), bm::gap_level(), bm::blocks_manager< Alloc >::get_allocator(), bm::blocks_manager< Alloc >::glen(), IS_FULL_BLOCK, bm::blocks_manager< Alloc >::set_block(), bm::set_gap_level(), and bm::blocks_manager< Alloc >::zero_block().
void bm::blocks_manager< Alloc >::deinit_tree | ( | ) | [inline, private] |
Definition at line 1502 of file bmblocks.h.
References bm::blocks_manager< Alloc >::alloc_, bm::blocks_manager< Alloc >::blocks_, bm::blocks_manager< Alloc >::effective_top_block_size(), bm::for_each_nzblock2(), bm::blocks_manager< Alloc >::free_top_block(), and bm::blocks_manager< Alloc >::top_block_size_.
Referenced by bm::blocks_manager< Alloc >::set_all_zero(), and bm::blocks_manager< Alloc >::~blocks_manager().
void bm::blocks_manager< Alloc >::deinit_tree | ( | ) | [inline, private] |
Definition at line 1502 of file bmblocks.h.
References bm::blocks_manager< Alloc >::alloc_, bm::blocks_manager< Alloc >::blocks_, bm::blocks_manager< Alloc >::effective_top_block_size(), bm::for_each_nzblock2(), bm::blocks_manager< Alloc >::free_top_block(), and bm::blocks_manager< Alloc >::top_block_size_.
bm::word_t* bm::blocks_manager< Alloc >::deoptimize_block | ( | unsigned | nb | ) | [inline] |
Make sure block turns into true bit-block if it is GAP or a full block.
Definition at line 1162 of file bmblocks.h.
References bm::bit_block_copy(), BM_IS_GAP, bm::blocks_manager< Alloc >::convert_gap2bitset(), bm::blocks_manager< Alloc >::get_allocator(), bm::blocks_manager< Alloc >::get_block(), IS_FULL_BLOCK, and bm::blocks_manager< Alloc >::set_block().
bm::word_t* bm::blocks_manager< Alloc >::deoptimize_block | ( | unsigned | nb | ) | [inline] |
Make sure block turns into true bit-block if it is GAP or a full block.
Definition at line 1162 of file bmblocks.h.
References bm::bit_block_copy(), BM_IS_GAP, bm::blocks_manager< Alloc >::convert_gap2bitset(), bm::blocks_manager< Alloc >::get_allocator(), bm::blocks_manager< Alloc >::get_block(), IS_FULL_BLOCK, and bm::blocks_manager< Alloc >::set_block().
unsigned bm::blocks_manager< Alloc >::effective_top_block_size | ( | ) | const [inline] |
Returns effective size of the top block array in the tree Effective size excludes NULL pointers at the top descriptor end.
Definition at line 1450 of file bmblocks.h.
References bm::blocks_manager< Alloc >::effective_top_block_size_.
Referenced by bm::bvector< Alloc >::any(), bm::bvector< Alloc >::count_blocks(), bm::blocks_manager< Alloc >::deinit_tree(), and bm::blocks_manager< Alloc >::set_all_zero().
unsigned bm::blocks_manager< Alloc >::effective_top_block_size | ( | ) | const [inline] |
Returns effective size of the top block array in the tree Effective size excludes NULL pointers at the top descriptor end.
Definition at line 1450 of file bmblocks.h.
References bm::blocks_manager< Alloc >::effective_top_block_size_.
bm::gap_word_t* bm::blocks_manager< Alloc >::extend_gap_block | ( | unsigned | nb, |
gap_word_t * | blk | ||
) | [inline] |
Extends GAP block to the next level or converts it to bit block.
nb | - Block's linear index. |
blk | - Blocks's pointer |
Definition at line 1233 of file bmblocks.h.
References bm::blocks_manager< Alloc >::alloc_, bm::blocks_manager< Alloc >::allocate_gap_block(), BMSET_PTRGAP, bm::blocks_manager< Alloc >::convert_gap2bitset(), bm::gap_length(), bm::gap_level(), bm::gap_max_buff_len, bm::gap_max_level, bm::blocks_manager< Alloc >::glen(), and bm::blocks_manager< Alloc >::set_block_ptr().
bm::gap_word_t* bm::blocks_manager< Alloc >::extend_gap_block | ( | unsigned | nb, |
gap_word_t * | blk | ||
) | [inline] |
Extends GAP block to the next level or converts it to bit block.
nb | - Block's linear index. |
blk | - Blocks's pointer |
Definition at line 1233 of file bmblocks.h.
References bm::blocks_manager< Alloc >::alloc_, bm::blocks_manager< Alloc >::allocate_gap_block(), BMSET_PTRGAP, bm::blocks_manager< Alloc >::convert_gap2bitset(), bm::gap_length(), bm::gap_level(), bm::gap_max_buff_len, bm::gap_max_level, bm::blocks_manager< Alloc >::glen(), and bm::blocks_manager< Alloc >::set_block_ptr().
Referenced by bm::bvector< Alloc >::extend_gap_block().
unsigned bm::blocks_manager< Alloc >::find_next_nz_block | ( | unsigned | nb, |
bool | deep_scan = true |
||
) | const [inline] |
Find the next non-zero block starting from nb.
nb | - block index |
deep_scan | - flag to perform detailed bit-block analysis |
Definition at line 771 of file bmblocks.h.
References bm::blocks_manager< Alloc >::blocks_, bm::blocks_manager< Alloc >::effective_top_block_size_, bm::blocks_manager< Alloc >::get_block_coord(), bm::blocks_manager< Alloc >::is_block_zero(), bm::set_array_size, and bm::set_total_blocks.
unsigned bm::blocks_manager< Alloc >::find_next_nz_block | ( | unsigned | nb, |
bool | deep_scan = true |
||
) | const [inline] |
Find the next non-zero block starting from nb.
nb | - block index |
deep_scan | - flag to perform detailed bit-block analysis |
Definition at line 771 of file bmblocks.h.
References bm::blocks_manager< Alloc >::blocks_, bm::blocks_manager< Alloc >::effective_top_block_size_, bm::blocks_manager< Alloc >::get_block_coord(), bm::blocks_manager< Alloc >::is_block_zero(), bm::set_array_size, and bm::set_total_blocks.
void bm::blocks_manager< Alloc >::free_block | ( | bm::word_t * | block | ) | [inline] |
Definition at line 827 of file bmblocks.h.
References bm::blocks_manager< Alloc >::alloc_, BM_IS_GAP, BMGAP_PTR, and bm::blocks_manager< Alloc >::glevel_len_.
void bm::blocks_manager< Alloc >::free_block | ( | bm::word_t * | block | ) | [inline] |
Definition at line 827 of file bmblocks.h.
References bm::blocks_manager< Alloc >::alloc_, BM_IS_GAP, BMGAP_PTR, and bm::blocks_manager< Alloc >::glevel_len_.
Referenced by bm::blocks_manager< Alloc >::alloc_bit_block(), bm::blocks_manager< Alloc >::gap_level_func::operator()(), bm::blocks_manager< Alloc >::set_block_all_set(), and bm::blocks_manager< Alloc >::zero_block().
void bm::blocks_manager< Alloc >::free_ptr | ( | bm::word_t ** | ptr | ) | [inline] |
Definition at line 682 of file bmblocks.h.
References bm::blocks_manager< Alloc >::alloc_.
void bm::blocks_manager< Alloc >::free_ptr | ( | bm::word_t ** | ptr | ) | [inline] |
Definition at line 682 of file bmblocks.h.
References bm::blocks_manager< Alloc >::alloc_.
void bm::blocks_manager< Alloc >::free_top_block | ( | ) | [inline, private] |
Definition at line 1513 of file bmblocks.h.
References bm::blocks_manager< Alloc >::alloc_, bm::blocks_manager< Alloc >::blocks_, and bm::blocks_manager< Alloc >::top_block_size_.
void bm::blocks_manager< Alloc >::free_top_block | ( | ) | [inline, private] |
Definition at line 1513 of file bmblocks.h.
References bm::blocks_manager< Alloc >::alloc_, bm::blocks_manager< Alloc >::blocks_, and bm::blocks_manager< Alloc >::top_block_size_.
Referenced by bm::blocks_manager< Alloc >::deinit_tree().
allocator_type& bm::blocks_manager< Alloc >::get_allocator | ( | ) | [inline] |
Returns reference on the allocator.
Definition at line 1492 of file bmblocks.h.
References bm::blocks_manager< Alloc >::alloc_.
Referenced by bm::blocks_manager< Alloc >::alloc_bit_block(), bm::bvector< Alloc >::allocate_tempblock(), bm::blocks_manager< Alloc >::copy_block(), bm::blocks_manager< Alloc >::deoptimize_block(), bm::blocks_manager< Alloc >::block_opt_func::free_block(), bm::bvector< Alloc >::free_tempblock(), bm::bvector< Alloc >::get_allocator(), bm::blocks_manager< Alloc >::block_opt_func::on_empty_top(), bm::blocks_manager< Alloc >::gap_level_func::operator()(), bm::blocks_manager< Alloc >::block_opt_func::operator()(), bm::blocks_manager< Alloc >::block_free_func::operator()(), bm::blocks_manager< Alloc >::block_copy_func::operator()(), and bm::blocks_manager< Alloc >::set_gap_block().
allocator_type& bm::blocks_manager< Alloc >::get_allocator | ( | ) | [inline] |
Returns reference on the allocator.
Definition at line 1492 of file bmblocks.h.
References bm::blocks_manager< Alloc >::alloc_.
allocator_type bm::blocks_manager< Alloc >::get_allocator | ( | ) | const [inline] |
Returns allocator.
Definition at line 1496 of file bmblocks.h.
References bm::blocks_manager< Alloc >::alloc_.
allocator_type bm::blocks_manager< Alloc >::get_allocator | ( | ) | const [inline] |
Returns allocator.
Definition at line 1496 of file bmblocks.h.
References bm::blocks_manager< Alloc >::alloc_.
bm::word_t* bm::blocks_manager< Alloc >::get_block | ( | unsigned | nb | ) | const [inline] |
Finds block in 2-level blocks array.
nb | - Index of block (logical linear number) |
Definition at line 720 of file bmblocks.h.
References bm::blocks_manager< Alloc >::blocks_, bm::set_array_mask, bm::set_array_shift, and bm::blocks_manager< Alloc >::top_block_size_.
Referenced by bm::blocks_manager< Alloc >::check_allocate_block(), bm::blocks_manager< Alloc >::convert_gap2bitset(), bm::blocks_manager< Alloc >::copy_block(), bm::blocks_manager< Alloc >::deoptimize_block(), bm::bvector< Alloc >::get_block(), bm::blocks_manager< Alloc >::is_block_gap(), bm::blocks_manager< Alloc >::set_block_bit(), bm::blocks_manager< Alloc >::set_block_gap(), and bm::blocks_manager< Alloc >::zero_block().
bm::word_t* bm::blocks_manager< Alloc >::get_block | ( | unsigned | nb | ) | const [inline] |
Finds block in 2-level blocks array.
nb | - Index of block (logical linear number) |
Definition at line 720 of file bmblocks.h.
References bm::blocks_manager< Alloc >::blocks_, bm::set_array_mask, bm::set_array_shift, and bm::blocks_manager< Alloc >::top_block_size_.
bm::word_t* bm::blocks_manager< Alloc >::get_block | ( | unsigned | nb, |
int * | no_more_blocks | ||
) | const [inline] |
Finds block in 2-level blocks array Specilized version of get_block(unsigned), returns an additional condition when there are no more blocks.
nb | - Index of block (logical linear number) |
no_more_blocks | - 1 if there are no more blocks at all |
Definition at line 740 of file bmblocks.h.
References bm::blocks_manager< Alloc >::blocks_, bm::set_array_mask, bm::set_array_shift, and bm::blocks_manager< Alloc >::top_block_size_.
bm::word_t* bm::blocks_manager< Alloc >::get_block | ( | unsigned | nb, |
int * | no_more_blocks | ||
) | const [inline] |
Finds block in 2-level blocks array Specilized version of get_block(unsigned), returns an additional condition when there are no more blocks.
nb | - Index of block (logical linear number) |
no_more_blocks | - 1 if there are no more blocks at all |
Definition at line 740 of file bmblocks.h.
References bm::blocks_manager< Alloc >::blocks_, bm::set_array_mask, bm::set_array_shift, and bm::blocks_manager< Alloc >::top_block_size_.
const bm::word_t* bm::blocks_manager< Alloc >::get_block | ( | unsigned | i, |
unsigned | j | ||
) | const [inline] |
Finds block in 2-level blocks array.
i | - top level block index |
j | - second level block index |
Definition at line 800 of file bmblocks.h.
References bm::blocks_manager< Alloc >::blocks_, and bm::blocks_manager< Alloc >::top_block_size_.
const bm::word_t* bm::blocks_manager< Alloc >::get_block | ( | unsigned | i, |
unsigned | j | ||
) | const [inline] |
Finds block in 2-level blocks array.
i | - top level block index |
j | - second level block index |
Definition at line 800 of file bmblocks.h.
References bm::blocks_manager< Alloc >::blocks_, and bm::blocks_manager< Alloc >::top_block_size_.
void bm::blocks_manager< Alloc >::get_block_coord | ( | unsigned | nb, |
unsigned * | i, | ||
unsigned * | j | ||
) | const [inline] |
Recalculate absolute block address into coordinates.
Definition at line 756 of file bmblocks.h.
References bm::set_array_mask, and bm::set_array_shift.
Referenced by bm::blocks_manager< Alloc >::find_next_nz_block().
void bm::blocks_manager< Alloc >::get_block_coord | ( | unsigned | nb, |
unsigned * | i, | ||
unsigned * | j | ||
) | const [inline] |
Recalculate absolute block address into coordinates.
Definition at line 756 of file bmblocks.h.
References bm::set_array_mask, and bm::set_array_shift.
bm::word_t*** bm::blocks_manager< Alloc >::get_rootblock | ( | ) | const [inline] |
Returns root block in the tree.
Definition at line 820 of file bmblocks.h.
References bm::blocks_manager< Alloc >::blocks_root().
Referenced by bm::bvector< Alloc >::any(), bm::bvector< Alloc >::count_blocks(), and bm::blocks_manager< Alloc >::block_opt_func::on_empty_top().
bm::word_t*** bm::blocks_manager< Alloc >::get_rootblock | ( | ) | const [inline] |
Returns root block in the tree.
Definition at line 820 of file bmblocks.h.
const bm::word_t* const* bm::blocks_manager< Alloc >::get_topblock | ( | unsigned | i | ) | const [inline] |
Function returns top-level block in 2-level blocks array.
i | - top level block index |
Definition at line 812 of file bmblocks.h.
References bm::blocks_manager< Alloc >::blocks_, and bm::blocks_manager< Alloc >::top_block_size_.
const bm::word_t* const* bm::blocks_manager< Alloc >::get_topblock | ( | unsigned | i | ) | const [inline] |
Function returns top-level block in 2-level blocks array.
i | - top level block index |
Definition at line 812 of file bmblocks.h.
References bm::blocks_manager< Alloc >::blocks_, and bm::blocks_manager< Alloc >::top_block_size_.
const gap_word_t* bm::blocks_manager< Alloc >::glen | ( | ) | const [inline] |
Returns current GAP level vector.
Definition at line 1405 of file bmblocks.h.
References bm::blocks_manager< Alloc >::glevel_len_.
Referenced by bm::blocks_manager< Alloc >::convert_gap2bitset(), bm::blocks_manager< Alloc >::copy_block(), bm::blocks_manager< Alloc >::extend_gap_block(), bm::blocks_manager< Alloc >::block_opt_func::free_block(), bm::blocks_manager< Alloc >::gap_level_func::operator()(), bm::blocks_manager< Alloc >::block_opt_func::operator()(), bm::blocks_manager< Alloc >::block_free_func::operator()(), bm::blocks_manager< Alloc >::block_copy_func::operator()(), and bm::blocks_manager< Alloc >::set_gap_block().
const gap_word_t* bm::blocks_manager< Alloc >::glen | ( | ) | const [inline] |
Returns current GAP level vector.
Definition at line 1405 of file bmblocks.h.
References bm::blocks_manager< Alloc >::glevel_len_.
unsigned bm::blocks_manager< Alloc >::glen | ( | unsigned | level | ) | const [inline] |
Returns GAP level length for specified level.
level | - level number |
Definition at line 1413 of file bmblocks.h.
References bm::blocks_manager< Alloc >::glevel_len_.
unsigned bm::blocks_manager< Alloc >::glen | ( | unsigned | level | ) | const [inline] |
Returns GAP level length for specified level.
level | - level number |
Definition at line 1413 of file bmblocks.h.
References bm::blocks_manager< Alloc >::glevel_len_.
void bm::blocks_manager< Alloc >::init_tree | ( | ) | [inline, private] |
allocate first level of descr. of blocks
Definition at line 1526 of file bmblocks.h.
References bm::blocks_manager< Alloc >::alloc_, bm::blocks_manager< Alloc >::blocks_, bm::blocks_manager< Alloc >::effective_top_block_size_, and bm::blocks_manager< Alloc >::top_block_size_.
void bm::blocks_manager< Alloc >::init_tree | ( | ) | [inline, private] |
allocate first level of descr. of blocks
Definition at line 1526 of file bmblocks.h.
References bm::blocks_manager< Alloc >::alloc_, bm::blocks_manager< Alloc >::blocks_, bm::blocks_manager< Alloc >::effective_top_block_size_, and bm::blocks_manager< Alloc >::top_block_size_.
Referenced by bm::blocks_manager< Alloc >::blocks_manager(), and bm::blocks_manager< Alloc >::set_all_zero().
bool bm::blocks_manager< Alloc >::is_block_gap | ( | unsigned | nb | ) | const [inline] |
Definition at line 1256 of file bmblocks.h.
References BMPTR_TESTBIT0, and bm::blocks_manager< Alloc >::get_block().
bool bm::blocks_manager< Alloc >::is_block_gap | ( | unsigned | nb | ) | const [inline] |
Definition at line 1256 of file bmblocks.h.
References BMPTR_TESTBIT0, and bm::blocks_manager< Alloc >::get_block().
bool bm::blocks_manager< Alloc >::is_block_one | ( | unsigned | nb, |
const bm::word_t * | blk, | ||
bool | deep_scan = true |
||
) | const [inline] |
Checks if block has only 1 bits.
nb | - Index of the block. |
blk | - Block's pointer |
deep_scan | - flag to do full bit block verification (scan) when deep scan is not requested result can be approximate |
Definition at line 1317 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.
bool bm::blocks_manager< Alloc >::is_block_one | ( | unsigned | nb, |
const bm::word_t * | blk, | ||
bool | deep_scan = true |
||
) | const [inline] |
Checks if block has only 1 bits.
nb | - Index of the block. |
blk | - Block's pointer |
deep_scan | - flag to do full bit block verification (scan) when deep scan is not requested result can be approximate |
Definition at line 1317 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.
bool bm::blocks_manager< Alloc >::is_block_zero | ( | unsigned | nb, |
const bm::word_t * | blk, | ||
bool | deep_scan = true |
||
) | const [inline] |
Definition at line 1285 of file bmblocks.h.
References BM_IS_GAP, BMGAP_PTR, bm::gap_is_all_zero(), bm::gap_max_bits, and bm::set_block_size.
Referenced by bm::blocks_manager< Alloc >::find_next_nz_block().
bool bm::blocks_manager< Alloc >::is_block_zero | ( | unsigned | nb, |
const bm::word_t * | blk, | ||
bool | deep_scan = true |
||
) | const [inline] |
Definition at line 1285 of file bmblocks.h.
References BM_IS_GAP, BMGAP_PTR, bm::gap_is_all_zero(), bm::gap_max_bits, and bm::set_block_size.
bool bm::blocks_manager< Alloc >::is_subblock_null | ( | unsigned | nsub | ) | const [inline] |
Returns true if second level block pointer is 0.
Definition at line 1392 of file bmblocks.h.
References bm::blocks_manager< Alloc >::blocks_.
bool bm::blocks_manager< Alloc >::is_subblock_null | ( | unsigned | nsub | ) | const [inline] |
Returns true if second level block pointer is 0.
Definition at line 1392 of file bmblocks.h.
References bm::blocks_manager< Alloc >::blocks_.
bm::word_t* bm::blocks_manager< Alloc >::make_bit_block | ( | unsigned | nb | ) | [inline] |
Create all-zeros bit block.
Old block (if exists) gets deleted.
Definition at line 863 of file bmblocks.h.
References bm::blocks_manager< Alloc >::alloc_bit_block(), and bm::bit_block_set().
bm::word_t* bm::blocks_manager< Alloc >::make_bit_block | ( | unsigned | nb | ) | [inline] |
Create all-zeros bit block.
Old block (if exists) gets deleted.
Definition at line 863 of file bmblocks.h.
References bm::blocks_manager< Alloc >::alloc_bit_block(), and bm::bit_block_set().
unsigned bm::blocks_manager< Alloc >::mem_used | ( | ) | const [inline] |
Definition at line 1376 of file bmblocks.h.
References bm::blocks_manager< Alloc >::blocks_, bm::set_array_size, bm::set_block_size, bm::blocks_manager< Alloc >::temp_block_, and bm::blocks_manager< Alloc >::top_block_size_.
Referenced by bm::blocks_manager< Alloc >::mem_used().
unsigned bm::blocks_manager< Alloc >::mem_used | ( | ) | const [inline] |
Definition at line 1376 of file bmblocks.h.
References bm::blocks_manager< Alloc >::blocks_, bm::blocks_manager< Alloc >::mem_used(), bm::set_array_size, bm::set_block_size, bm::blocks_manager< Alloc >::temp_block_, and bm::blocks_manager< Alloc >::top_block_size_.
void bm::blocks_manager< Alloc >::operator= | ( | const blocks_manager< Alloc > & | ) | [private] |
void bm::blocks_manager< Alloc >::operator= | ( | const blocks_manager< Alloc > & | ) | [private] |
void bm::blocks_manager< Alloc >::reserve | ( | unsigned | max_bits | ) | [inline] |
reserve capacity for specified number of bits
Definition at line 1458 of file bmblocks.h.
References bm::blocks_manager< Alloc >::compute_top_block_size(), and bm::blocks_manager< Alloc >::reserve_top_blocks().
void bm::blocks_manager< Alloc >::reserve | ( | unsigned | max_bits | ) | [inline] |
reserve capacity for specified number of bits
Definition at line 1458 of file bmblocks.h.
References bm::blocks_manager< Alloc >::compute_top_block_size(), and bm::blocks_manager< Alloc >::reserve_top_blocks().
void bm::blocks_manager< Alloc >::reserve_top_blocks | ( | unsigned | top_blocks | ) | [inline] |
Make sure blocks manager has enough blocks capacity.
Definition at line 1470 of file bmblocks.h.
References bm::blocks_manager< Alloc >::alloc_, bm::blocks_manager< Alloc >::blocks_, bm::set_array_size, and bm::blocks_manager< Alloc >::top_block_size_.
void bm::blocks_manager< Alloc >::reserve_top_blocks | ( | unsigned | top_blocks | ) | [inline] |
Make sure blocks manager has enough blocks capacity.
Definition at line 1470 of file bmblocks.h.
References bm::blocks_manager< Alloc >::alloc_, bm::blocks_manager< Alloc >::blocks_, bm::set_array_size, and bm::blocks_manager< Alloc >::top_block_size_.
Referenced by bm::blocks_manager< Alloc >::reserve(), and bm::blocks_manager< Alloc >::set_block().
void bm::blocks_manager< Alloc >::set_all_one | ( | ) | [inline] |
Replaces all blocks with ALL_ONE block.
Definition at line 1008 of file bmblocks.h.
References bm::blocks_manager< Alloc >::blocks_, bm::for_each_block(), bm::set_array_size, and bm::blocks_manager< Alloc >::top_block_size_.
void bm::blocks_manager< Alloc >::set_all_one | ( | ) | [inline] |
Replaces all blocks with ALL_ONE block.
Definition at line 1008 of file bmblocks.h.
References bm::blocks_manager< Alloc >::blocks_, bm::for_each_block(), bm::set_array_size, and bm::blocks_manager< Alloc >::top_block_size_.
void bm::blocks_manager< Alloc >::set_all_zero | ( | bool | free_mem | ) | [inline] |
Fills all blocks with 0.
free_mem | - if true function frees the resources |
Definition at line 990 of file bmblocks.h.
References bm::blocks_manager< Alloc >::blocks_, bm::blocks_manager< Alloc >::deinit_tree(), bm::blocks_manager< Alloc >::effective_top_block_size(), bm::for_each_nzblock(), and bm::blocks_manager< Alloc >::init_tree().
void bm::blocks_manager< Alloc >::set_all_zero | ( | bool | free_mem | ) | [inline] |
Fills all blocks with 0.
free_mem | - if true function frees the resources |
Definition at line 990 of file bmblocks.h.
References bm::blocks_manager< Alloc >::blocks_, bm::blocks_manager< Alloc >::deinit_tree(), bm::blocks_manager< Alloc >::effective_top_block_size(), bm::for_each_nzblock(), and bm::blocks_manager< Alloc >::init_tree().
Referenced by bm::bvector< Alloc >::clear().
bm::word_t* bm::blocks_manager< Alloc >::set_block | ( | unsigned | nb, |
bm::word_t * | block | ||
) | [inline] |
Places new block into descriptors table, returns old block's address.
NOTE:Old block is not deleted.
Definition at line 1019 of file bmblocks.h.
References bm::blocks_manager< Alloc >::alloc_, bm::blocks_manager< Alloc >::blocks_, bm::blocks_manager< Alloc >::effective_top_block_size_, bm::blocks_manager< Alloc >::reserve_top_blocks(), bm::set_array_mask, bm::set_array_shift, bm::set_array_size, and bm::blocks_manager< Alloc >::top_block_size_.
Referenced by bm::blocks_manager< Alloc >::alloc_bit_block(), bm::blocks_manager< Alloc >::check_allocate_block(), bm::blocks_manager< Alloc >::convert_gap2bitset(), bm::blocks_manager< Alloc >::copy_block(), bm::blocks_manager< Alloc >::deoptimize_block(), bm::blocks_manager< Alloc >::block_invert_func::operator()(), bm::blocks_manager< Alloc >::block_copy_func::operator()(), bm::blocks_manager< Alloc >::set_block_all_set(), bm::blocks_manager< Alloc >::set_gap_block(), and bm::blocks_manager< Alloc >::zero_block().
bm::word_t* bm::blocks_manager< Alloc >::set_block | ( | unsigned | nb, |
bm::word_t * | block | ||
) | [inline] |
Places new block into descriptors table, returns old block's address.
NOTE:Old block is not deleted.
Definition at line 1019 of file bmblocks.h.
References bm::blocks_manager< Alloc >::alloc_, bm::blocks_manager< Alloc >::blocks_, bm::blocks_manager< Alloc >::effective_top_block_size_, bm::blocks_manager< Alloc >::reserve_top_blocks(), bm::set_array_mask, bm::set_array_shift, bm::set_array_size, and bm::blocks_manager< Alloc >::top_block_size_.
bm::word_t* bm::blocks_manager< Alloc >::set_block | ( | unsigned | nb, |
bm::word_t * | block, | ||
bool | gap | ||
) | [inline] |
Places new block into descriptors table, returns old block's address.
Old block is not deleted.
Definition at line 1078 of file bmblocks.h.
References bm::blocks_manager< Alloc >::alloc_, bm::blocks_manager< Alloc >::blocks_, BMPTR_CLEARBIT0, BMPTR_SETBIT0, bm::blocks_manager< Alloc >::effective_top_block_size_, bm::blocks_manager< Alloc >::reserve_top_blocks(), bm::set_array_mask, bm::set_array_shift, bm::set_array_size, and bm::blocks_manager< Alloc >::top_block_size_.
bm::word_t* bm::blocks_manager< Alloc >::set_block | ( | unsigned | nb, |
bm::word_t * | block, | ||
bool | gap | ||
) | [inline] |
Places new block into descriptors table, returns old block's address.
Old block is not deleted.
Definition at line 1078 of file bmblocks.h.
References bm::blocks_manager< Alloc >::alloc_, bm::blocks_manager< Alloc >::blocks_, BMPTR_CLEARBIT0, BMPTR_SETBIT0, bm::blocks_manager< Alloc >::effective_top_block_size_, bm::blocks_manager< Alloc >::reserve_top_blocks(), bm::set_array_mask, bm::set_array_shift, bm::set_array_size, and bm::blocks_manager< Alloc >::top_block_size_.
void bm::blocks_manager< Alloc >::set_block_all_set | ( | unsigned | nb | ) | [inline] |
Definition at line 839 of file bmblocks.h.
References bm::blocks_manager< Alloc >::free_block(), FULL_BLOCK_ADDR, and bm::blocks_manager< Alloc >::set_block().
void bm::blocks_manager< Alloc >::set_block_all_set | ( | unsigned | nb | ) | [inline] |
Definition at line 839 of file bmblocks.h.
References bm::blocks_manager< Alloc >::free_block(), FULL_BLOCK_ADDR, and bm::blocks_manager< Alloc >::set_block().
Referenced by bm::blocks_manager< Alloc >::block_one_func::operator()().
void bm::blocks_manager< Alloc >::set_block_bit | ( | unsigned | nb | ) | [inline] |
Definition at line 1262 of file bmblocks.h.
References BMPTR_CLEARBIT0, bm::blocks_manager< Alloc >::get_block(), and bm::blocks_manager< Alloc >::set_block_ptr().
Referenced by bm::blocks_manager< Alloc >::block_opt_func::free_block(), and bm::blocks_manager< Alloc >::gap_level_func::operator()().
void bm::blocks_manager< Alloc >::set_block_bit | ( | unsigned | nb | ) | [inline] |
Definition at line 1262 of file bmblocks.h.
References BMPTR_CLEARBIT0, bm::blocks_manager< Alloc >::get_block(), and bm::blocks_manager< Alloc >::set_block_ptr().
void bm::blocks_manager< Alloc >::set_block_gap | ( | unsigned | nb | ) | [inline] |
Definition at line 1269 of file bmblocks.h.
References BMPTR_SETBIT0, bm::blocks_manager< Alloc >::get_block(), and bm::blocks_manager< Alloc >::set_block_ptr().
Referenced by bm::blocks_manager< Alloc >::block_opt_func::operator()().
void bm::blocks_manager< Alloc >::set_block_gap | ( | unsigned | nb | ) | [inline] |
Definition at line 1269 of file bmblocks.h.
References BMPTR_SETBIT0, bm::blocks_manager< Alloc >::get_block(), and bm::blocks_manager< Alloc >::set_block_ptr().
void bm::blocks_manager< Alloc >::set_block_ptr | ( | unsigned | nb, |
bm::word_t * | block | ||
) | [inline] |
Places new block into blocks table.
Definition at line 1115 of file bmblocks.h.
References bm::blocks_manager< Alloc >::blocks_, bm::blocks_manager< Alloc >::effective_top_block_size_, bm::set_array_mask, and bm::set_array_shift.
Referenced by bm::blocks_manager< Alloc >::convert_gap2bitset(), bm::blocks_manager< Alloc >::extend_gap_block(), bm::blocks_manager< Alloc >::gap_level_func::operator()(), bm::blocks_manager< Alloc >::block_opt_func::operator()(), bm::blocks_manager< Alloc >::block_invert_func::operator()(), bm::blocks_manager< Alloc >::block_zero_func::operator()(), bm::blocks_manager< Alloc >::set_block_bit(), and bm::blocks_manager< Alloc >::set_block_gap().
void bm::blocks_manager< Alloc >::set_block_ptr | ( | unsigned | nb, |
bm::word_t * | block | ||
) | [inline] |
Places new block into blocks table.
Definition at line 1115 of file bmblocks.h.
References bm::blocks_manager< Alloc >::blocks_, bm::blocks_manager< Alloc >::effective_top_block_size_, bm::set_array_mask, and bm::set_array_shift.
bm::word_t* bm::blocks_manager< Alloc >::set_gap_block | ( | unsigned | nb, |
const gap_word_t * | gap_block_src, | ||
int | level | ||
) | [inline] |
Allocate an place new GAP block (copy of provided block)
Definition at line 1050 of file bmblocks.h.
References BMGAP_PTR, bm::gap_convert_to_bitset(), bm::gap_length(), bm::blocks_manager< Alloc >::get_allocator(), bm::blocks_manager< Alloc >::glen(), bm::blocks_manager< Alloc >::set_block(), and bm::set_gap_level().
bm::word_t* bm::blocks_manager< Alloc >::set_gap_block | ( | unsigned | nb, |
const gap_word_t * | gap_block_src, | ||
int | level | ||
) | [inline] |
Allocate an place new GAP block (copy of provided block)
Definition at line 1050 of file bmblocks.h.
References BMGAP_PTR, bm::gap_convert_to_bitset(), bm::gap_length(), bm::blocks_manager< Alloc >::get_allocator(), bm::blocks_manager< Alloc >::glen(), bm::blocks_manager< Alloc >::set_block(), and bm::set_gap_level().
void bm::blocks_manager< Alloc >::set_glen | ( | const gap_word_t * | glevel_len | ) | [inline] |
Assigns new GAP lengths vector
Definition at line 1349 of file bmblocks.h.
References bm::blocks_manager< Alloc >::glevel_len_.
void bm::blocks_manager< Alloc >::set_glen | ( | const gap_word_t * | glevel_len | ) | [inline] |
Assigns new GAP lengths vector
Definition at line 1349 of file bmblocks.h.
References bm::blocks_manager< Alloc >::glevel_len_.
Referenced by bm::bvector< Alloc >::set_gap_levels().
void bm::blocks_manager< Alloc >::swap | ( | blocks_manager< Alloc > & | bm | ) | [inline] |
Swaps content.
bm | another blocks manager |
Definition at line 1421 of file bmblocks.h.
References bm::blocks_manager< Alloc >::blocks_, bm::blocks_manager< Alloc >::effective_top_block_size_, bm::gap_levels, bm::blocks_manager< Alloc >::glevel_len_, bm::blocks_manager< Alloc >::top_block_size_, and bm::xor_swap().
Referenced by bm::bvector< Alloc >::swap().
void bm::blocks_manager< Alloc >::swap | ( | blocks_manager< Alloc > & | bm | ) | [inline] |
Swaps content.
bm | another blocks manager |
Definition at line 1421 of file bmblocks.h.
References bm::blocks_manager< Alloc >::blocks_, bm::blocks_manager< Alloc >::effective_top_block_size_, bm::gap_levels, bm::blocks_manager< Alloc >::glevel_len_, bm::blocks_manager< Alloc >::top_block_size_, and bm::xor_swap().
unsigned bm::blocks_manager< Alloc >::top_block_size | ( | ) | const [inline] |
Returns size of the top block array in the tree.
Definition at line 1442 of file bmblocks.h.
References bm::blocks_manager< Alloc >::top_block_size_.
Referenced by bm::blocks_manager< Alloc >::compute_top_block_size(), bm::bvector< Alloc >::enumerator::go_first(), and bm::bvector< Alloc >::set_gap_levels().
unsigned bm::blocks_manager< Alloc >::top_block_size | ( | ) | const [inline] |
Returns size of the top block array in the tree.
Definition at line 1442 of file bmblocks.h.
References bm::blocks_manager< Alloc >::top_block_size_.
bm::word_t* bm::blocks_manager< Alloc >::zero_block | ( | unsigned | nb | ) | [inline] |
Free block, make it zero pointer in the tree.
Definition at line 1182 of file bmblocks.h.
References bm::blocks_manager< Alloc >::free_block(), bm::blocks_manager< Alloc >::get_block(), and bm::blocks_manager< Alloc >::set_block().
Referenced by bm::blocks_manager< Alloc >::copy_bit_block(), and bm::blocks_manager< Alloc >::copy_block().
bm::word_t* bm::blocks_manager< Alloc >::zero_block | ( | unsigned | nb | ) | [inline] |
Free block, make it zero pointer in the tree.
Definition at line 1182 of file bmblocks.h.
References bm::blocks_manager< Alloc >::free_block(), bm::blocks_manager< Alloc >::get_block(), and bm::blocks_manager< Alloc >::set_block().
bm::word_t* bm::blocks_manager< Alloc >::zero_block | ( | unsigned | i, |
unsigned | j | ||
) | [inline] |
Free block, make it zero pointer in the tree.
Definition at line 1194 of file bmblocks.h.
References bm::blocks_manager< Alloc >::blocks_, and bm::blocks_manager< Alloc >::free_block().
bm::word_t* bm::blocks_manager< Alloc >::zero_block | ( | unsigned | i, |
unsigned | j | ||
) | [inline] |
Free block, make it zero pointer in the tree.
Definition at line 1194 of file bmblocks.h.
References bm::blocks_manager< Alloc >::blocks_, and bm::blocks_manager< Alloc >::free_block().
allocator_type bm::blocks_manager< Alloc >::alloc_ [private] |
allocator
Definition at line 1552 of file bmblocks.h.
Referenced by bm::blocks_manager< Alloc >::allocate_gap_block(), bm::blocks_manager< Alloc >::check_allocate_block(), bm::blocks_manager< Alloc >::check_allocate_tempblock(), bm::blocks_manager< Alloc >::convert_gap2bitset(), bm::blocks_manager< Alloc >::deinit_tree(), bm::blocks_manager< Alloc >::extend_gap_block(), bm::blocks_manager< Alloc >::free_block(), bm::blocks_manager< Alloc >::free_ptr(), bm::blocks_manager< Alloc >::free_top_block(), bm::blocks_manager< Alloc >::get_allocator(), bm::blocks_manager< Alloc >::init_tree(), bm::blocks_manager< Alloc >::reserve_top_blocks(), bm::blocks_manager< Alloc >::set_block(), and bm::blocks_manager< Alloc >::~blocks_manager().
bm::word_t *** bm::blocks_manager< Alloc >::blocks_ [private] |
Tree of blocks.
Definition at line 1542 of file bmblocks.h.
Referenced by bm::blocks_manager< Alloc >::blocks_manager(), bm::blocks_manager< Alloc >::blocks_root(), bm::blocks_manager< Alloc >::deinit_tree(), bm::blocks_manager< Alloc >::find_next_nz_block(), bm::blocks_manager< Alloc >::free_top_block(), bm::blocks_manager< Alloc >::get_block(), bm::blocks_manager< Alloc >::get_topblock(), bm::blocks_manager< Alloc >::init_tree(), bm::blocks_manager< Alloc >::is_subblock_null(), bm::blocks_manager< Alloc >::mem_used(), bm::blocks_manager< Alloc >::reserve_top_blocks(), bm::blocks_manager< Alloc >::set_all_one(), bm::blocks_manager< Alloc >::set_all_zero(), bm::blocks_manager< Alloc >::set_block(), bm::blocks_manager< Alloc >::set_block_ptr(), bm::blocks_manager< Alloc >::swap(), and bm::blocks_manager< Alloc >::zero_block().
unsigned bm::blocks_manager< Alloc >::effective_top_block_size_ [private] |
Effective size of the top level block array in blocks_ tree.
Definition at line 1546 of file bmblocks.h.
Referenced by bm::blocks_manager< Alloc >::blocks_manager(), bm::blocks_manager< Alloc >::effective_top_block_size(), bm::blocks_manager< Alloc >::find_next_nz_block(), bm::blocks_manager< Alloc >::init_tree(), bm::blocks_manager< Alloc >::set_block(), bm::blocks_manager< Alloc >::set_block_ptr(), and bm::blocks_manager< Alloc >::swap().
gap_word_t bm::blocks_manager< Alloc >::glevel_len_ [private] |
vector defines gap block lengths for different levels
Definition at line 1550 of file bmblocks.h.
Referenced by bm::blocks_manager< Alloc >::allocate_gap_block(), bm::blocks_manager< Alloc >::blocks_manager(), bm::blocks_manager< Alloc >::free_block(), bm::blocks_manager< Alloc >::glen(), bm::blocks_manager< Alloc >::set_glen(), and bm::blocks_manager< Alloc >::swap().
bm::word_t * bm::blocks_manager< Alloc >::temp_block_ [private] |
Temp block.
Definition at line 1548 of file bmblocks.h.
Referenced by bm::blocks_manager< Alloc >::check_allocate_tempblock(), bm::blocks_manager< Alloc >::mem_used(), and bm::blocks_manager< Alloc >::~blocks_manager().
unsigned bm::blocks_manager< Alloc >::top_block_size_ [private] |
Size of the top level block array in blocks_ tree.
Definition at line 1544 of file bmblocks.h.
Referenced by bm::blocks_manager< Alloc >::blocks_manager(), bm::blocks_manager< Alloc >::capacity(), bm::blocks_manager< Alloc >::deinit_tree(), bm::blocks_manager< Alloc >::free_top_block(), bm::blocks_manager< Alloc >::get_block(), bm::blocks_manager< Alloc >::get_topblock(), bm::blocks_manager< Alloc >::init_tree(), bm::blocks_manager< Alloc >::mem_used(), bm::blocks_manager< Alloc >::reserve_top_blocks(), bm::blocks_manager< Alloc >::set_all_one(), bm::blocks_manager< Alloc >::set_block(), bm::blocks_manager< Alloc >::swap(), and bm::blocks_manager< Alloc >::top_block_size().