NVBIO
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Methods | Related Functions | List of all members
nvbio::SparseStringSet< StringIterator, RangeIterator > Struct Template Reference

Detailed description

template< typename StringIterator, typename RangeIterator>
struct nvbio::SparseStringSet< StringIterator, RangeIterator >

A sparse collection of strings that are stored as ranges of a larger string, and their starting points and end points are given by a range vector.

Template Parameters
StringIteratorbase string support
RangeIteratoran iterator definining a set of ranges, whose value_type must be uint2.

Assume you have a large packed-DNA genome and have identified a few isolated regions of importance that you want to analyze. With the following container you can easily represent them:

void analyze_regions(
const thrust::device_vector<uint32>& genome_storage,
const thrust::device_vector<uint2>& regions)
{
typedef PackedStream<const uint32*, uint8, 2u, true> packed_iterator;
typedef const uint2* ranges_iterator;
typedef SparseStringSet<packed_iterator, ranges_iterator> sparse_string_set;
packed_iterator packed_stream( plain_view( genome_storage ) );
// build the string set
sparse_string_set string_set(
regions.size(),
packed_stream,
plain_view( regions ) );
// work with the string set
...
}

Definition at line 613 of file string_set.h.

#include <string_set.h>

Public Types

typedef sparse_string_set_tag string_set_tag
 
typedef std::iterator_traits
< StringIterator >::value_type 
symbol_type
 
typedef vector_view
< StringIterator > 
string_type
 
typedef StringIterator symbol_iterator
 
typedef RangeIterator range_iterator
 
typedef iterator_system
< StringIterator >::type 
system_tag
 
typedef StringSetIterator
< SparseStringSet
< StringIterator,
RangeIterator > > 
iterator
 
typedef StringSetIterator
< SparseStringSet
< StringIterator,
RangeIterator > > 
const_iterator
 

Public Methods

NVBIO_FORCEINLINE NVBIO_HOST_DEVICE SparseStringSet ()
 
NVBIO_FORCEINLINE NVBIO_HOST_DEVICE SparseStringSet (const uint32 size, const StringIterator string, const RangeIterator ranges)
 
NVBIO_FORCEINLINE
NVBIO_HOST_DEVICE uint32 
size () const
 
NVBIO_FORCEINLINE
NVBIO_HOST_DEVICE string_type 
operator[] (const uint32 i) const
 
const_iterator begin () const
 
const_iterator end () const
 
iterator begin ()
 
iterator end ()
 
NVBIO_FORCEINLINE
NVBIO_HOST_DEVICE
symbol_iterator 
base_string () const
 
NVBIO_FORCEINLINE
NVBIO_HOST_DEVICE
range_iterator 
ranges () const
 

Related Functions

(Note that these are not member functions.)

template<typename StringIterator , typename RangeIterator >
SparseStringSet
< StringIterator,
RangeIterator > 
make_sparse_string_set (const uint32 size, const StringIterator string, const RangeIterator offsets)
 

Member Typedef Documentation

template<typename StringIterator, typename RangeIterator>
typedef StringSetIterator< SparseStringSet<StringIterator,RangeIterator> > nvbio::SparseStringSet< StringIterator, RangeIterator >::const_iterator

Definition at line 623 of file string_set.h.

template<typename StringIterator, typename RangeIterator>
typedef StringSetIterator< SparseStringSet<StringIterator,RangeIterator> > nvbio::SparseStringSet< StringIterator, RangeIterator >::iterator

Definition at line 622 of file string_set.h.

template<typename StringIterator, typename RangeIterator>
typedef RangeIterator nvbio::SparseStringSet< StringIterator, RangeIterator >::range_iterator

Definition at line 619 of file string_set.h.

template<typename StringIterator, typename RangeIterator>
typedef sparse_string_set_tag nvbio::SparseStringSet< StringIterator, RangeIterator >::string_set_tag

Definition at line 615 of file string_set.h.

template<typename StringIterator, typename RangeIterator>
typedef vector_view<StringIterator> nvbio::SparseStringSet< StringIterator, RangeIterator >::string_type

Definition at line 617 of file string_set.h.

template<typename StringIterator, typename RangeIterator>
typedef StringIterator nvbio::SparseStringSet< StringIterator, RangeIterator >::symbol_iterator

Definition at line 618 of file string_set.h.

template<typename StringIterator, typename RangeIterator>
typedef std::iterator_traits<StringIterator>::value_type nvbio::SparseStringSet< StringIterator, RangeIterator >::symbol_type

Definition at line 616 of file string_set.h.

template<typename StringIterator, typename RangeIterator>
typedef iterator_system<StringIterator>::type nvbio::SparseStringSet< StringIterator, RangeIterator >::system_tag

Definition at line 620 of file string_set.h.

Constructor & Destructor Documentation

template<typename StringIterator, typename RangeIterator>
NVBIO_FORCEINLINE NVBIO_HOST_DEVICE nvbio::SparseStringSet< StringIterator, RangeIterator >::SparseStringSet ( )
inline

default constructor

Definition at line 628 of file string_set.h.

template<typename StringIterator, typename RangeIterator>
NVBIO_FORCEINLINE NVBIO_HOST_DEVICE nvbio::SparseStringSet< StringIterator, RangeIterator >::SparseStringSet ( const uint32  size,
const StringIterator  string,
const RangeIterator  ranges 
)
inline

constructor

Parameters
sizeset size
stringflat string iterator
rangesstring ranges in the flat string array

Definition at line 637 of file string_set.h.

Member Function Documentation

template<typename StringIterator, typename RangeIterator>
NVBIO_FORCEINLINE NVBIO_HOST_DEVICE symbol_iterator nvbio::SparseStringSet< StringIterator, RangeIterator >::base_string ( ) const
inline

return the base string

Definition at line 681 of file string_set.h.

template<typename StringIterator, typename RangeIterator>
const_iterator nvbio::SparseStringSet< StringIterator, RangeIterator >::begin ( void  ) const
inline

begin iterator

Definition at line 664 of file string_set.h.

template<typename StringIterator, typename RangeIterator>
iterator nvbio::SparseStringSet< StringIterator, RangeIterator >::begin ( void  )
inline

begin iterator

Definition at line 672 of file string_set.h.

template<typename StringIterator, typename RangeIterator>
const_iterator nvbio::SparseStringSet< StringIterator, RangeIterator >::end ( void  ) const
inline

begin iterator

Definition at line 668 of file string_set.h.

template<typename StringIterator, typename RangeIterator>
iterator nvbio::SparseStringSet< StringIterator, RangeIterator >::end ( void  )
inline

begin iterator

Definition at line 676 of file string_set.h.

template<typename StringIterator, typename RangeIterator>
NVBIO_FORCEINLINE NVBIO_HOST_DEVICE string_type nvbio::SparseStringSet< StringIterator, RangeIterator >::operator[] ( const uint32  i) const
inline

indexing operator: access the i-th string

Definition at line 653 of file string_set.h.

template<typename StringIterator, typename RangeIterator>
NVBIO_FORCEINLINE NVBIO_HOST_DEVICE range_iterator nvbio::SparseStringSet< StringIterator, RangeIterator >::ranges ( ) const
inline

return the offset vector

Definition at line 686 of file string_set.h.

template<typename StringIterator, typename RangeIterator>
NVBIO_FORCEINLINE NVBIO_HOST_DEVICE uint32 nvbio::SparseStringSet< StringIterator, RangeIterator >::size ( void  ) const
inline

set size

Definition at line 648 of file string_set.h.


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