Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | Directories | File List | Namespace Members | Data Fields | Globals | Examples

Set algorithms
[BitMagic C++ Library]

Collaboration diagram for Set algorithms:


Modules

 Distance metrics

Functions

template<class BV, class It>
void bm::combine_or (BV &bv, It first, It last)
 OR Combine bitvector and the iterable sequence.
template<class BV, class It>
void bm::combine_xor (BV &bv, It first, It last)
 XOR Combine bitvector and the iterable sequence.
template<class BV, class It>
void bm::combine_sub (BV &bv, It first, It last)
 SUB Combine bitvector and the iterable sequence.
template<class BV, class It>
void bm::combine_and (BV &bv, It first, It last)
 AND Combine bitvector and the iterable sequence.
template<class BV>
bm::id_t bm::count_intervals (const BV &bv)
 Compute number of bit intervals (GAPs) in the bitvector.
template<class BV, class It>
void bm::export_array (BV &bv, It first, It last)
 Export bitset from an array of binary data representing the bit vector.

Detailed Description

Set algorithms

Function Documentation

template<class BV, class It>
void combine_and BV &  bv,
It  first,
It  last
 

AND Combine bitvector and the iterable sequence.

Algorithm combines bvector with sequence of integers (represents another set). When the agrument set is sorted this method can give serious increase in performance.

Parameters:
bv - destination bitvector
first - first element of the iterated sequence
last - last element of the iterated sequence

Definition at line 787 of file bmalgo.h.

References bm::combine_or().

template<class BV, class It>
void combine_or BV &  bv,
It  first,
It  last
 

OR Combine bitvector and the iterable sequence.

Algorithm combines bvector with sequence of integers (represents another set). When the agrument set is sorted this method can give serious increase in performance.

Parameters:
bv - destination bitvector
first - first element of the iterated sequence
last - last element of the iterated sequence

Definition at line 550 of file bmalgo.h.

References bm::block_range_scan(), BMGAP_PTR, bm::gap_limit(), and bm::gap_set_value().

Referenced by bm::combine_and().

template<class BV, class It>
void combine_sub BV &  bv,
It  first,
It  last
 

SUB Combine bitvector and the iterable sequence.

Algorithm combines bvector with sequence of integers (represents another set). When the agrument set is sorted this method can give serious increase in performance.

Parameters:
bv - destination bitvector
first - first element of the iterated sequence
last - last element of the iterated sequence

Definition at line 707 of file bmalgo.h.

References bm::block_range_scan(), BMGAP_PTR, bm::gap_limit(), bm::gap_set_value(), and bm::gap_test().

template<class BV, class It>
void combine_xor BV &  bv,
It  first,
It  last
 

XOR Combine bitvector and the iterable sequence.

Algorithm combines bvector with sequence of integers (represents another set). When the agrument set is sorted this method can give serious increase in performance.

Parameters:
bv - destination bitvector
first - first element of the iterated sequence
last - last element of the iterated sequence

Definition at line 626 of file bmalgo.h.

References bm::block_range_scan(), BM_ASSERT, BMGAP_PTR, bm::gap_limit(), bm::gap_set_value(), and bm::gap_test().

template<class BV>
bm::id_t count_intervals const BV &  bv  ) 
 

Compute number of bit intervals (GAPs) in the bitvector.

Algorithm traverses bit vector and count number of uninterrupted intervals of 1s and 0s.

    For example: 
      00001111100000 - gives us 3 intervals
      10001111100000 - 4 intervals
      00000000000000 - 1 interval
      11111111111111 - 1 interval
    
Returns:
Number of intervals

Definition at line 810 of file bmalgo.h.

References bm::for_each_block().

template<class BV, class It>
void export_array BV &  bv,
It  first,
It  last
 

Export bitset from an array of binary data representing the bit vector.

Input array can be array of ints, chars or other native C types. Method works with iterators, which makes it compatible with STL containers and C arrays

Parameters:
bv - destination bitvector
first - first element of the iterated sequence
last - last element of the iterated sequence

Definition at line 836 of file bmalgo.h.

References BM_ASSERT, and BMGAP_PTR.


Generated on Thu Apr 20 13:29:10 2006 for BitMagic by  doxygen 1.4.1