BitMagic C++ Library: APIs
February 11, 2018
Headers
bm.h

Root of BitMagic API, implements
bm::bvector<>
. Iterators, methods and functions implementing container and main set algebraic operations. Very often, this is sufficiently enough to start working with bit sets. bmserial.h

Classes and methods to transform bitvector into a compact BLOB, ready for I/O or network transfer. Tools to restore/deserialize bitvector. Methods to perform logical operations between bitvector and its compact, serialized BLOB.
bmalgo.h
bmalho_impl.h

Algorithms with bit vectors to build various similarity/distance metrics and components of complex metrics efficiently, without producing intermediate temporary bit vectors. Logical operations between bit vectors and arrays (or STL iterators).
bmrandom.h

bm::random_subset<>
 template utility to do random sampling of bitvectors. bmsparsevec.h

bm::sparse_vector<>
 template container for bittransposed arrays. Each bit plain represented as compressed bitvector, implements a form of inmemory compression for primitive integer types. bmsparsevec_algo.h

Algorithms based on sparse vector. Dynamic range clipping, setalgebra on plains, etc.
bmsparsevec_serial.h

Serialization and deserialization of sparse vector into compact and portable BLOB.
Bitvector
Bitvector container its iterators, serialization and algorithms.
bm::bvector<>
Name  Description  Links  Examples 

bm::bvector<> container  Main container for inverted lists representation. Depending on settings it can store lists of integers or bitvectors.  More  sample1.cpp sample2.cpp sample3.cpp 
bm::bvector<>::reference  Accessor to use regular C++/STL operator conventions to assign container content  More  sample1.cpp sample9.cpp 
bm::combine_*() operations  Set Alebra algorithms for interoprability between arrays and bit vectors  More  sample7.cpp 
bm::bvector<>::enumerator  Constant iterator to traverse inverted list without explicit conversion into unpacked list of integers  More  sample5.cpp sample8.cpp 
bm::bvector<>::counted_enumerator  Constant iterator to traverse inverted list without explicit conversion into unpacked list of integers. It offers extra functinality of keeping a running sum of all ON bits it traversed from position 0 to current.  More  sample11.cpp 
bm::bvector<>::insert_iterator  insert iterator to feed inverted list into bitvector  More  sample8.cpp 
Serialization  Utilities and algorithms to compress and serialize bitvector for database storage or network transfer  More  sample4.cpp 
Allocator  API to redefine standard bvector<> alocator type to create special pool allocation strategy, thread local mamory pools, collect bitvector related memory activity statistics, etc.  More  sample6.cpp 
Bit counting  Various methods and techniques to do bit counting for the whole bitvector, ranges, via accelerated structures or iterations. Performance benchmarking for different methods.  Details  sample11.cpp 
Setting bits  Various methods and techniques to set bits in bitvectors, ranges of bits, bits flipping/swapping, load bits from a set of ints, extraction of bits. Performance benchmarking for different methods.  sample12.cpp  
Logical operations on serialized bitvectors  Example on how to perform logical operations on bitvecor BLOBs without necessarily materializing them into a randomaccess bitvector.  sample14.cpp 
Algorithms for bm::bvector<>
Name  Description  Links  Examples 

Distances  Algorithms optimized for computing binary distances for clusterization of multidimentional binary spaces.  More  sample9.cpp 
Random subset  Algorithm binary subset randomization.  More  sample10.cpp 
Miscelleneous  Algorithms for combining(OR, XOR, SUB, AND) bvector<> with STLcompatible iterators. Count number of intervals in bitvector, etc.  More 
Sparse Vector
Name  Description  Links  Examples 

bm::sparse_vector<> container  Store array of integers using compact bittransposed implementation and the arsenal of compression methods provided by bm::bvector<>  More  svsample01.cpp svsample02.cpp svsample03.cpp 
Serialization  Algorithms to compress and serialize bm::sparse_vector<> for storage or network transfer  More  svsample02.cpp 
Algorithms  Algorithms on bittransposed sparse vectror. Dynamic range clipping.  More 
Advanced techniques
Name  Description  Links  Examples 

Memory consumption / sparse sets  Comparison of different methods of handling of sparse sets. Memory and performance benchmarks. Described techniques can be used for inmemory acceleration of ER JOIN operations.  More  xsample01.cpp 