NVBIO
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Methods | Public Members | Static Public Members | List of all members
nvbio::SparseSymbolSet Struct Reference

Detailed description

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 uint64pos () const
 
const uint64ids () const
 

Public Members

uint64 m_n
 
uint32 m_n_special
 
nvbio::vector< host_tag, uint64m_pos
 
nvbio::vector< host_tag, uint64m_new_pos
 
nvbio::vector< host_tag, uint64m_id
 
nvbio::vector< host_tag, uint64m_new_id
 
nvbio::vector< host_tag, uint32m_buckets
 

Static Public Members

static const uint32 LOG_BUCKET_SIZE = 20u
 
static const uint32 BUCKET_SIZE = 1u << LOG_BUCKET_SIZE
 

Constructor & Destructor Documentation

nvbio::SparseSymbolSet::SparseSymbolSet ( )
inline

constructor

Parameters
cthe special symbol recorded into this set

Definition at line 210 of file paged_text.h.

Member Function Documentation

const uint64* nvbio::SparseSymbolSet::ids ( ) const
inline

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.

Parameters
rangetotal number of symbols in the virtual string
n_blocktotal number of inserted symbols
ginsertion positions for the entire block
n_specialnumber of symbols in the block which are special
p_specialthe positions of the special symbols in the block
g_specialthe insertion positions of the special symbols
id_specialthe ids associated to the special symbols
n_specialnumber of symbols in c which are special

Definition at line 236 of file paged_text.cpp.

const uint64* nvbio::SparseSymbolSet::pos ( ) const
inline

Definition at line 276 of file paged_text.h.

uint32 nvbio::SparseSymbolSet::rank ( const uint64  i) const
inline

find how many special symbols there are in the range [0,i] (inclusive)

Definition at line 260 of file paged_text.h.

void nvbio::SparseSymbolSet::reserve ( const uint64  n,
const uint32  n_special 
)

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

Parameters
rangetotal number of symbols in the virtual string
n_specialnumber of symbols in the block which are special
p_specialthe positions of the special symbols in the block
g_specialthe insertion positions of the special symbols

Definition at line 213 of file paged_text.cpp.

void nvbio::SparseSymbolSet::set_range ( const uint64  n)

extend the range of string indices

Definition at line 281 of file paged_text.cpp.

uint32 nvbio::SparseSymbolSet::size ( void  ) const
inline

return the number of special symbols collected so far

Definition at line 214 of file paged_text.h.

Member Data Documentation

const uint32 nvbio::SparseSymbolSet::BUCKET_SIZE = 1u << LOG_BUCKET_SIZE
static

Definition at line 204 of file paged_text.h.

const uint32 nvbio::SparseSymbolSet::LOG_BUCKET_SIZE = 20u
static

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.


The documentation for this struct was generated from the following files: