GAP functions
[BitMagic C++ Library]

Collaboration diagram for GAP functions:

Data Structures

struct  bm::gap_len_table< T >
 Default GAP lengths table. More...
struct  bm::gap_len_table_min< T >
 Alternative GAP lengths table. Good for for memory saver mode and very sparse bitsets. More...

Functions

template<typename T >
unsigned bm::gap_test (const T *buf, unsigned pos)
 Tests if bit = pos is true.
template<typename T >
unsigned bm::gap_bit_count (const T *buf, unsigned dsize=0)
 Calculates number of bits ON in GAP buffer.
template<typename T >
int bm::gapcmp (const T *buf1, const T *buf2)
 Lexicographical comparison of GAP buffers.
template<typename T , class F >
unsigned bm::gap_buff_any_op (const T *BMRESTRICT vect1, unsigned vect1_mask, const T *BMRESTRICT vect2, unsigned vect2_mask, F f)
 Abstract distance test operation for GAP buffers. Receives functor F as a template argument.
template<typename T >
unsigned bm::gap_set_value (unsigned val, T *BMRESTRICT buf, unsigned pos, unsigned *BMRESTRICT is_set)
 Abstract distance(similarity) operation for GAP buffers. Receives functor F as a template argument.
template<typename T >
unsigned bm::gap_add_value (T *buf, unsigned pos)
 Add new value to the end of GAP buffer.
template<typename T >
unsigned bm::gap_set_array (T *buf, const T *arr, unsigned len)
 Convert array to GAP buffer.
template<typename T >
unsigned bm::bit_array_compute_gaps (const T *arr, unsigned len)
 Compute number of GAPs in bit-array.
template<typename T >
int bm::gap_find_in_block (const T *buf, unsigned nbit, bm::id_t *prev)
 Searches for the next 1 bit in the GAP block.
template<typename T >
void bm::gap_sub_to_bitset (unsigned *dest, const T *buf)
 SUB (AND NOT) GAP block to bitblock.
template<typename T >
void bm::gap_xor_to_bitset (unsigned *dest, const T *buf)
 XOR GAP block to bitblock.
template<typename T >
void bm::gap_add_to_bitset (unsigned *dest, const T *buf)
 Adds(OR) GAP block to bitblock.
template<typename T >
void bm::gap_and_to_bitset (unsigned *dest, const T *buf)
 ANDs GAP block to bitblock.
template<typename T >
void bm::gap_convert_to_bitset (unsigned *dest, const T *buf)
 GAP block to bitblock conversion.
template<typename T >
void bm::gap_convert_to_bitset (unsigned *dest, const T *buf, unsigned dest_len)
 GAP block to bitblock conversion.
template<typename T >
unsigned * bm::gap_convert_to_bitset_smart (unsigned *dest, const T *buf, id_t set_max)
 Smart GAP block to bitblock conversion.
template<typename T >
unsigned bm::gap_control_sum (const T *buf)
 Calculates sum of all words in GAP block. (For debugging purposes).
template<class T >
void bm::gap_set_all (T *buf, unsigned set_max, unsigned value)
 Sets all bits to 0 or 1 (GAP).
template<class T >
void bm::gap_init_range_block (T *buf, unsigned from, unsigned to, unsigned value, unsigned set_max)
 Init gap block so it has block in it (can be whole block).
template<typename T >
void bm::gap_invert (T *buf)
 Inverts all bits in the GAP buffer.
template<typename T >
bool bm::gap_is_all_zero (const T *buf, unsigned set_max)
 Temporary inverts all bits in the GAP buffer.
template<typename T >
bool bm::gap_is_all_one (const T *buf, unsigned set_max)
 Checks if GAP block is all-one.
template<typename T >
unsigned bm::gap_length (const T *buf)
 Returs GAP block length.
template<typename T >
unsigned bm::gap_capacity (const T *buf, const T *glevel_len)
 Returs GAP block capacity.
template<typename T >
unsigned bm::gap_limit (const T *buf, const T *glevel_len)
 Returs GAP block capacity limit.
template<typename T >
unsigned bm::gap_level (const T *buf)
 Returs GAP blocks capacity level.
template<typename T >
void bm::set_gap_level (T *buf, unsigned level)
 Sets GAP block capacity level.
template<typename T >
int bm::gap_calc_level (int len, const T *glevel_len)
 Calculates GAP block capacity level.
template<typename T >
unsigned bm::gap_free_elements (const T *buf, const T *glevel_len)
 Returns number of free elements in GAP block array. Difference between GAP block capacity on this level and actual GAP length.
template<typename T >
unsigned bm::bit_convert_to_gap (T *BMRESTRICT dest, const unsigned *BMRESTRICT src, bm::id_t bits, unsigned dest_len)
 Converts bit block to GAP.
template<class T , class F >
void bm::for_each_gap_dbit (const T *buf, F &func)
 Iterate gap block as delta-bits with a functor.
template<typename D , typename T >
bm::gap_convert_to_arr (D *BMRESTRICT dest, const T *BMRESTRICT buf, unsigned dest_len, bool invert=false)
 Convert gap block into array of ints corresponding to 1 bits.
gap_word_t * bm::gap_operation_and (const gap_word_t *BMRESTRICT vect1, const gap_word_t *BMRESTRICT vect2, gap_word_t *BMRESTRICT tmp_buf, unsigned &dsize)
 GAP AND operation.
unsigned bm::gap_operation_any_and (const gap_word_t *BMRESTRICT vect1, const gap_word_t *BMRESTRICT vect2)
 GAP AND operation test.
gap_word_t * bm::gap_operation_xor (const gap_word_t *BMRESTRICT vect1, const gap_word_t *BMRESTRICT vect2, gap_word_t *BMRESTRICT tmp_buf, unsigned &dsize)
 GAP XOR operation.
unsigned bm::gap_operation_any_xor (const gap_word_t *BMRESTRICT vect1, const gap_word_t *BMRESTRICT vect2)
 GAP XOR operation test.
gap_word_t * bm::gap_operation_or (const gap_word_t *BMRESTRICT vect1, const gap_word_t *BMRESTRICT vect2, gap_word_t *BMRESTRICT tmp_buf, unsigned &dsize)
 GAP OR operation.
gap_word_t * bm::gap_operation_sub (const gap_word_t *BMRESTRICT vect1, const gap_word_t *BMRESTRICT vect2, gap_word_t *BMRESTRICT tmp_buf, unsigned &dsize)
 GAP SUB (AND NOT) operation.
unsigned bm::gap_operation_any_sub (const gap_word_t *BMRESTRICT vect1, const gap_word_t *BMRESTRICT vect2)
 GAP SUB operation test.
template<typename T >
unsigned bm::gap_overhead (const T *length, const T *length_end, const T *glevel_len)
 Convert bit block into an array of ints corresponding to 1 bits.
template<typename T >
bool bm::improve_gap_levels (const T *length, const T *length_end, T *glevel_len)
 Finds optimal gap blocks lengths.

Detailed Description

GAP functions implement different opereations on GAP compressed blocks and serve as a minimal building blocks.


Function Documentation

template<typename T >
unsigned bm::bit_array_compute_gaps ( const T *  arr,
unsigned  len 
) [inline]

Compute number of GAPs in bit-array.

Parameters:
arr - array of BITs
len - array length

Definition at line 1371 of file bmfunc.h.

template<typename T >
unsigned bm::bit_convert_to_gap ( T *BMRESTRICT  dest,
const unsigned *BMRESTRICT  src,
bm::id_t  bits,
unsigned  dest_len 
) [inline]

Converts bit block to GAP.

Parameters:
dest - Destinatio GAP buffer.
src - Source bitblock buffer.
bits - Number of bits to convert.
dest_len - length of the dest. buffer.
Returns:
New length of GAP block or 0 if conversion failed (insufficicent space).

Definition at line 2477 of file bmfunc.h.

References BM_ASSERT.

Referenced by bm::serializer< BV >::serialize().

template<class T , class F >
void bm::for_each_gap_dbit ( const T *  buf,
F &  func 
) [inline]

Iterate gap block as delta-bits with a functor.

Definition at line 2567 of file bmfunc.h.

template<typename T >
void bm::gap_add_to_bitset ( unsigned *  dest,
const T *  buf 
) [inline]

Adds(OR) GAP block to bitblock.

Parameters:
dest - bitblock buffer pointer.
buf - GAP buffer pointer.

Definition at line 1706 of file bmfunc.h.

References BM_ASSERT, and bm::or_bit_block().

Referenced by bm::gap_convert_to_bitset().

template<typename T >
unsigned bm::gap_add_value ( T *  buf,
unsigned  pos 
) [inline]

Add new value to the end of GAP buffer.

Parameters:
buf - GAP buffer.
pos - Index of bit to set.
Returns:
New GAP buffer length.

Definition at line 1226 of file bmfunc.h.

References BM_ASSERT, and bm::gap_max_bits.

Referenced by bm::deseriaizer_base< DEC >::read_gap_block().

template<typename T >
void bm::gap_and_to_bitset ( unsigned *  dest,
const T *  buf 
) [inline]

ANDs GAP block to bitblock.

Parameters:
dest - bitblock buffer pointer.
buf - GAP buffer pointer.

Definition at line 1738 of file bmfunc.h.

References BM_ASSERT, and bm::sub_bit_block().

template<typename T >
unsigned bm::gap_bit_count ( const T *  buf,
unsigned  dsize = 0 
) [inline]

Calculates number of bits ON in GAP buffer.

Parameters:
buf - GAP buffer pointer.
dsize - buffer size
Returns:
Number of non-zero bits.

Definition at line 653 of file bmfunc.h.

Referenced by bm::combine_count_operation_with_block(), and bm::serializer< BV >::encode_gap_block().

template<typename T , class F >
unsigned bm::gap_buff_any_op ( const T *BMRESTRICT  vect1,
unsigned  vect1_mask,
const T *BMRESTRICT  vect2,
unsigned  vect2_mask,
f 
) [inline]

Abstract distance test operation for GAP buffers. Receives functor F as a template argument.

Parameters:
vect1 - operand 1 GAP encoded buffer.
vect1_mask - XOR mask for starting bitflag for vector1 can be 0 or 1 (1 inverts the vector)
vect2 - operand 2 GAP encoded buffer.
vect2_mask - same as vect1_mask
f - operation functor.
Note:
Internal function.
Returns:
non zero value if operation result returns any 1 bit

Definition at line 990 of file bmfunc.h.

References bm::gap_max_bits.

Referenced by bm::gap_operation_any_and(), bm::gap_operation_any_sub(), and bm::gap_operation_any_xor().

template<typename T >
int bm::gap_calc_level ( int  len,
const T *  glevel_len 
) [inline]

Calculates GAP block capacity level.

Parameters:
len - GAP buffer length.
glevel_len - GAP lengths table
Returns:
GAP block capacity level. -1 if block does not fit any level.

Definition at line 2405 of file bmfunc.h.

References BM_ASSERT, and bm::gap_levels.

Referenced by bm::iterator_deserializer< BV, SerialIterator >::deserialize(), bm::deserializer< BV, DEC >::deserialize_gap(), and bm::gap_overhead().

template<typename T >
unsigned bm::gap_capacity ( const T *  buf,
const T *  glevel_len 
) [inline]

Returs GAP block capacity.

Parameters:
buf - GAP buffer pointer.
Returns:
GAP block capacity.

Definition at line 2347 of file bmfunc.h.

Referenced by bm::bvector< Alloc, MS >::calc_stat(), bm::mem_alloc< BA, PA >::free_gap_block(), and bm::gap_free_elements().

template<typename T >
unsigned bm::gap_control_sum ( const T *  buf  )  [inline]

Calculates sum of all words in GAP block. (For debugging purposes).

Note:
For debugging and testing ONLY.
Parameters:
buf - GAP buffer pointer.
Returns:
Sum of all words.

Definition at line 2173 of file bmfunc.h.

References BM_ASSERT.

template<typename D , typename T >
D bm::gap_convert_to_arr ( D *BMRESTRICT  dest,
const T *BMRESTRICT  buf,
unsigned  dest_len,
bool  invert = false 
) [inline]

Convert gap block into array of ints corresponding to 1 bits.

Definition at line 2622 of file bmfunc.h.

Referenced by bm::serializer< BV >::encode_gap_block().

template<typename T >
void bm::gap_convert_to_bitset ( unsigned *  dest,
const T *  buf,
unsigned  dest_len 
) [inline]

GAP block to bitblock conversion.

Parameters:
dest - bitblock buffer pointer.
buf - GAP buffer pointer.
dest_size - length of the destination buffer.

Definition at line 2130 of file bmfunc.h.

References bm::gap_add_to_bitset().

template<typename T >
void bm::gap_convert_to_bitset ( unsigned *  dest,
const T *  buf 
) [inline]
template<typename T >
unsigned* bm::gap_convert_to_bitset_smart ( unsigned *  dest,
const T *  buf,
id_t  set_max 
) [inline]

Smart GAP block to bitblock conversion.

Checks if GAP block is ALL-ZERO or ALL-ON. In those cases returns pointer on special static bitblocks.

Parameters:
dest - bitblock buffer pointer.
buf - GAP buffer pointer.
set_max - max possible bitset length

Definition at line 2151 of file bmfunc.h.

References FULL_BLOCK_ADDR, and bm::gap_convert_to_bitset().

template<typename T >
int bm::gap_find_in_block ( const T *  buf,
unsigned  nbit,
bm::id_t prev 
) [inline]

Searches for the next 1 bit in the GAP block.

Parameters:
buf - GAP buffer
nbit - bit index to start checking from.
prev - returns previously checked value

Definition at line 1401 of file bmfunc.h.

References BM_ASSERT, bm::gap_bfind(), and bm::gap_max_bits.

template<typename T >
unsigned bm::gap_free_elements ( const T *  buf,
const T *  glevel_len 
) [inline]

Returns number of free elements in GAP block array. Difference between GAP block capacity on this level and actual GAP length.

Parameters:
buf - GAP buffer pointer glevel_len - GAP lengths table
Returns:
Number of free GAP elements

Definition at line 2426 of file bmfunc.h.

References bm::gap_capacity(), and bm::gap_length().

template<class T >
void bm::gap_init_range_block ( T *  buf,
unsigned  from,
unsigned  to,
unsigned  value,
unsigned  set_max 
) [inline]

Init gap block so it has block in it (can be whole block).

Parameters:
buf - GAP buffer pointer.
from - one block start
to - one block end
value - (block value)1 or 0
set_max - max possible bitset length

Definition at line 2225 of file bmfunc.h.

References BM_ASSERT, and bm::gap_set_all().

template<typename T >
void bm::gap_invert ( T *  buf  )  [inline]

Inverts all bits in the GAP buffer.

Parameters:
buf - GAP buffer pointer.

Definition at line 2275 of file bmfunc.h.

Referenced by bm::gap_operation_or(), and bm::deseriaizer_base< DEC >::read_gap_block().

template<typename T >
bool bm::gap_is_all_one ( const T *  buf,
unsigned  set_max 
) [inline]

Checks if GAP block is all-one.

Parameters:
buf - GAP buffer pointer.
set_max - max possible bitset length
Returns:
true if all-one.

Definition at line 2321 of file bmfunc.h.

template<typename T >
bool bm::gap_is_all_zero ( const T *  buf,
unsigned  set_max 
) [inline]

Temporary inverts all bits in the GAP buffer.

In this function const-ness of the buffer means nothing. Calling this function again restores the status of the buffer.

Parameters:
buf - GAP buffer pointer. (Buffer IS changed)

Checks if GAP block is all-zero.

Parameters:
buf - GAP buffer pointer.
set_max - max possible bitset length
Returns:
true if all-zero.

Definition at line 2307 of file bmfunc.h.

Referenced by bm::combine_any_operation_with_block(), and bm::bvector< Alloc, MS >::compare().

template<typename T >
unsigned bm::gap_length ( const T *  buf  )  [inline]
template<typename T >
unsigned bm::gap_level ( const T *  buf  )  [inline]

Returs GAP blocks capacity level.

Parameters:
buf - GAP buffer pointer.
Returns:
GAP block capacity level.

Definition at line 2375 of file bmfunc.h.

template<typename T >
unsigned bm::gap_limit ( const T *  buf,
const T *  glevel_len 
) [inline]

Returs GAP block capacity limit.

Parameters:
buf - GAP buffer pointer.
glevel_len - GAP lengths table (gap_len_table)
Returns:
GAP block limit.

Definition at line 2362 of file bmfunc.h.

Referenced by bm::combine_or(), bm::combine_sub(), and bm::combine_xor().

gap_word_t* bm::gap_operation_and ( const gap_word_t *BMRESTRICT  vect1,
const gap_word_t *BMRESTRICT  vect2,
gap_word_t *BMRESTRICT  tmp_buf,
unsigned &  dsize 
) [inline]

GAP AND operation.

Function performs AND logical oparation on gap vectors. If possible function put the result into vect1 and returns this pointer. Otherwise result is put into tmp_buf, which should be twice of the vector size.

Parameters:
vect1 - operand 1
vect2 - operand 2
tmp_buf - pointer on temporary buffer
dsize - out size of the destination
Returns:
Result pointer (tmp_buf OR vect1)

Definition at line 3130 of file bmfunc.h.

References bm::and_op(), and bm::gap_buff_op().

Referenced by bm::combine_count_operation_with_block().

unsigned bm::gap_operation_any_and ( const gap_word_t *BMRESTRICT  vect1,
const gap_word_t *BMRESTRICT  vect2 
) [inline]

GAP AND operation test.

Function performs AND logical oparation on gap vectors. If possible function put the result into vect1 and returns this pointer. Otherwise result is put into tmp_buf, which should be twice of the vector size.

Parameters:
vect1 - operand 1
vect2 - operand 2
Returns:
non zero value if operation returns any 1 bit

Definition at line 3153 of file bmfunc.h.

References bm::and_op(), and bm::gap_buff_any_op().

Referenced by bm::combine_any_operation_with_block().

unsigned bm::gap_operation_any_sub ( const gap_word_t *BMRESTRICT  vect1,
const gap_word_t *BMRESTRICT  vect2 
) [inline]

GAP SUB operation test.

Function performs AND logical oparation on gap vectors. If possible function put the result into vect1 and returns this pointer. Otherwise result is put into tmp_buf, which should be twice of the vector size.

Parameters:
vect1 - operand 1
vect2 - operand 2
Returns:
non zero value if operation returns any 1 bit

Definition at line 3280 of file bmfunc.h.

References bm::and_op(), and bm::gap_buff_any_op().

Referenced by bm::combine_any_operation_with_block().

unsigned bm::gap_operation_any_xor ( const gap_word_t *BMRESTRICT  vect1,
const gap_word_t *BMRESTRICT  vect2 
) [inline]

GAP XOR operation test.

Function performs AND logical oparation on gap vectors. If possible function put the result into vect1 and returns this pointer. Otherwise result is put into tmp_buf, which should be twice of the vector size.

Parameters:
vect1 - operand 1
vect2 - operand 2
Returns:
non zero value if operation returns any 1 bit

Definition at line 3201 of file bmfunc.h.

References bm::gap_buff_any_op(), and bm::xor_op().

Referenced by bm::combine_any_operation_with_block().

gap_word_t* bm::gap_operation_or ( const gap_word_t *BMRESTRICT  vect1,
const gap_word_t *BMRESTRICT  vect2,
gap_word_t *BMRESTRICT  tmp_buf,
unsigned &  dsize 
) [inline]

GAP OR operation.

Function performs OR logical oparation on gap vectors. If possible function put the result into vect1 and returns this pointer. Otherwise result is put into tmp_buf, which should be twice of the vector size.

Parameters:
vect1 - operand 1
vect2 - operand 2
tmp_buf - pointer on temporary buffer
dsize - out destination size
Returns:
Result pointer (tmp_buf)

Definition at line 3226 of file bmfunc.h.

References bm::and_op(), bm::gap_buff_op(), and bm::gap_invert().

Referenced by bm::combine_any_operation_with_block(), and bm::combine_count_operation_with_block().

gap_word_t* bm::gap_operation_sub ( const gap_word_t *BMRESTRICT  vect1,
const gap_word_t *BMRESTRICT  vect2,
gap_word_t *BMRESTRICT  tmp_buf,
unsigned &  dsize 
) [inline]

GAP SUB (AND NOT) operation.

Function performs SUB logical oparation on gap vectors. If possible function put the result into vect1 and returns this pointer. Otherwise result is put into tmp_buf, which should be twice of the vector size.

Parameters:
vect1 - operand 1
vect2 - operand 2
tmp_buf - pointer on temporary buffer
dsize - out destination size
Returns:
Result pointer (tmp_buf)

Definition at line 3256 of file bmfunc.h.

References bm::and_op(), and bm::gap_buff_op().

Referenced by bm::combine_count_operation_with_block().

gap_word_t* bm::gap_operation_xor ( const gap_word_t *BMRESTRICT  vect1,
const gap_word_t *BMRESTRICT  vect2,
gap_word_t *BMRESTRICT  tmp_buf,
unsigned &  dsize 
) [inline]

GAP XOR operation.

Function performs XOR logical oparation on gap vectors. If possible function put the result into vect1 and returns this pointer. Otherwise result is put into tmp_buf, which should be twice of the vector size.

Parameters:
vect1 - operand 1
vect2 - operand 2
tmp_buf - pointer on temporary buffer
dsize - out destination size
Returns:
Result pointer (tmp_buf)

Definition at line 3177 of file bmfunc.h.

References bm::gap_buff_op(), and bm::xor_op().

Referenced by bm::combine_count_operation_with_block().

template<typename T >
unsigned bm::gap_overhead ( const T *  length,
const T *  length_end,
const T *  glevel_len 
) [inline]

Convert bit block into an array of ints corresponding to 1 bits.

OBSOLETE function

Calculates memory overhead for number of gap blocks sharing the same memory allocation table (level lengths table).

Definition at line 4722 of file bmfunc.h.

References BM_ASSERT, bm::gap_calc_level(), and bm::gap_levels.

Referenced by bm::improve_gap_levels().

template<class T >
void bm::gap_set_all ( T *  buf,
unsigned  set_max,
unsigned  value 
) [inline]

Sets all bits to 0 or 1 (GAP).

Parameters:
buf - GAP buffer pointer.
set_max - max possible bitset length

Definition at line 2204 of file bmfunc.h.

References BM_ASSERT.

Referenced by bm::gap_init_range_block(), and bm::deseriaizer_base< DEC >::read_gap_block().

template<typename T >
unsigned bm::gap_set_array ( T *  buf,
const T *  arr,
unsigned  len 
) [inline]

Convert array to GAP buffer.

Parameters:
buf - GAP buffer.
arr - array of values to set
len - length of the array
Returns:
New GAP buffer length.

Definition at line 1311 of file bmfunc.h.

References bm::gap_max_bits.

Referenced by bm::deserializer< BV, DEC >::deserialize_gap(), and bm::deseriaizer_base< DEC >::read_gap_block().

template<typename T >
unsigned bm::gap_set_value ( unsigned  val,
T *BMRESTRICT  buf,
unsigned  pos,
unsigned *BMRESTRICT  is_set 
) [inline]

Abstract distance(similarity) operation for GAP buffers. Receives functor F as a template argument.

Parameters:
vect1 - operand 1 GAP encoded buffer.
vect2 - operand 2 GAP encoded buffer.
f - operation functor.
Note:
Internal function.

Sets or clears bit in the GAP buffer.

Parameters:
val - new bit value
buf - GAP buffer.
pos - Index of bit to set.
is_set - (OUT) flag if bit was actually set.
Returns:
New GAP buffer length.

Definition at line 1133 of file bmfunc.h.

References BM_ASSERT, bm::gap_bfind(), and bm::gap_max_bits.

Referenced by bm::combine_or(), bm::combine_sub(), bm::combine_xor(), and bm::miniset< A, N >::set().

template<typename T >
void bm::gap_sub_to_bitset ( unsigned *  dest,
const T *  buf 
) [inline]

SUB (AND NOT) GAP block to bitblock.

Parameters:
dest - bitblock buffer pointer.
buf - GAP buffer pointer.

Definition at line 1642 of file bmfunc.h.

References BM_ASSERT, and bm::sub_bit_block().

template<typename T >
unsigned bm::gap_test ( const T *  buf,
unsigned  pos 
) [inline]

Tests if bit = pos is true.

Parameters:
buf - GAP buffer pointer.
pos - index of the element.
Returns:
true if position is in "1" gap

Definition at line 489 of file bmfunc.h.

References BM_ASSERT, and bm::gap_max_bits.

Referenced by bm::combine_sub(), bm::combine_xor(), bm::bvector< Alloc, MS >::get_bit(), and bm::miniset< A, N >::test().

template<typename T >
void bm::gap_xor_to_bitset ( unsigned *  dest,
const T *  buf 
) [inline]

XOR GAP block to bitblock.

Parameters:
dest - bitblock buffer pointer.
buf - GAP buffer pointer.

Definition at line 1674 of file bmfunc.h.

References BM_ASSERT, and bm::xor_bit_block().

template<typename T >
int bm::gapcmp ( const T *  buf1,
const T *  buf2 
) [inline]

Lexicographical comparison of GAP buffers.

Parameters:
buf1 - First GAP buffer pointer.
buf2 - Second GAP buffer pointer.
Returns:
<0 - less, =0 - equal, >0 - greater.

Definition at line 841 of file bmfunc.h.

Referenced by bm::bvector< Alloc, MS >::compare().

template<typename T >
bool bm::improve_gap_levels ( const T *  length,
const T *  length_end,
T *  glevel_len 
) [inline]

Finds optimal gap blocks lengths.

Parameters:
length - first element of GAP lengths array
length_end - end of the GAP lengths array
glevel_len - destination GAP lengths array

Definition at line 4749 of file bmfunc.h.

References BM_ASSERT, bm::gap_levels, bm::gap_max_buff_len, and bm::gap_overhead().

Referenced by bm::bvector< Alloc, MS >::optimize_gap_size().

template<typename T >
void bm::set_gap_level ( T *  buf,
unsigned  level 
) [inline]

Sets GAP block capacity level.

Parameters:
buf - GAP buffer pointer.
level new GAP block capacity level.

Definition at line 2389 of file bmfunc.h.

References BM_ASSERT, and bm::gap_levels.

Referenced by bm::iterator_deserializer< BV, SerialIterator >::deserialize(), and bm::deserializer< BV, DEC >::deserialize_gap().


Generated on Tue Mar 23 20:48:07 2010 for BitMagic by  doxygen 1.6.1