(
this!= &addr_res)
225 template<
classValue,
classBV>
348 typenameBV::statistics bv_st;
350addr_bv.calc_stat(&bv_st);
351 st->memory_used = bv_st.memory_used;
352 st->max_serialize_mem = bv_st.max_serialize_mem;
359 st->max_serialize_mem +=
buf.size();
363 size_th_size = 2 + 1 + ((this->
dense_vect_.size()+1) * 8);
367 size_textra_mem = (
st->max_serialize_mem / 10);
370 st->max_serialize_mem += extra_mem;
380: rs_index_(0), in_sync_(
false)
413rs_index_->~rs_index();
423: addr_bv_(addr_res.addr_bv_),
424in_sync_(addr_res.in_sync_)
442 if(
this!= &addr_res)
444addr_bv_.move_from(addr_res.addr_bv_);
445in_sync_ = addr_res.in_sync_;
449rs_index_ = addr_res.rs_index_;
450addr_res.rs_index_ = 0;
455rs_index_ = 0; in_sync_ =
false;
468*id_to = addr_bv_.count_to_test(id_from, *rs_index_);
472 boolfound = addr_bv_.test(id_from);
479*id_to = addr_bv_.count_range(0, id_from);
482 return(
bool) *id_to;
494*id_to = addr_bv_.count_to_test(id_from, *rs_index_);
495 return(
bool)*id_to;
506addr_bv_.set(id_from);
516 if(in_sync_ && force ==
false)
519addr_bv_.build_rs_index(rs_index_);
528addr_bv_.optimize(temp_block);
537 returnaddr_bv_.equal(addr_res.addr_bv_);
557: set_flags_bv_(addr_res.set_flags_bv_),
558addr_sv_(addr_res.addr_sv_),
559max_addr_(addr_res.max_addr_)
570 boolfound = set_flags_bv_.test(id_from);
571*id_to = found ? addr_sv_.at(id_from) : 0;
580 boolfound = set_flags_bv_.test(id_from);
583set_flags_bv_.set(id_from);
585addr_sv_.set(id_from, max_addr_);
594set_flags_bv_.optimize(temp_block);
595addr_sv_.optimize(temp_block);
601 template<
classValue,
classBV>
609 template<
classValue,
classBV>
612 if(dense_vect_.empty())
616 if(
key<= last_add_)
622addr_res_.set(
key);
623dense_vect_.push_back(
val);
630 template<
classValue,
classBV>
638 template<
classValue,
classBV>
641addr_res_.optimize(temp_block);
646 template<
classValue,
classBV>
650 boolfound = addr_res_.resolve(
key,
addr);
658 template<
classValue,
classBV>
662 returndense_vect_.at(
addr);
667 template<
classValue,
classBV>
672 boolfound = addr_res_.resolve(
key, &idx);
675throw_range_error(
"compressed collection item not found");
682 template<
classValue,
classBV>
687 boolfound = addr_res_.resolve(
key, &idx);
690throw_range_error(
"compressed collection item not found");
692 returndense_vect_.at(idx-1);
698 template<
classValue,
classBV>
702 throwstd::range_error(err_msg);
710 template<
classValue,
classBV>
717 int cmp= bv.compare(bva);
721 for(
size_t i= 0;
i< dense_vect_.size(); ++
i)
#define BM_ASSERT_THROW(x, xerrcode)
Serialization / compression of bvector<>. Set theoretical operations on compressed BLOBs.
Bit-bector prefix sum address resolver using bit-vector prefix sum as a space compactor.
void unsync()
Unsync the prefix sum table.
void sync(bool force=false)
Re-calculate prefix sum table (same as calc_prefix_sum)
bool get(size_type id_from, size_type *id_to) const noexcept
Resolve id to integer id (address) without sync check.
void calc_prefix_sum(bool force=false)
Re-calculate prefix sum table.
bool in_sync() const
returns true if prefix sum table is in sync with the vector
bool equal(const bvps_addr_resolver &addr_res) const noexcept
equality comparison
bvector_type addr_bv_
bit-vector for id translation
bvps_addr_resolver(const bvps_addr_resolver &addr_res)
void move_from(bvps_addr_resolver &addr_res) noexcept
Move content from the argument address resolver.
void construct_rs_index()
bvector_type::rs_index_type rs_index_type
bvps_addr_resolver & operator=(const bvps_addr_resolver &addr_res)
void optimize(bm::word_t *temp_block=0)
optimize underlying bit-vector
void set(size_type id_from)
Set id (bit) to address resolver.
bool resolve(size_type id_from, size_type *id_to) const noexcept
Resolve id to integer id (address)
bvector_type & get_bvector()
Get writable reference to the underlying bit-vector.
bool in_sync_
flag if prefix sum is in-sync with vector
const bvector_type & get_bvector() const
Get const reference to the underlying bit-vector.
rs_index_type * rs_index_
rank translation index
Compressed (sparse collection of objects)
void calc_stat(statistics *st) const
compute statistics on memory consumption
serializer< BV >::buffer buffer_type
bool move_buffer(typename parent_type::key_type key, buffer_type &buffer)
move external buffer into collection
compressed_collection< typename serializer< BV >::buffer, BV > parent_type
Compressed (sparse collection of objects)
address_resolver_type & resolver()
Get address resolver.
bool push_back(key_type key, const value_type &val)
Add new value to compressed collection.
void optimize(bm::word_t *temp_block=0)
perform memory optimizations/compression
container_type & container()
return dense container for direct access (this should be treated as an internal function designed for...
bm::bvps_addr_resolver< bvector_type > address_resolver_type
void sync()
Checkpoint method to prepare collection for reading.
value_type & at(key_type key)
find and return associated value (with bounds/presense checking)
size_t size() const
size of collection
key_type last_add_
last added element
container_type dense_vect_
compressed space container
bool equal(const compressed_collection< Value, BV > &ccoll) const
perform equality comparison with another collection
const value_type & at(key_type key) const
find and return const associated value (with bounds/presense checking)
const value_type & get(address_type addr) const
Get access to associated value by resolved address.
void throw_range_error(const char *err_msg) const
address_resolver_type addr_res_
address resolver
bool resolve(key_type key, address_type *addr) const
Resolve key address (index) in the dense vector.
const address_resolver_type & resolver() const
Get address resolver.
std::vector< value_type > container_type
sparse vector based address resolver (no space compactor, just bit-plane compressors provided by spar...
bvector_type::size_type size_type
const bvector_type & get_bvector() const
Get const reference to the underlying bit-vector of set values.
bvector_type set_flags_bv_
bit-vector of set flags
SV::bvector_type bvector_type
sparse_vector_type addr_sv_
sparse vector for address map
bool get(size_type id_from, size_type *id_to) const
Resolve id to integer id (address)
bool resolve(size_type id_from, size_type *id_to) const
Resolve id to integer id (address)
void set(size_type id_from)
Set id (bit) to address resolver.
size_type max_addr_
maximum allocated address/index
void optimize(bm::word_t *temp_block=0)
optimize underlying sparse vectors
void aligned_free(void *ptr) BMNOEXCEPT
Aligned free.
void * aligned_new_malloc(size_t size)
Aligned malloc (unlike classic malloc it throws bad_alloc exception)
const struct ncbi::grid::netcache::search::fields::KEY key
GenericValue< UTF8<> > Value
GenericValue with UTF8 encoding.
static SLJIT_INLINE sljit_ins st(sljit_gpr r, sljit_s32 d, sljit_gpr x, sljit_gpr b)
size_t max_serialize_mem
memory needed for serialization
size_t memory_used
total capacity
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