<
classA,
size_tN>
class miniset 124 unsignednew_block_len =
136 return sizeof(*this) +
147mset.
m_buf= buftmp;
148 unsignedtypetmp =
m_type;
159 m_buf= A::allocate(arr_size, 0);
175 m_buf= A::allocate(arr_size, 0);
196A::deallocate(
m_buf, arr_size);
244 return sizeof(*this);
286 m_buf= A::allocate(arr_size, 0);
287::memset(
m_buf, 0, arr_size *
sizeof(
unsigned));
293 m_buf= A::allocate(arr_size, 0);
294::memcpy(
m_buf,
bvect.m_buf, arr_size *
sizeof(
unsigned));
305 unsigned char mask= (
unsignedchar)((
char)0x1 << (pos & 7));
306 unsigned char* offs = (
unsigned char*)
m_buf+ (pos >> 3);
307 return(*offs) &
mask;
313 unsigned char mask= (
unsignedchar)(0x1 << (pos & 7));
314 unsigned char* offs = (
unsigned char*)
m_buf+ (pos >> 3);
321 unsigned char mask= (
unsignedchar)(0x1 << (pos & 7));
322 unsigned char* offs = (
unsigned char*)
m_buf+ (pos >> 3);
323*offs &= (
unsignedchar)~
mask;
331 for(
unsigned* start =
m_buf; start < end; ++start)
333 unsigned value= *start;
344 if(!cnt1 && !cnt2)
return0;
345 size_typecnt_min = cnt1 < cnt2 ? cnt1 : cnt2;
346 if(!cnt_min)
returncnt1 ? 1 : -1;
355 returnidx1 < idx2 ? 1 : -1;
362 if(!idx1)
return-1;
364 returnidx1 < idx2 ? 1 : -1;
374 const unsigned char* ptr = (
unsigned char*)
m_buf;
375 for(
unsigned i= 0;
i< ((
m_size/8)+1); ++
i)
377 unsigned charw = ptr[
i];
380 while((w & 1u) == 0)
382w = (
unsignedchar)(w >> 1u);
387pos =
size_type(pos +
sizeof(
unsigned char) * 8u);
399 unsigned char* offs = (
unsigned char*)
m_buf+ (
i>> 3);
402 unsigned char mask= (
unsignedchar)((
char)0x1 << (
i& 7));
419 const unsigned* src =
bvect.get_buf();
420 for(
unsigned* start =
m_buf; start < end; ++start)
429 const unsigned* src =
bvect.get_buf();
430 for(
unsigned* start =
m_buf; start < end; ++start)
439 const unsigned* src =
bvect.get_buf();
440 for(
unsigned* start =
m_buf; start < end; ++start)
449 const unsigned* src =
bvect.get_buf();
450 for(
unsigned* start =
m_buf; start < end; ++start)
479 #pragma warning( pop )ncbi::TMaskedQueryRegions mask
#define BM_MINISET_ARRSIZE(x)
#define BM_MINISET_GAPLEN
Bitvector class with very limited functionality.
const unsigned * get_buf() const
int is_bit_true(size_type pos) const
Checks if bit pos 1 or 0. Returns 0 if 0 and non zero otherwise.
unsigned mem_used() const
size_type get_first() const
Returns index of the first ON bit.
size_type get_next(size_type idx) const
Returns index of next bit, which is ON.
void combine_sub(const bvector_mini &bvect)
void swap(bvector_mini &bvm)
size_type bit_count() const
Counts number of bits ON.
bvector_mini(size_type size)
void combine_and(const bvector_mini &bvect)
void combine_or(const bvector_mini &bvect)
void combine_xor(const bvector_mini &bvect)
int compare(const bvector_mini &bvect)
Comparison.
bvector_mini(const bvector_mini &bvect)
void clear_bit(size_type pos)
Sets bit number pos to 0.
void set_bit(size_type pos)
Sets bit number pos to 1.
Bitvector Bit-vector container with runtime compression of bits.
size_type get_next(size_type prev) const noexcept
Finds the number of the next bit ON.
size_type get_first() const noexcept
find first 1 bit in vector. Function may return 0 and this requires an extra check if bit 0 is actual...
Mini bit-vector for auxiliary purposes.
unsigned mem_used() const
void set(bm::id_t n, bool val=true)
unsigned test(bm::id_t n) const
Checks if bit pos 1 or 0. Returns 0 if 0 and non zero otherwise.
bvmini(const bvmini &mset)
bm::word_t m_buf[((N/32)+((N % 32) &&1))]
Template class implements memory saving set functionality.
void init_bitbuf(bm::word_t *buf)
void set(bm::id_t n, bool val=true)
unsigned mem_used() const
void init_gapbuf(bm::word_t *buf)
bm::word_t * m_buf
Buffer pointer.
miniset(const miniset &mset)
unsigned m_type
buffer type (0-bit, 1-gap)
unsigned test(bm::id_t n) const
Checks if bit pos 1 or 0. Returns 0 if 0 and non zero otherwise.
unsigned gap_test(const T *buf, unsigned pos) noexcept
Tests if bit = pos is true.
void gap_convert_to_bitset(unsigned *dest, const T *buf, unsigned len=0) noexcept
GAP block to bitblock conversion.
unsigned gap_set_value(unsigned val, T *buf, unsigned pos) noexcept
Sets or clears bit in the GAP buffer.
void gap_set_all(T *buf, unsigned set_max, unsigned value) noexcept
Sets all bits to 0 or 1 (GAP)
const unsigned set_word_shift
unsigned long long int id64_t
unsigned short gap_word_t
const unsigned gap_max_bits
const unsigned set_word_mask
const struct ncbi::grid::netcache::search::fields::SIZE size
const GenericPointer< typename T::ValueType > T2 value
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4