72 auto it = str_sv.
begin();
73 auto it_end = str_sv.
end();
74 for (; it != it_end; ++it)
95 cout <<
"List of NULL values: ";
96 for (; en.valid(); ++en)
111 cout << endl <<
"--------------------------\n";
112 auto it1 = str_sv.
begin();
115 auto it2 = str_sv.
begin();
118 auto it3 = str_sv.
begin();
121 auto it_end = str_sv.
end();
122 for (; it1 != it_end; ++it1, ++it2, ++it3)
127 cout <<
"(" << *it1 <<
")" << *it2 <<
"." << *it3;
141 str_sv1.
set(2,
"788-125-6789");
146 cout <<
"Mismatch at: " << idx << endl;
147 cout <<
"value=" << str_sv1[idx] << endl;
159 str_scan.
find_eq_str(str_sv1,
"250-113-6535", bv_res);
162 for (;en.valid(); ++en)
165 cout << idx <<
": " << str_sv1[idx] << endl;
169 cout <<
"Prefix search:" << endl;
171 cout <<
"Found: " << bv_res.
count() << endl;
174 for (;en.valid(); ++en)
177 cout << idx <<
": " << str_sv1[idx] << endl;
186 catch(std::exception& ex)
188 std::cerr << ex.what() << std::endl;
Compressed bit-vector bvector<> container, set algebraic methods, traversal iterators.
#define BM_DECLARE_TEMP_BLOCK(x)
Algorithms for bm::sparse_vector.
string sparse vector based on bit-transposed matrix
pre-processor un-defines to avoid global space pollution (internal)
const bvector_type * get_null_bvector() const BMNOEXCEPT
Get bit-vector of assigned values or NULL (if not constructed that way)
Bitvector Bit-vector container with runtime compression of bits.
bvector< Alloc > & invert()
Invert/NEG all bits It should be noted, invert is affected by size() if size is set - it only inverts...
size_type count() const BMNOEXCEPT
population count (count of ON bits)
void resize(size_type new_size)
Change size of the bvector.
bool any() const BMNOEXCEPT
Returns true if any bits in this bitset are set, and otherwise returns false.
enumerator get_enumerator(size_type pos) const
Returns enumerator pointing on specified or the next available bit.
algorithms for sparse_vector scan/search
bool find_eq_str_prefix(const SV &sv, const value_type *str, bvector_type &bv_out)
find sparse vector elements with a given prefix (string)
bool find_eq_str(const SV &sv, const value_type *str, bvector_type &bv_out)
find sparse vector elements (string)
void add_null()
add NULL (no-value) to the container
void set_substr(unsigned from, unsigned len=0) BMNOEXCEPT
setup iterator to retrieve a sub-string of a string
succinct sparse vector for strings with compression using bit-slicing ( transposition) method
const_iterator end() const BMNOEXCEPT
Provide const iterator access to the end
void optimize(bm::word_t *temp_block=0, typename bvector_type::optmode opt_mode=bvector_type::opt_compress, typename str_sparse_vector< CharType, BV, STR_SIZE >::statistics *stat=0)
run memory optimization for all vector planes
size_type size() const
return size of the vector
const_iterator begin() const BMNOEXCEPT
Provide const iterator access to container content
back_insert_iterator get_back_inserter()
Provide back insert iterator Back insert iterator implements buffered insertion, which is faster,...
void set(size_type idx, const value_type *str)
set specified element with bounds checking and automatic resize
bvector_type::size_type size_type
@ use_null
support "non-assigned" or "NULL" logic
bool sparse_vector_find_first_mismatch(const SV &sv1, const SV &sv2, typename SV::size_type &midx, bm::null_support null_proc=bm::use_null)
Find first mismatch (element which is different) between two sparse vectors (uses linear scan in bit-...
bm::str_sparse_vector< char, bvector_type, 32 > str_sv_type