Set algorithms
[BitMagic C++ Library]

Collaboration diagram for Set algorithms:


Detailed Description

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_sorted (BV &bv, It first, It last)
 AND 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.


Function Documentation

template<class BV, class It>
void bm::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
See also:
combine_and_sorted

Definition at line 1382 of file bmalgo_impl.h.

References bm::combine_or().

template<class BV, class It>
void bm::combine_and_sorted BV &  bv,
It  first,
It  last
 

AND Combine bitvector and the iterable sequence.

Algorithm combines bvector with sorted sequence of integers (represents another set).

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

Definition at line 1350 of file bmalgo_impl.h.

References BM_ASSERT, and id.

template<class BV, class It>
void bm::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 1105 of file bmalgo_impl.h.

References bm::block_range_scan(), BM_ASSERT, BMGAP_PTR, bm::gap_limit(), bm::gap_set_value(), bm::id_max, bm::set_block_mask, and bm::set_block_shift.

Referenced by bm::combine_and(), CQueue::FlushTags(), bm::iterator_deserializer< BV, SerialIterator >::load_id_list(), OrOperationsTest(), and ResizeTest().

template<class BV, class It>
void bm::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 1268 of file bmalgo_impl.h.

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

template<class BV, class It>
void bm::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 1184 of file bmalgo_impl.h.

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

template<class BV>
bm::id_t bm::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 1405 of file bmalgo_impl.h.

References bm::for_each_block().

Referenced by CheckIntervals().

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.

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 1431 of file bmalgo_impl.h.

References bm::BM_BIT, BMGAP_PTR, bm::set_block_size, and bm::set_total_blocks.

Referenced by ExportTest().


Generated on Mon Dec 7 16:05:24 2009 for NCBI C++ ToolKit by  doxygen 1.4.6
Modified on Mon Dec 07 16:24:37 2009 by modify_doxy.py rev. 173732