BitMagic-C++
Data Structures | Namespaces | Macros | Functions
bmalgo.h File Reference

Algorithms for bvector<> (main include) More...

#include "bmfunc.h"
#include "bmdef.h"
#include "bmalgo_impl.h"
Include dependency graph for bmalgo.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  bm::bit_vistor_copy_functor< BV >
 Functor for bit-copy (for testing) More...
 
class  bm::rank_compressor< BV >
 Algorithms for rank compression of bit-vector. More...
 

Namespaces

namespace  bm
 

Macros

#define BM_SCANNER_OP(x)
  More...
 

Functions

template<class BV >
BV::size_type bm::count_and (const BV &bv1, const BV &bv2) BMNOEXCEPT
 Computes bitcount of AND operation of two bitsets. More...
 
template<class BV >
BV::size_type bm::any_and (const BV &bv1, const BV &bv2) BMNOEXCEPT
 Computes if there is any bit in AND operation of two bitsets. More...
 
template<class BV >
bm::distance_metric_descriptor::size_type bm::count_xor (const BV &bv1, const BV &bv2) BMNOEXCEPT
 Computes bitcount of XOR operation of two bitsets. More...
 
template<class BV >
BV::size_type bm::any_xor (const BV &bv1, const BV &bv2) BMNOEXCEPT
 Computes if there is any bit in XOR operation of two bitsets. More...
 
template<class BV >
BV::size_type bm::count_sub (const BV &bv1, const BV &bv2) BMNOEXCEPT
 Computes bitcount of SUB operation of two bitsets. More...
 
template<class BV >
BV::size_type bm::any_sub (const BV &bv1, const BV &bv2) BMNOEXCEPT
 Computes if there is any bit in SUB operation of two bitsets. More...
 
template<class BV >
BV::size_type bm::count_or (const BV &bv1, const BV &bv2) BMNOEXCEPT
 Computes bitcount of OR operation of two bitsets. More...
 
template<class BV >
BV::size_type bm::any_or (const BV &bv1, const BV &bv2) BMNOEXCEPT
 Computes if there is any bit in OR operation of two bitsets. More...
 
template<class BV , class Func >
int bm::for_each_bit (const BV &bv, Func &bit_functor)
 bit-vector visitor scanner to traverse each 1 bit using C++ visitor More...
 
template<class BV , class Func >
int bm::for_each_bit_range (const BV &bv, typename BV::size_type left, typename BV::size_type right, Func &bit_functor)
 bit-vector range visitor to traverse each 1 bit More...
 
template<class BV >
int bm::visit_each_bit (const BV &bv, void *handle_ptr, bit_visitor_callback_type callback_ptr)
 bvector visitor scanner to traverse each 1 bit using C callback More...
 
template<class BV >
int bm::visit_each_bit_range (const BV &bv, typename BV::size_type left, typename BV::size_type right, void *handle_ptr, bit_visitor_callback_type callback_ptr)
 bvector visitor scanner to traverse each bits in range (C callback) More...
 
template<typename BV , typename PairVect >
void bm::rank_range_split (const BV &bv, typename BV::size_type rank, PairVect &target_v)
 Algorithm to identify bit-vector ranges (splits) for the rank. More...
 

Detailed Description

Algorithms for bvector<> (main include)

Definition in file bmalgo.h.

Macro Definition Documentation

◆ BM_SCANNER_OP

#define BM_SCANNER_OP (   x)
Value:
if (0 != (block = blk_blk[j+x])) \
{ int ret;\
if (BM_IS_GAP(block)) \
{ \
bit_functor); \
} \
else \
{ \
ret = bm::for_each_bit_blk(block, (r+j+x)*bm::bits_in_block,bit_functor); \
} \
if (ret < 0) return ret; \
}
#define BMGAP_PTR(ptr)
Definition: bmdef.h:189
#define BM_IS_GAP(ptr)
Definition: bmdef.h:191
int for_each_bit_blk(const bm::word_t *block, SIZE_TYPE offset, Func &bit_functor)
for-each visitor, calls a visitor functor for each 1 bit group
Definition: bmalgo_impl.h:1597
int for_each_gap_blk(const T *buf, SIZE_TYPE offset, Func &bit_functor)
for-each visitor, calls a special visitor functor for each 1 bit range
Definition: bmalgo_impl.h:1760
const unsigned bits_in_block
Definition: bmconst.h:114

Definition at line 175 of file bmalgo.h.