<
typenameBV>
59 typedef typenamebvector_type::size_type
size_type;
139{
return(
start() == ien.start()); }
141{
return(
start() != ien.start()); }
143{
return(
start() < ien.start()); }
145{
return(
start() <= ien.start()); }
147{
return(
start() > ien.start()); }
149{
return(
start() >= ien.start()); }
193{
advance();
return*
this; }
254 const typenameBV::blocks_manager_type& bman = bv.get_blocks_manager();
269 if(nblock_left == nblock_right)
277 const bm::word_t* block = bman.get_block_ptr(i0, j0);
282 boolis_left, is_right, is_all_one;
283is_left = left > 0 ? bv.test(left-1) :
false;
284 if(is_left ==
false)
286is_right = (right < (
bm::id_max- 1)) ? bv.test(right + 1) :
false;
287 if(is_left ==
false&& is_right ==
false)
289is_all_one = bv.is_all_one_range(left, right);
316 typenameBV::size_type from,
319 typedef typenameBV::size_type
size_type;
322 const typenameBV::blocks_manager_type& bman = bv.get_blocks_manager();
329 returnbv.test(from);
339 const bm::word_t* block = bman.get_block_ptr(i0, j0);
353base_idx = bm::get_block_start<size_type>(i0, j0);
354pos = base_idx + found_nbit;
364 bm::word_t*** blk_root = bman.top_blocks_root();
366 for(
unsigned i= i0;
true; --
i)
373pos = bm::get_super_block_start<size_type>(
i);
378 unsignedj = (
i== i0) ? j0 : 255;
383pos = bm::get_block_start<size_type>(
i, j);
398base_idx = bm::get_block_start<size_type>(
i, j);
399pos = base_idx + found_nbit;
402pos = bm::get_block_start<size_type>(
i, j);
437 template<
typenameBV>
439 typenameBV::size_type from,
446 const typenameBV::blocks_manager_type& bman = bv.get_blocks_manager();
453 returnbv.test(from);
462 const bm::word_t* block = bman.get_block_ptr(i0, j0);
482 unsignedi_from, j_from, i_to, j_to;
485 if(i_to >= top_size)
486i_to = unsigned(top_size-1);
489 bm::word_t*** blk_root = bman.top_blocks_root();
492 for(
unsigned i= i_from;
i<= i_to; ++
i)
510 unsignedj = (
i== i_from) ? j_from : 0;
549 template<
typenameBV>
558 template<
typenameBV>
567 template<
typenameBV>
575 template<
typenameBV>
583 template<
typenameBV>
591 template<
typenameBV>
610found =
bv_->find(pos, start_pos);
620found =
bv_->find(pos, start_pos);
632 const typenameBV::blocks_manager_type& bman =
bv_->get_blocks_manager();
635 const bm::word_t* block = bman.get_block_ptr(i0, j0);
688 for(
unsigned i= 1;
i<=
len; ++
i)
716 template<
typenameBV>
756 template<
typenameBV>
759 constBV* bv_tmp =
bv_;
769ien.gap_ptr_ = gap_tmp;
#define FULL_BLOCK_FAKE_ADDR
value_type * data() const noexcept
void resize(size_type new_size)
vector resize
size_type size() const noexcept
void swap(heap_vector< Val, BVAlloc, trivial_type > &other) noexcept
forward iterator class to traverse bit-vector as ranges
std::input_iterator_tag iterator_category
const bm::gap_word_t * gap_ptr_
! current inetrval
bvector_type::block_idx_type block_idx_type
const pair_type & get() const noexcept
Get interval pair.
interval_enumerator(const BV &bv, size_type start_pos, bool extend_start)
Construct enumerator for the specified position.
bool go_to_impl(size_type pos, bool extend_start)
bm::pair< size_type, size_type > pair_type
bm::byte_buffer< allocator_type > buffer_type
bool operator>=(const interval_enumerator< BV > &ien) const noexcept
interval_enumerator(const BV &bv)
Construct enumerator for the bit-vector.
bool operator==(const interval_enumerator< BV > &ien) const noexcept
interval_enumerator & operator=(const interval_enumerator< BV > &ien)
Assignment operator.
void invalidate() noexcept
Turn FSM into invalid state (out of range)
interval_enumerator< BV > operator++(int) noexcept
Advance enumerator forward to the next available bit.
interval_enumerator(interval_enumerator< BV > &&ien) noexcept
move-ctor
bool valid() const noexcept
Returns true if enumerator is valid (false if traversal is done)
interval_enumerator< BV > & operator=(interval_enumerator< BV > &&ien) noexcept
move assignmment operator
interval_enumerator(const interval_enumerator< BV > &ien)
Copy constructor.
bm::heap_vector< unsigned short, bv_allocator_type, true > gap_vector_type
gap_vector_type gap_buf_
!< bit-vector for traversal
pair_type interval_
!< GAP buf.vector for bit-block
size_type start() const noexcept
Return interval start/left as bit-vector coordinate 011110 [left..right].
bool operator<(const interval_enumerator< BV > &ien) const noexcept
size_type end() const noexcept
Return interval end/right as bit-vector coordinate 011110 [left..right].
bvector_type::allocator_type bv_allocator_type
bvector_type::size_type size_type
bool operator<=(const interval_enumerator< BV > &ien) const noexcept
bool operator!=(const interval_enumerator< BV > &ien) const noexcept
bool operator>(const interval_enumerator< BV > &ien) const noexcept
void swap(interval_enumerator< BV > &ien) noexcept
swap enumerator with another one
bvector_type::allocator_type allocator_type
bool go_to(size_type pos, bool extend_start=true)
Go to inetrval at specified position Jump to position with interval. If interval is not available at ...
static DLIST_TYPE *DLIST_NAME() prev(DLIST_LIST_TYPE *list, DLIST_TYPE *item)
bool find_interval_end(const BV &bv, typename BV::size_type from, typename BV::size_type &pos) noexcept
Reverse find index of first 1 bit gap (01110) starting from position Reverse scan for the first 1 in ...
bool is_interval(const BV &bv, typename BV::size_type left, typename BV::size_type right) noexcept
Returns true if range is all 1s flanked with 0s Function performs the test on a closed range [left,...
bool find_interval_start(const BV &bv, typename BV::size_type from, typename BV::size_type &pos) noexcept
Reverse find index of first 1 bit gap (01110) starting from position Reverse scan for the first 1 in ...
void xor_swap(W &x, W &y) noexcept
XOR swap two variables.
const unsigned set_block_mask
const unsigned set_sub_array_size
void get_block_coord(BI_TYPE nb, unsigned &i, unsigned &j) noexcept
Recalc linear bvector block index into 2D matrix coordinates.
unsigned block_find_interval_start(const bm::word_t *block, unsigned nbit_from, unsigned *found_nbit) noexcept
Find start of the current 111 interval.
unsigned bit_to_gap(gap_word_t *dest, const unsigned *block, unsigned dest_len) noexcept
Convert bit block to GAP representation.
bool block_is_interval(const bm::word_t *const block, unsigned left, unsigned right) noexcept
Returns "true" if all bits are 1 in the block [left, right] and border bits are 0.
unsigned gap_bfind(const T *buf, unsigned pos, unsigned *is_set) noexcept
unsigned short gap_word_t
unsigned block_find_interval_end(const bm::word_t *block, unsigned nbit_from, unsigned *found_nbit) noexcept
Find end of the current 111 interval.
const unsigned gap_max_bits
const unsigned set_block_shift
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4