Go to the documentation of this file.
62 cout <<
"<EMPTY SET>";
64 for(;first != last; ++first)
65 cout << *first <<
", ";
79 cout <<
"Source set:";
82 cout <<
"bvector<>::is_all_one_range() demo" << endl;
85 cout << all_one << endl;
87 cout << all_one << endl;
89 cout <<
"bvector<>::is_interval() demo" << endl;
92 cout << is_int << endl;
94 cout << is_int << endl;
96 cout <<
"bvector<>::any_range() demo" << endl;
99 cout << any_one << endl;
101 cout << any_one << endl;
106 cout <<
"bvector<>::find_interval demo" << endl;
114 cout <<
"Not found." << endl;
122 cout <<
"Not found." << endl;
129 cout <<
"Not found." << endl;
149 bool eq = bv.
equal(bv2);
169 cout <<
"BLOB size=" << buf.size() << endl;
182 catch(std::exception& ex)
184 std::cerr << ex.what() << std::endl;
bvector< Alloc > & set_range(size_type left, size_type right, bool value=true)
Sets all bits in the specified closed interval [left,right] Interval must be inside the bvector's siz...
bool 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 ...
void keep_range(size_type left, size_type right)
Sets all bits to zero outside of the closed interval [left,right] Expected result: 00000....
size_type serialize(const BV &bv, unsigned char *buf, size_t buf_size)
Bitvector serialization into memory block.
void copy_range(const bvector< Alloc > &bvect, size_type left, size_type right)
Copy all bits in the specified closed interval [left,right].
bool equal(const bvector< Alloc > &bvect) const BMNOEXCEPT
Equal comparison with an agr bit-vector.
bool any_range(size_type left, size_type right) const BMNOEXCEPT
Returns true if any bits in the range are 1s (non-empty interval) Function uses closed interval [left...
Algorithms for bit ranges and intervals.
void PrintContainer(T first, T last)
Bit-vector serialization class.
void clear_range(size_type left, size_type right)
Sets all bits to zero in the specified closed interval [left,right] Interval must be inside the bvect...
Serialization / compression of bvector<>. Set theoretical operations on compressed BLOBs.
enumerator end() const
Returns enumerator pointing on the next bit after the last.
void deserialize_range(BV &bv, const unsigned char *buf, typename BV::size_type from, typename BV::size_type to, const bm::bv_ref_vector< BV > *ref_vect=0)
Bitvector range deserialization from a memory BLOB.
enumerator first() const
Returns enumerator pointing on the first non-zero bit.
void set_bookmarks(bool enable, unsigned bm_interval=256) BMNOEXCEPT
Add skip-markers to serialization BLOB for faster range decode at the expense of some BLOB size incre...
Compressed bit-vector bvector<> container, set algebraic methods, traversal iterators.
void optimize(bm::word_t *temp_block=0, optmode opt_mode=opt_compress, statistics *stat=0)
Optimize memory bitvector's memory allocation.
bool 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 ...
bool 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,...
bool is_all_one_range(size_type left, size_type right) const BMNOEXCEPT
Returns true if all bits in the range are 1s (saturated interval) Function uses closed interval [left...