BitMagic-C++
|
Algorithms and iterators for bit ranges and intervals. More...
Data Structures | |
class | bm::interval_enumerator< BV > |
forward iterator class to traverse bit-vector as ranges More... | |
Functions | |
template<class BV > | |
bool | bm::is_interval (const BV &bv, typename BV::size_type left, typename BV::size_type right) BMNOEXCEPT |
Returns true if range is all 1s flanked with 0s Function performs the test on a closed range [left, right] true interval is all 1s AND test(left-1)==false AND test(right+1)==false Examples: 01110 [1,3] - true 11110 [0,3] - true 11110 [1,3] - false. More... | |
template<class BV > | |
bool | bm::find_interval_start (const BV &bv, typename BV::size_type from, typename BV::size_type &pos) BMNOEXCEPT |
Reverse find index of first 1 bit gap (01110) starting from position Reverse scan for the first 1 in a block of continious 1s. Method employs closed interval semantics: 0[pos..from]. More... | |
template<typename BV > | |
bool | bm::find_interval_end (const BV &bv, typename BV::size_type from, typename BV::size_type &pos) BMNOEXCEPT |
Reverse find index of first 1 bit gap (01110) starting from position Reverse scan for the first 1 in a block of continious 1s. Method employs closed interval semantics: 0[pos..from]. More... | |
Algorithms and iterators for bit ranges and intervals.
bool bm::find_interval_end | ( | const BV & | bv, |
typename BV::size_type | from, | ||
typename BV::size_type & | pos | ||
) |
Reverse find index of first 1 bit gap (01110) starting from position Reverse scan for the first 1 in a block of continious 1s. Method employs closed interval semantics: 0[pos..from].
bv | - bit-vector for search |
from | - position to start reverse search from |
pos | - [out] index of the found first 1 bit in a gap of bits |
Definition at line 438 of file bmintervals.h.
References bm::block_find_interval_end(), BM_ASSERT, FULL_BLOCK_FAKE_ADDR, bm::gap_max_bits, bm::get_block_coord(), bm::id_max, bm::set_block_mask, bm::set_block_shift, and bm::set_sub_array_size.
Referenced by bm::interval_enumerator< BV >::advance(), bm::interval_enumerator< BV >::go_to_impl(), main(), and splice_model().
bool bm::find_interval_start | ( | const BV & | bv, |
typename BV::size_type | from, | ||
typename BV::size_type & | pos | ||
) |
Reverse find index of first 1 bit gap (01110) starting from position Reverse scan for the first 1 in a block of continious 1s. Method employs closed interval semantics: 0[pos..from].
bv | - bit-vector for search |
from | - position to start reverse search from |
pos | - [out] index of the found first 1 bit in a gap of bits |
Definition at line 315 of file bmintervals.h.
References bm::block_find_interval_start(), BM_ASSERT, FULL_BLOCK_FAKE_ADDR, bm::gap_max_bits, bm::get_block_coord(), bm::set_block_mask, and bm::set_block_shift.
Referenced by bm::interval_enumerator< BV >::go_to_impl(), main(), and splice_model().
bool bm::is_interval | ( | const BV & | bv, |
typename BV::size_type | left, | ||
typename BV::size_type | right | ||
) |
Returns true if range is all 1s flanked with 0s Function performs the test on a closed range [left, right] true interval is all 1s AND test(left-1)==false AND test(right+1)==false Examples: 01110 [1,3] - true 11110 [0,3] - true 11110 [1,3] - false.
bv | - bit-vector for check |
left | - index of first bit start checking |
right | - index of last bit |
Definition at line 248 of file bmintervals.h.
References bm::block_is_interval(), bm::gap_max_bits, bm::get_block_coord(), bm::id_max, bm::set_block_mask, bm::set_block_shift, and bm::xor_swap().
Referenced by main().