NVBIO
|
A data structure to hold a sparse subset of symbols from a larger set/string
Definition at line 201 of file paged_text.h.
#include <paged_text.h>
Public Methods | |
SparseSymbolSet () | |
uint32 | size () const |
void | reserve (const uint64 n, const uint32 n_special) |
void | set (const uint64 range, const uint32 n_special, const uint32 *p, const uint32 *id) |
void | insert (const uint64 range, const uint32 n_block, const uint64 *g, const uint32 n_special, const uint32 *p_special, const uint64 *g_special, const uint32 *id_special) |
void | set_range (const uint64 n) |
uint32 | rank (const uint64 i) const |
const uint64 * | pos () const |
const uint64 * | ids () const |
Public Members | |
uint64 | m_n |
uint32 | m_n_special |
nvbio::vector< host_tag, uint64 > | m_pos |
nvbio::vector< host_tag, uint64 > | m_new_pos |
nvbio::vector< host_tag, uint64 > | m_id |
nvbio::vector< host_tag, uint64 > | m_new_id |
nvbio::vector< host_tag, uint32 > | m_buckets |
Static Public Members | |
static const uint32 | LOG_BUCKET_SIZE = 20u |
static const uint32 | BUCKET_SIZE = 1u << LOG_BUCKET_SIZE |
|
inline |
constructor
c | the special symbol recorded into this set |
Definition at line 210 of file paged_text.h.
Definition at line 277 of file paged_text.h.
void nvbio::SparseSymbolSet::insert | ( | const uint64 | range, |
const uint32 | n_block, | ||
const uint64 * | g, | ||
const uint32 | n_special, | ||
const uint32 * | p_special, | ||
const uint64 * | g_special, | ||
const uint32 * | id_special | ||
) |
simulates the insertion of a set of n_block symbols at positions g in a string, n_special of which are special and will be recorded in this set. Note that the actual symbols in the block don't need to be known, but in order to adjust the positions of the previously inserted symbols we need to know all their insertion positions, for the entire block, not just for the special symbols.
range | total number of symbols in the virtual string |
n_block | total number of inserted symbols |
g | insertion positions for the entire block |
n_special | number of symbols in the block which are special |
p_special | the positions of the special symbols in the block |
g_special | the insertion positions of the special symbols |
id_special | the ids associated to the special symbols |
n_special | number of symbols in c which are special |
Definition at line 236 of file paged_text.cpp.
Definition at line 276 of file paged_text.h.
find how many special symbols there are in the range [0,i] (inclusive)
Definition at line 260 of file paged_text.h.
reserve enough storage for n special symbols
Definition at line 202 of file paged_text.cpp.
void nvbio::SparseSymbolSet::set | ( | const uint64 | range, |
const uint32 | n_special, | ||
const uint32 * | p, | ||
const uint32 * | id | ||
) |
set the initial set of symbols
range | total number of symbols in the virtual string |
n_special | number of symbols in the block which are special |
p_special | the positions of the special symbols in the block |
g_special | the insertion positions of the special symbols |
Definition at line 213 of file paged_text.cpp.
extend the range of string indices
Definition at line 281 of file paged_text.cpp.
|
inline |
return the number of special symbols collected so far
Definition at line 214 of file paged_text.h.
Definition at line 204 of file paged_text.h.
Definition at line 203 of file paged_text.h.
nvbio::vector<host_tag,uint32> nvbio::SparseSymbolSet::m_buckets |
Definition at line 285 of file paged_text.h.
nvbio::vector<host_tag,uint64> nvbio::SparseSymbolSet::m_id |
Definition at line 283 of file paged_text.h.
uint64 nvbio::SparseSymbolSet::m_n |
Definition at line 279 of file paged_text.h.
uint32 nvbio::SparseSymbolSet::m_n_special |
Definition at line 280 of file paged_text.h.
nvbio::vector<host_tag,uint64> nvbio::SparseSymbolSet::m_new_id |
Definition at line 284 of file paged_text.h.
nvbio::vector<host_tag,uint64> nvbio::SparseSymbolSet::m_new_pos |
Definition at line 282 of file paged_text.h.
nvbio::vector<host_tag,uint64> nvbio::SparseSymbolSet::m_pos |
Definition at line 281 of file paged_text.h.