<
typenameBV>
73 structis_remap_support {
enum trait{
value=
false}; };
75 structis_dynamic_splices {
enum trait{
value=
true}; };
297 typenamebvector_type::statistics* stat = 0);
421 template<
typenameVal,
typenameBVect,
unsignedMAX_SIZE>
430{ (void)sz,(
void)set_null; }
461*idx_from = from; *idx_to = to;
return true;
484 template<
typenameVal,
typenameBV,
unsignedMAX_SIZE>
727 typenamebvector_type::optmode opt_mode = bvector_type::opt_compress,
728 typenamebvector_type::statistics* stat = 0);
850 #pragma warning( push ) 851 #pragma warning( disable : 4146 ) 854 template<
typenameBV>
860: bv_size_(bv_max_size),
870 template<
typenameBV>
878 template<
typenameBV>
880: bv_size_(bbm.bv_size_),
890 template<
typenameBV>
892: bv_size_(bbm.bv_size_),
897is_dynamic_ = bbm.is_dynamic_;
902 template<
typenameBV>
907 returnbv_rows_[
i];
912 template<
typenameBV>
917 returnbv_rows_[
i];
922 template<
typenameBV>
927 returnbv_rows_[
i];
932 template<
typenameBV>
937null_idx_ = null_idx;
942 template<
typenameBV>
965bv_rows_[
i] = bv ? construct_bvector(bv) : 0;
972 template<
typenameBV>
976 size_typer_to = (!erase_null && null_idx_) ? null_idx_ : rsize_;
984 template<
typenameBV>
990bv->insert(idx,
false);
995 template<
typenameBV>
1001bv->clear_bit_no_check(idx);
1006 template<
typenameBV>
1011bv->swap(idx1, idx2);
1016 template<
typenameBV>
1020 if(rsize <= rsize_prev)
1029 BM_ASSERT((!null_idx_) || (rsize & 1u));
1030::memset(&bv_rows_[0], 0, rsize *
sizeof(bv_rows_[0]));
1034bv_rows_[
i] = bv_rows_prev[
i];
1035alloc_.free_ptr(bv_rows_prev,
unsigned(rsize_prev));
1038bv_rows_[rsize-1] = bv_rows_[null_idx_];
1039bv_rows_[null_idx_] = 0;
1040null_idx_ = rsize-1;
1048 template<
typenameBV>
1051 autoslices = rows();
1054clear_row(
i, free_mem);
1060 template<
typenameBV>
1063 unsignedslices = (unsigned) this->rows();
1064 unsignedarg_slices = (unsigned) bbm.rows();
1065 unsignedmax_slices(slices);
1066 if(max_slices < arg_slices)
1067max_slices = arg_slices;
1069 for(
unsignedj = 0;
eq&& (j < max_slices); ++j)
1073bv = (j < slices) ? this->get_row(j) : 0;
1074arg_bv = (j < arg_slices) ? bbm.get_row(j) : 0;
1091 eq= bv->equal(*arg_bv);
1098 template<
typenameBV>
1102 size_typeosize = (7 + rows_not_null()) / 8;
1109 template<
typenameBV>
1116destruct_bvector(bv);
1121alloc_.free_ptr(bv_rows_,
unsigned(rsize_));
1127 template<
typenameBV>
1133 if(rsize_ != bbm.rsize_)
1135 if(null_idx_ != bbm.null_idx_)
1141 if(
bool(bv) !=
bool(bv_arg))
1151 template<
typenameBV>
1154 if(pool_ != pool_ptr)
1158bv->set_allocator_pool(pool_ptr);
1166 template<
typenameBV>
1171 auto i= rows_not_null();
1172 for(--
i;
i> 0; --
i)
1185 template<
typenameBV>
1198 template<
typenameBV>
1210 template<
typenameBV>
1219alloc_ = bbm.alloc_;
1220bbm.alloc_ = alloc_tmp;
1228bbm.pool_ = pool_tmp;
1234bv_rows_ = bbm.bv_rows_;
1235bbm.bv_rows_ = rtmp;
1240 template<
typenameBV>
1249 while(
row>= new_rsize)
1251allocate_rows(new_rsize);
1257bv = bv_rows_[
row] = construct_bvector(0);
1263 template<
typenameBV>
1268allocate_rows(
row+ 8);
1274bv = bv_rows_[
row] = construct_bvector(&bv_src);
1281 template<
typenameBV>
1287destruct_bvector(bv);
1288bv_rows_[
row] = 0;
1294 template<
typenameBV>
1302destruct_bvector(bv);
1303bv_rows_[
row] = 0;
1312 template<
typenameBV>
1321BM_THROW(
false, BM_ERR_BADALLOC);
1327rbv =
new(mem)
bvector_type(ap_.strat, ap_.glevel_len, bv_size_, alloc_);
1335rbv =
new bvector_type(ap_.strat, ap_.glevel_len, bv_size_, alloc_);
1340rbv->set_allocator_pool(pool_);
1346 template<
typenameBV>
1359 template<
typenameBV>
1365 returnbv->get_blocks_manager().get_block_ptr(
i, j);
1371 template<
typenameBV>
1373 unsignedslice_from,
unsignedslice_until,
1376 for(
unsignedp = slice_from; p < slice_until; ++p)
1378bv->clear_bit_no_check(idx);
1384 template<
typenameBV>
1387 unsigned charoctet)
1389 if(7u + octet_idx * 8u > rsize_)
1390allocate_rows(rsize_ + 16);
1394 for(;
row< row_end; ++
row)
1400bv = this->construct_row(
row);
1401bv->set_bit_no_check(pos);
1406bv->clear_bit_no_check(pos);
1414 if(row_end > rsize_)
1418bv->clear_bit_no_check(pos);
1423 template<
typenameBV>
1426 unsigned charoctet)
1433 for(;
row< row_end; ++
row)
1440bv = this->construct_row(
row);
1441bv->set_bit_no_check(pos);
1445bv->insert(pos,
true);
1451bv->insert(pos,
false);
1459 if(row_end > rsize_)
1463bv->insert(pos,
false);
1474b1 = (blka[0] == FBADDR);
1475b2 = (blka[1] == FBADDR);
1476b1 |= (blka[2] == FBADDR);
1477b2 |= (blka[3] == FBADDR);
1478b1 |= (blka[4] == FBADDR);
1479b2 |= (blka[5] == FBADDR);
1480b1 |= (blka[6] == FBADDR);
1481b2 |= (blka[7] == FBADDR);
1485 template<
typenameBV>
1496 unsignedrow_idx = unsigned(octet_idx * 8);
1497 if(row_idx + 7 >= rsize_ ||
1498(null_idx_ && (row_idx + 7 > null_idx_)))
1499 return(
unsigned char)v;
1501blka[0] = get_block(row_idx+0, i0, j0);
1502blka[1] = get_block(row_idx+1, i0, j0);
1503blka[2] = get_block(row_idx+2, i0, j0);
1504blka[3] = get_block(row_idx+3, i0, j0);
1505blka[4] = get_block(row_idx+4, i0, j0);
1506blka[5] = get_block(row_idx+5, i0, j0);
1507blka[6] = get_block(row_idx+6, i0, j0);
1508blka[7] = get_block(row_idx+7, i0, j0);
1521 if(
const bm::word_t* blk; (blk = blka[0])!=0)
1524v |= (unsigned)
bool(is_set);
1526 if(
const bm::word_t* blk;(blk = blka[1])!=0)
1529v |= unsigned(
bool(is_set)) << 1u;
1531 if(
const bm::word_t* blk;(blk = blka[2])!=0)
1534v |= unsigned(
bool(is_set)) << 2u;
1536 if(
const bm::word_t* blk;(blk = blka[3])!=0)
1539v |= unsigned(
bool(is_set)) << 3u;
1541 if(
const bm::word_t* blk;(blk = blka[4])!=0)
1544v |= unsigned(
bool(is_set)) << 4u;
1546 if(
const bm::word_t* blk;(blk = blka[5])!=0)
1549v |= unsigned(
bool(is_set)) << 5u;
1551 if(
const bm::word_t* blk;(blk = blka[6])!=0)
1554v |= unsigned(
bool(is_set)) << 6u;
1556 if(
const bm::word_t* blk;(blk = blka[7])!=0)
1559v |= unsigned(
bool(is_set)) << 7u;
1561 return(
unsigned char)v;
1565 if((blk = blka[0])!=0)
1571v |= (unsigned)
bool(is_set);
1573 if((blk = blka[1])!=0)
1579v |= unsigned(
bool(is_set)) << 1u;
1581 if((blk = blka[2])!=0)
1587v |= unsigned(
bool(is_set)) << 2u;
1589 if((blk = blka[3])!=0)
1595v |= unsigned(
bool(is_set)) << 3u;
1598 if((blk = blka[4])!=0)
1604v |= unsigned(
bool(is_set)) << 4u;
1606 if((blk = blka[5])!=0)
1612v |= unsigned(
bool(is_set)) << 5u;
1614 if((blk = blka[6])!=0)
1620v |= unsigned(
bool(is_set)) << 6u;
1622 if((blk = blka[7])!=0)
1628v |= unsigned(
bool(is_set)) << 7u;
1631 return(
unsigned char)v;
1636 template<
typenameBV>
1641 char value= char(get_octet(pos, octet_idx));
1674 template<
typenameBV>
1688blka[0] = get_block(row_idx+0, i0, j0);
1689blka[1] = get_block(row_idx+1, i0, j0);
1690blka[2] = get_block(row_idx+2, i0, j0);
1691blka[3] = get_block(row_idx+3, i0, j0);
1701 if(!
test_4gaps(blka[0], blka[1], blka[2], blka[3]))
1703 if(
test_4bits(blka[0], blka[1], blka[2], blka[3]))
1705v = unsigned(
bool((blka[0][nword] & mask0))) |
1706unsigned(
bool((blka[1][nword] & mask0)) << 1u) |
1707unsigned(
bool((blka[2][nword] & mask0)) << 2u) |
1708unsigned(
bool((blka[3][nword] & mask0)) << 3u);
1716 if((blk = blka[
i])!=0)
1722v |= unsigned(
bool(is_set)) <<
i;
1724 if((blk = blka[++
i])!=0)
1730v |= unsigned(
bool(is_set)) <<
i;
1738 template<
typenameBV>
1740 typenamebvector_type::optmode opt_mode,
1741 typenamebvector_type::statistics*
st)
1750 for(
unsignedk = 0; k < rsize_; ++k)
1754 typenamebvector_type::statistics stbv;
1756bv->optimize(temp_block, opt_mode,
st? &stbv : 0);
1765 template<
typenameBV>
1768 for(
unsignedk = 0; k < rsize_; ++k)
1776 template<
typenameBV>
1783 typenamebvector_type::statistics stbv;
1784bv->calc_stat(&stbv);
1788 st.max_serialize_mem += 8;
1793 template<
typenameBV>
1795 typenameBV::optmode opt_mode)
1797 for(
unsignedk = 0; k < rsize_; ++k)
1803 typenamebvector_type::blocks_manager_type& bman =
1804bv->get_blocks_manager();
1805bman.optimize_bit_block(
i, j, opt_mode);
1813 template<
typenameBV>
1817digest_bv.clear(
false);
1818 unsignedplanes = (unsigned)rows();
1819 for(
unsigned i= 0;
i< planes; ++
i)
1822digest_bv.set_bit_no_check(
i);
1832 template<
classVal,
classBV,
unsignedMAX_SIZE>
1839 template<
classVal,
classBV,
unsignedMAX_SIZE>
1846: bmatr_(sv_slices, is_dynamic, ap, bv_max_size, alloc)
1850 size_typenull_idx = (MAX_SIZE *
sizeof(Val) * 8);
1859 template<
classVal,
classBV,
unsignedMAX_SIZE>
1862: bmatr_(bsv.bmatr_),
1863slice_mask_(bsv.slice_mask_),
1865effective_slices_(bsv.effective_slices_)
1870 template<
classVal,
classBV,
unsignedMAX_SIZE>
1879bmatr_.null_idx_ = arg_null_idx;
1882bmatr_.allocate_rows(slices);
1888 if(
i&& (
i== arg_null_idx))
1893bv->set_range(0, size_-1);
1899bmatr_.destruct_row(
i);
1904bmatr_.construct_row(
i, *bv_src);
1912 template<
classVal,
classBV,
unsignedMAX_SIZE>
1918 if(rows < arg_rows)
1921bmatr_.allocate_rows(rows);
1922 BM_ASSERT(this->bmatr_.rows() == arg_rows);
1928bv_null_arg = bmatr.
get_row(null_idx);
1933bv_null->merge(*bv_null_arg);
1935 if(rows > arg_rows)
1937 for(
unsignedj = 0; j < rows; ++j)
1940 if(arg_bv && arg_bv != bv_null_arg)
1951 template<
classVal,
classBV,
unsignedMAX_SIZE>
1957bmatr_.swap(bsv.bmatr_);
1960 bm::xor_swap(effective_slices_, bsv.effective_slices_);
1966 template<
classVal,
classBV,
unsignedMAX_SIZE>
1969 autoslices = bmatr_.rows();
1974bmatr_.clear_row(
i, free_mem);
1975slice_mask_ = 0; size_ = 0;
1977bv_null->clear(
true);
1978this->bmatr_.is_ro_ =
false;
1983 template<
classVal,
classBV,
unsignedMAX_SIZE>
1990 returnclear_range(right, left, set_null);
1991 autoplanes = bmatr_.rows();
1993 for(
unsigned i= 0;
i< planes; ++
i)
1997bv->clear_range_no_check(left, right);
1999 if(set_null && bv_null)
2000bv_null->clear_range_no_check(left, right);
2005 template<
classVal,
classBV,
unsignedMAX_SIZE>
2011this->clear_range(0, left-1, (slice_null ==
bm::use_null));
2014this->clear_range(right + 1, sz, (slice_null ==
bm::use_null));
2019 template<
classVal,
classBV,
unsignedMAX_SIZE>
2030clear_range(sz, this->size_, set_null);
2037 template<
classVal,
classBV,
unsignedMAX_SIZE>
2042 return(bv_null) ? (!bv_null->test(idx)) :
false;
2047 template<
classVal,
classBV,
unsignedMAX_SIZE>
2052bv_null->insert(idx, not_null);
2057 template<
classVal,
classBV,
unsignedMAX_SIZE>
2069 if(
i> effective_slices_)
2070effective_slices_ =
i;
2077 template<
classVal,
classBV,
unsignedMAX_SIZE>
2083 const unsignedplanes =
sizeof(
value_type) * 8;
2085 unsignedslice_size = (element_idx+1) * planes;
2086 if(slice_size > this->bmatr_.rows())
2087slice_size = (
unsigned) this->bmatr_.rows();
2088 for(
unsigned i= element_idx * planes;
i< slice_size; ++
i, ++bidx)
2089 mask|= get_slice(
i) ? (mask1 << bidx) : 0ull;
2095 template<
classVal,
classBV,
unsignedMAX_SIZE>
2097 typenamebvector_type::optmode opt_mode,
2098 typenamebvector_type::statistics*
st)
2100 typenamebvector_type::statistics stbv;
2101bmatr_.optimize(temp_block, opt_mode, &stbv);
2106 unsignedslices = (unsigned)this->bmatr_.rows();
2107 for(
unsignedj = 0; j < slices; ++j)
2110 if(bv && (bv != bv_null))
2115this->bmatr_.destruct_row(j);
2125 template<
classVal,
classBV,
unsignedMAX_SIZE>
2127 typenamebvector_type::statistics*
st)
const BMNOEXCEPT 2131 size_typeslices = this->get_bmatrix().rows();
2132bmatr_.calc_stat(*
st, slices);
2135 st->max_serialize_mem += 1 + 1 + 1 + 1 + 8 + (8 * slices);
2136 st->max_serialize_mem += 1 + 8;
2141 template<
classVal,
classBV,
unsignedMAX_SIZE>
2145bmatr_.clear_column(idx, plane_idx);
2150 template<
classVal,
classBV,
unsignedMAX_SIZE>
2154bmatr_.insert_column(idx, plane_idx);
2159 template<
classVal,
classBV,
unsignedMAX_SIZE>
2163bmatr_.erase_column(idx, erase_null);
2168 template<
classVal,
classBV,
unsignedMAX_SIZE>
2173 if(
size_typearg_size = sv.size(); this->size_ != arg_size)
2176 unsignedslices = (unsigned) this->bmatr_.rows();
2177 unsignedarg_slices = (unsigned) sv.bmatr_.rows();
2178 unsignedmax_slices(slices);
2179 if(max_slices < arg_slices)
2180max_slices = arg_slices;
2182 const bvector_type* bv_null = this->get_null_bvector();
2183 const bvector_type* bv_null_arg = sv.get_null_bvector();
2185 for(
unsignedj = 0; j < max_slices; ++j)
2189bv = (j < slices) ? this->bmatr_.get_row(j) : 0;
2190arg_bv = (j < arg_slices) ? sv.bmatr_.get_row(j) : 0;
2193 if(arg_bv == bv_null_arg)
2212 bool eq= bv->equal(*arg_bv);
2220 if(bv_null == bv_null_arg)
2222 if(!bv_null || !bv_null_arg)
2227 bool eq= bv_null->equal(*bv_null_arg);
2236 template<
classVal,
classBV,
unsignedMAX_SIZE>
2239 unsignedslices = (unsigned) this->bmatr_.rows();
2240 for(
unsignedj = 0; j < slices; ++j)
2242 if(
const bvector_type* bv = this->bmatr_.get_row(j))
2246bmatr_.is_ro_ =
true;
2255 template<
classVal,
classBV,
unsignedMAX_SIZE>
2269spli = this->bmatr_.rows();
2271bv_null->copy_range(*bv_null_arg, left, right);
2275spli = this->bmatr_.rows();
2281 if(arg_bv == bv_null_arg)
2283 bvector_type* bv = this->get_create_slice(
unsigned(j));
2284bv->copy_range(*arg_bv, left, right);
2292 template<
classVal,
classBV,
unsignedMAX_SIZE>
2296 ifconstexpr (is_signed())
2313 template<
classVal,
classBV,
unsignedMAX_SIZE>
2317 ifconstexpr (is_signed())
2330 #pragma warning( pop )ncbi::TMaskedQueryRegions mask
Compressed bit-vector bvector<> container, set algebraic methods, traversal iterators.
#define BM_DECLARE_TEMP_BLOCK(x)
Constants, lookup tables and typedefs.
#define FULL_BLOCK_FAKE_ADDR
Utilities for bit transposition (internal) (experimental!)
Base class for bit-transposed(bit-sliced) sparse vector construction.
allocator_pool_type * get_allocator_pool() const noexcept
Get allocation pool.
void freeze_matr()
Turn on RO mode.
void clear_all(bool free_mem=true) noexcept
resize to zero, free memory
bm::id64_t get_slice_mask(unsigned element_idx) const noexcept
void resize(size_type new_size, bool set_null)
unsigned_value_type slice_mask_
slice presence bit-mask
const bvector_type * bvector_type_const_ptr
void merge_matr(bmatrix_type &bmatr)
Merge plane bvectors from an outside base matrix Note: outside base matrix gets destroyed.
const bmatrix_type & get_bmatrix() const noexcept
bvector_type * bvector_type_ptr
const value_type & const_reference
void copy_from(const base_sparse_vector< Val, BV, MAX_SIZE > &bsv)
bool empty() const noexcept
bvector_type_ptr slice(unsigned i) noexcept
get access to bit-plane as is (can return NULL)
bvector_type_const_ptr slice(unsigned i) const noexcept
bvector_type::allocation_policy allocation_policy_type
void clear_range(size_type left, size_type right, bool set_null)
bvector_type_ptr get_create_slice(unsigned i)
get access to bit-plain, function checks and creates a plane
static constexpr unsigned value_bits() noexcept
Number of total bit-planes in the value type.
static unsigned slices() noexcept
get total number of bit-planes in the vector
static value_type u2s(unsigned_value_type v) noexcept
Convert unsigned value type to signed representation.
size_type size() const noexcept
void sync_ro() noexcept
Sybc read-only state.
base_sparse_vector(const base_sparse_vector< Val, BV, MAX_SIZE > &bsv)
unsigned effective_slices() const noexcept
Number of effective bit-planes in the value type.
bool is_nullable() const noexcept
check if container supports NULL(unassigned) values
void free_slice(unsigned i)
free memory in bit-plane
void optimize_block(block_idx_type nb, typename BV::optmode opt_mode)
plane index for the "NOT NULL" flags plane
bool is_null(size_type idx) const noexcept
test if specified element is NULL
unsigned effective_slices_
number of bit slices actually allocated
void calc_stat(typename bvector_type::statistics *st) const noexcept
Calculates memory statistics.
bvector_type_const_ptr get_slice(unsigned i) const noexcept
get read-only access to bit-plane
bmatrix_type bmatr_
bit-transposed matrix
void erase_column(size_type idx, bool erase_null)
allocator_type::allocator_pool_type allocator_pool_type
base_sparse_vector(bm::null_support null_able, bool is_dynamic, allocation_policy_type ap=allocation_policy_type(), size_type bv_max_size=bm::id_max, const allocator_type &alloc=allocator_type())
void swap_elements(size_type idx1, size_type idx2)
swap two vector elements
void swap(base_sparse_vector< Val, BV, MAX_SIZE > &bsv) noexcept
bmatrix_type & get_bmatrix() noexcept
access to internal bit-matrix
static unsigned_value_type s2u(value_type v) noexcept
Convert signed value type to unsigned representation.
void copy_range_slices(const base_sparse_vector< Val, BV, MAX_SIZE > &bsv, typename base_sparse_vector< Val, BV, MAX_SIZE >::size_type left, typename base_sparse_vector< Val, BV, MAX_SIZE >::size_type right, bm::null_support slice_null)
Perform copy_range() on a set of planes.
void set_allocator_pool(allocator_pool_type *pool_ptr) noexcept
Set allocation pool.
size_type size_
array size
void bit_and_rows(const bvector_type &bv)
Set AND (intersect) operation on all existing bit-slices.
bool equal(const base_sparse_vector< Val, BV, MAX_SIZE > &sv, bm::null_support null_able=bm::use_null) const noexcept
check if another sparse vector has the same content and size
void keep_range_no_check(size_type left, size_type right, bm::null_support slice_null)
std::make_unsigned< value_type >::type unsigned_value_type
void set_ro_flag(bool b) noexcept
Force RO flag without running freeze ops on content.
bvector_type::enumerator bvector_enumerator_type
void bit_sub_rows(const bvector_type &bv, bool use_null)
Set SUB (MINUS) operation on all existing bit-slices.
bm::basic_bmatrix< BV > bmatrix_type
static constexpr bool is_signed() noexcept
returns true if value type is signed integral type
static unsigned stored_slices() noexcept
Number of stored bit-planes (value planes + extra.
const bvector_type * get_null_bvector() const noexcept
Get bit-vector of assigned values or NULL (if not constructed that way)
bm::null_support get_null_support() const noexcept
check if container supports NULL (unassigned) values
base_sparse_vector(base_sparse_vector< Val, BV, MAX_SIZE > &&bsv) noexcept
bvector_type * get_null_bvect() noexcept
BV::allocator_type allocator_type
void optimize(bm::word_t *temp_block=0, typename bvector_type::optmode opt_mode=bvector_type::opt_compress, typename bvector_type::statistics *stat=0)
run memory optimization for all bit-vector rows
void insert_null(size_type idx, bool not_null)
void clear_value_planes_from(unsigned plane_idx, size_type idx)
void mark_null_idx(unsigned null_idx) noexcept
Set NULL plain index.
void insert_clear_value_planes_from(unsigned plane_idx, size_type idx)
bvector_type::block_idx_type block_idx_type
Basic dense bit-matrix class.
void insert_octet(size_type pos, size_type octet_idx, unsigned char octet)
void insert_column(size_type idx, size_type row_from)
allocator_pool_type * get_allocator_pool() const noexcept
bool is_ro() const noexcept
return true if matrix is in read-only mode
unsigned char get_octet(size_type pos, size_type octet_idx) const noexcept
bvector_type::block_idx_type block_idx_type
bool equal(const basic_bmatrix< BV > &bbm) const noexcept
basic_bmatrix< BV > & operator=(const basic_bmatrix< BV > &bbm)
int compare_octet(size_type pos, size_type octet_idx, char octet) const noexcept
bool is_same_structure(const basic_bmatrix< BV > &bbm) const noexcept
Debugging function to check if two matrixes have the same rows created.
void set_allocator_pool(allocator_pool_type *pool_ptr) noexcept
bvector_type * bvector_type_ptr
bvector_type_ptr * bv_rows_
void calc_stat(typename bvector_type::statistics *st) const noexcept
const unsigned char * get_remap_buffer() const noexcept
void swap_columns(size_type idx1, size_type idx2)
bool is_dynamic_
if rsize is dynamic (variable length)
void swap(basic_bmatrix< BV > &bbm) noexcept
unsigned get_half_octet(size_type pos, size_type row_idx) const noexcept
bvector_type_ptr construct_row(size_type row)
static constexpr bool is_compressed() noexcept
void set_null_idx(size_type null_idx) noexcept
set index of the NULL vector
const bvector_type * row(size_type i) const noexcept
void calc_stat(typename bvector_type::statistics &st, size_type rsize) const noexcept
size_type rows_not_null() const noexcept
BV::allocator_type allocator_type
void mark_null_idx(unsigned null_idx) noexcept
bvector_type::allocation_policy allocation_policy_type
remap_matrix_type * get_remap_matrix()
size_type null_idx_
Index of the NULL row.
allocator_type::allocator_pool_type allocator_pool_type
void destruct_row(size_type row)
const bvector_type * bvector_type_const_ptr
unsigned char * init_remap_buffer() noexcept
bvector_type * construct_bvector(const bvector_type *bv) const
const bm::word_t * get_block(size_type p, unsigned i, unsigned j) const noexcept
Get low level internal access to.
void bit_and_rows(const bvector_type &bv)
Set AND (intersect) operation on all existing rows.
const basic_bmatrix< BV > & get_bmatrix() const noexcept
return *this (for serializer compat)
void build_plane_digest(bvector_type &digest_bv) const
Construct digest vector of 1s for every row in the matrix.
size_type size() const noexcept
return size of the vector (always bm::id_max )
size_t remap_size() const noexcept
bvector_type_ptr get_create_slice(unsigned i)
allocator_pool_type * pool_
size_type size_internal() const noexcept
same as size()
void sync(bool, bool) noexcept
syncronize internal structures, build fast access index
void free_rows() noexcept
Free all rows.
void copy_from(const basic_bmatrix< BV > &bbm)
static void throw_bad_alloc()
void optimize(bm::word_t *temp_block=0, typename bvector_type::optmode opt_mode=bvector_type::opt_compress, typename bvector_type::statistics *stat=0)
run memory optimization for all bit-vector rows
const remap_matrix_type * get_remap_matrix() const
static constexpr bool is_str() noexcept
void clear_slices_range(unsigned slice_from, unsigned slize_until, size_type idx)
Clear bit-planes bit.
~basic_bmatrix() noexcept
bvector_type * get_row(size_type i) noexcept
void clear_column(size_type idx, size_type row_from)
void set_ro_flag(bool b) noexcept
Force RO flag without running freeze ops on content.
void clear_row(size_type row, bool free_mem)
void clear() noexcept
resize to zero, free memory
void allocate_rows(size_type rsize)
allocate matrix rows of bit-vectors (new rows are NULLs)
void optimize_block(block_idx_type nb, typename BV::optmode opt_mode)
bvector_type * get_null_bvector() noexcept
always return 0 as basic matrix does not support the notion of NULL plane (as sparse_vectors do)
size_type calc_effective_rows_not_null() const noexcept
allocation_policy_type ap_
bvector_type_const_ptr get_row(size_type i) const noexcept
void destruct_bvector(bvector_type *bv) const
void resize_internal(size_type sz, bool set_null=true) noexcept
size_type octet_size() const noexcept
void set_octet(size_type pos, size_type octet_idx, unsigned char octet)
bool is_dynamic() const noexcept
Return if matrix is dynamic resizable.
void erase_column(size_type idx, bool erase_null)
void set_remap() noexcept
basic_bmatrix(basic_bmatrix< BV > &&bbm) noexcept
size_type get_null_idx() const noexcept
return index of the NULL vector
basic_bmatrix(size_type rsize, bool is_dynamic=true, allocation_policy_type ap=allocation_policy_type(), size_type bv_max_size=bm::id_max, const allocator_type &alloc=allocator_type())
void bit_sub_rows(const bvector_type &bv, bool use_null)
Set SUB (MINUS) operation on all existing rows.
bool is_nullable() const noexcept
check if container supports NULL(unassigned) values
void clear_all(bool free_mem, unsigned) noexcept
resize to zero, free memory
bvector_type::statistics statistics
size_type rows() const noexcept
constexpr bool is_remap() const noexcept
various type traits
bool resolve_range(size_type from, size_type to, size_type *idx_from, size_type *idx_to) const noexcept
Nominal function for serializer compatibility.
bvector_type::size_type size_type
basic_bmatrix< BV > & get_bmatrix() noexcept
return *this (for serializer compat)
static unsigned stored_slices() noexcept
optmode
Optimization mode Every next level means additional checks (better compression vs time)
bvector_size_type size_type
blocks_manager_type::block_idx_type block_idx_type
Heap allocated scalar-type matrix.
Rank-Select compressed sparse vector.
sparse vector de-serializer
Serialize sparse vector into a memory buffer(s) structure.
void swap(NCBI_NS_NCBI::pair_base_member< T1, T2 > &pair1, NCBI_NS_NCBI::pair_base_member< T1, T2 > &pair2)
null_support
NULL-able value support.
@ use_null
support "non-assigned" or "NULL" logic
@ no_null
do not support NULL values
unsigned gap_test_unr(const T *buf, const unsigned pos) noexcept
Tests if bit = pos is true. Analog of bm::gap_test with SIMD unrolling.
unsigned int
A callback function used to compare two keys in a database.
bool test_4gaps(const bm::word_t *p0, const bm::word_t *p1, const bm::word_t *p2, const bm::word_t *p3) noexcept
Test 4 pointers are all marked as GAPs.
void xor_swap(W &x, W &y) noexcept
XOR swap two variables.
const unsigned set_block_mask
void get_block_coord(BI_TYPE nb, unsigned &i, unsigned &j) noexcept
Recalc linear bvector block index into 2D matrix coordinates.
bool check_any_fullb(const bm::word_t *blka[8], const bm::word_t *FBADDR)
const unsigned set_word_shift
unsigned long long int id64_t
const unsigned set_block_shift
const unsigned set_word_mask
bool test_4bits(const bm::word_t *p0, const bm::word_t *p1, const bm::word_t *p2, const bm::word_t *p3) noexcept
Test 4 pointers are not NULL and not marked as FULLBLOCK.
double value_type
The numeric datatype used by the parser.
const struct ncbi::grid::netcache::search::fields::SIZE size
void resize(vector< SMethodDef > &container)
const GenericPointer< typename T::ValueType > T2 value
bool eq(T x_, T y_, T round_)
static SLJIT_INLINE sljit_ins st(sljit_gpr r, sljit_s32 d, sljit_gpr x, sljit_gpr b)
#define row(bind, expected)
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