Go to the documentation of this file.
68 for (; en.
valid() && cnt < 10; ++en, ++cnt)
72 cout <<
"(size = "<< bv.
size() <<
")" << endl;
87 target_buf.resize(sbuf.size());
88 ::memcpy(target_buf.data(), sbuf.buf(), sbuf.size());
156 vector<size_type> vect_B { 1, 2, 4 };
167 vector<size_type> vect_B { 1, 2, 4 };
169 const size_type* arr = &vect_B[0];
178 vector<unsigned char> blob;
268 vector<unsigned> vect_B { 1, 2, 4 };
278 vector<size_type> vect_B { 1, 2, 4 };
280 const size_type* arr = &vect_B[0];
289 vector<unsigned char> blob;
376 vector<unsigned> vect_B { 1, 2, 4 };
386 vector<unsigned char> blob;
449 vector<size_type> vect_B { 1, 2, 4 };
459 vector<size_type> vect_B { 1, 2, 4 };
461 const size_type* arr = &vect_B[0];
470 vector<unsigned char> blob;
583 cout << endl <<
"Set Union (OR) demo" << endl << endl;
586 cout << endl <<
"Set Intersect (AND) demo" << endl << endl;
589 cout << endl <<
"XOR demo" << endl << endl;
592 cout << endl <<
"Set Minus (SUB/AND-NOT) demo" << endl << endl;
595 cout << endl <<
"Set Invert (NOT) demo" << endl << endl;
598 cout << endl <<
"Set AND-SUB demo" << endl << endl;
601 catch(std::exception& ex)
603 std::cerr << ex.what() << std::endl;
Algorithms for fast aggregation of N bvectors.
void combine_or(bvector_type &bv_target)
Aggregate added group of vectors using logical OR Operation does NOT perform an explicit reset of arg...
void combine_and(BV &bv, It first, It last)
AND Combine bitvector and the iterable sequence.
static void print_bvector(const bm::bvector<> &bv)
size_type size() const BMNOEXCEPT
Returns bvector's capacity (number of bits it can store)
bm::bvector< Alloc > & bit_or(const bm::bvector< Alloc > &bv1, const bm::bvector< Alloc > &bv2, typename bm::bvector< Alloc >::optmode opt_mode)
3-operand OR : this := bv1 OR bv2
#define BM_DECLARE_TEMP_BLOCK(x)
bm::bvector< Alloc > & bit_and(const bm::bvector< Alloc > &bv1, const bm::bvector< Alloc > &bv2, typename bm::bvector< Alloc >::optmode opt_mode)
3-operand AND : this := bv1 AND bv2
void combine_and(bvector_type &bv_target)
Aggregate added group of vectors using logical AND Operation does NOT perform an explicit reset of ar...
input set is sorted (ascending order)
size_type serialize(const BV &bv, unsigned char *buf, size_t buf_size)
Bitvector serialization into memory block.
Algorithms for fast aggregation of a group of bit-vectors.
Constant iterator designed to enumerate "ON" bits.
Algorithms for bvector<> (main include)
bool combine_and_sub(bvector_type &bv_target)
Aggregate added group of vectors using fused logical AND-SUB Operation does NOT perform an explicit r...
void set_compression_level(unsigned clevel) BMNOEXCEPT
Set compression level.
static void DemoAND_SUB()
bvector< Alloc > & set(size_type n, bool val=true)
Sets bit n if val is true, clears bit n if val is false.
bool valid() const BMNOEXCEPT
Checks if iterator is still valid. Analog of != 0 comparison for pointers.
bm::bvector< Alloc > & bit_sub(const bm::bvector< Alloc > &bv1, const bm::bvector< Alloc > &bv2, typename bm::bvector< Alloc >::optmode opt_mode)
3-operand SUB : this := bv1 MINUS bv2 SUBtraction is also known as AND NOT
void keep(const size_type *ids, size_type ids_size, bm::sort_order so=bm::BM_UNKNOWN)
Keep list of bits in this bitset, others are cleared.
static void make_BLOB(vector< unsigned char > &target_buf, bm::bvector<> &bv)
void set_optimization(typename bvector_type::optmode opt=bvector_type::opt_compress)
set on-the-fly bit-block compression By default aggregator does not try to optimize result,...
Deserializer, performs logical operations between bit-vector and serialized bit-vector.
void clear(const size_type *ids, size_type ids_size, bm::sort_order so=bm::BM_UNKNOWN)
clear list of bits in this bitset
Bit-vector serialization class.
void resize(size_type new_size)
Change size of the bvector.
unsigned add(const bvector_type *bv, unsigned agr_group=0) BMNOEXCEPT
Attach source bit-vector to a argument group (0 or 1).
bvector< Alloc > & invert()
Invert/NEG all bits It should be noted, invert is affected by size() if size is set - it only inverts...
void combine_or(BV &bv, It first, It last)
OR Combine bitvector and the iterable sequence.
size_type deserialize(bvector_type &bv, const unsigned char *buf, set_operation op, bool exit_on_one=false)
Deserialize bvector using buffer as set operation argument.
Serialization / compression of bvector<>. Set theoretical operations on compressed BLOBs.
bm::bvector< Alloc > & bit_xor(const bm::bvector< Alloc > &bv1, const bm::bvector< Alloc > &bv2, typename bm::bvector< Alloc >::optmode opt_mode)
3-operand XOR : this := bv1 XOR bv2
void reset() BMNOEXCEPT
Reset aggregate groups, forget all attached vectors.
void merge(bm::bvector< Alloc > &bvect)
Merge/move content from another vector.
void combine_operation(const bm::bvector< Alloc > &bvect, bm::operation opcode)
perform a set-algebra operation by operation code
enumerator first() const
Returns enumerator pointing on the first non-zero bit.
void combine_xor(BV &bv, It first, It last)
XOR Combine bitvector and the iterable sequence.
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.
void combine_sub(BV &bv, It first, It last)
SUB Combine bitvector and the iterable sequence.