69 cout <<
"bv1 count = " << bv1.
count() << endl;
70 cout <<
"bv2 count = " << bv2.
count() << endl;
104 std::vector<unsigned char> vect1;
105 std::vector<unsigned char> vect2;
107 vect1.resize(sbuf1.size());
108 vect2.resize(sbuf2.size());
110 ::memcpy(vect1.data(), sbuf1.buf(), sbuf1.size());
111 ::memcpy(vect2.data(), sbuf2.buf(), sbuf2.size());
137 cout <<
"bv4 count = " << bv4.
count() << endl;
138 bool eq = bv1.
equal(bv4);
141 cerr <<
"Logical error detected!" << endl;
145 cout <<
"bv4 is equal to bv1" << endl;
157 cout <<
"minus count = " << cnt_sub << endl;
164 auto bv5_cnt = bv5.
count();
165 cout <<
"bv5 count = " << bv5_cnt << endl;
167 if (cnt_sub != bv5_cnt)
169 cerr <<
"Logical error!" << endl;
173 catch(std::exception& ex)
175 std::cerr << ex.what() << std::endl;
Compressed bit-vector bvector<> container, set algebraic methods, traversal iterators.
#define BM_DECLARE_TEMP_BLOCK(x)
Serialization / compression of bvector<>. Set theoretical operations on compressed BLOBs.
pre-processor un-defines to avoid global space pollution (internal)
Bitvector Bit-vector container with runtime compression of bits.
bool equal(const bvector< Alloc > &bvect) const BMNOEXCEPT
Equal comparison with an agr bit-vector.
size_type count() const BMNOEXCEPT
population count (count of ON bits)
bvector< Alloc > & set(size_type n, bool val=true)
Sets bit n if val is true, clears bit n if val is false.
void optimize(bm::word_t *temp_block=0, optmode opt_mode=opt_compress, statistics *stat=0)
Optimize memory bitvector's memory allocation.
Deserializer, performs logical operations between bit-vector and serialized bit-vector.
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.
Bit-vector serialization class.
void set_compression_level(unsigned clevel) BMNOEXCEPT
Set compression level.
size_type serialize(const BV &bv, unsigned char *buf, size_t buf_size)
Bitvector serialization into memory block.
size_t deserialize(BV &bv, const unsigned char *buf, bm::word_t *temp_block=0, const bm::bv_ref_vector< BV > *ref_vect=0)
Bitvector deserialization from a memory BLOB.
static void fill_bvector(bm::bvector<> *bv)
Statistical information about bitset's memory allocation details.