NVBIO
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Methods | Public Members | Static Public Members | List of all members
nvbio::PackedVector< SystemTag, SYMBOL_SIZE_T, BIG_ENDIAN_T, IndexType > Struct Template Reference

Detailed description

template< typename SystemTag, uint32 SYMBOL_SIZE_T, bool BIG_ENDIAN_T = false, typename IndexType = uint32>
struct nvbio::PackedVector< SystemTag, SYMBOL_SIZE_T, BIG_ENDIAN_T, IndexType >

A class to represent a vector of packed symbols, where the size of the symbol is specified at compile-time as a template parameter. The sequence is packed on top of an underlying stream of 32-bit words.

Template Parameters
SYMBOL_SIZE_Tthe number of bits needed for each symbol
BIG_ENDIAN_Tthe "endianness" of the words: if true, symbols will be packed from right to left within each word
IndexTypethe type of integer used to address the stream (e.g. uint32, uint64)

Definition at line 53 of file packed_vector.h.

#include <packed_vector.h>

Public Types

typedef SystemTag system_tag
 
typedef IndexType index_type
 
typedef nvbio::vector
< system_tag, uint32 >
::pointer 
pointer
 
typedef nvbio::vector
< system_tag, uint32 >
::const_pointer 
const_pointer
 
typedef PackedStream< pointer,
uint8, SYMBOL_SIZE, BIG_ENDIAN,
IndexType > 
stream_type
 
typedef PackedStream
< const_pointer, uint8,
SYMBOL_SIZE, BIG_ENDIAN,
IndexType > 
const_stream_type
 
typedef stream_type::iterator iterator
 
typedef const_stream_type::iterator const_iterator
 
typedef ForwardPackedStream
< const_pointer, uint8,
SYMBOL_SIZE, BIG_ENDIAN,
IndexType > 
forward_iterator
 
typedef uint8 value_type
 
typedef PackedStreamRef
< stream_type
reference
 
typedef PackedStreamRef
< const_stream_type
const_reference
 
typedef stream_type plain_view_type
 
typedef const_stream_type const_plain_view_type
 

Public Methods

 PackedVector (const index_type size=0)
 
template<typename other_tag >
 PackedVector (const PackedVector< other_tag, SYMBOL_SIZE, BIG_ENDIAN, IndexType > &other)
 
void reserve (const index_type size)
 
void resize (const index_type size)
 
void clear (void)
 
index_type size () const
 
index_type length () const
 
index_type capacity () const
 
iterator begin ()
 
iterator end ()
 
const_iterator begin () const
 
const_iterator end () const
 
void push_back (const uint8 s)
 
void * addrof (const index_type i)
 get the memory address of a symbol More...
 
NVBIO_FORCEINLINE NVBIO_HOST
const stream_type::symbol_type 
operator[] (const index_type i) const
 
NVBIO_FORCEINLINE NVBIO_HOST
stream_type::reference 
operator[] (const index_type i)
 

Public Members

nvbio::vector< system_tag, uint32m_storage
 
index_type m_size
 

Static Public Members

static const uint32 SYMBOL_SIZE = SYMBOL_SIZE_T
 
static const uint32 BIG_ENDIAN = BIG_ENDIAN_T
 
static const uint32 SYMBOLS_PER_WORD = 32 / SYMBOL_SIZE
 
static const uint32 VECTOR_WIDTH = SYMBOLS_PER_WORD
 

Member Typedef Documentation

template<typename SystemTag, uint32 SYMBOL_SIZE_T, bool BIG_ENDIAN_T = false, typename IndexType = uint32>
typedef const_stream_type::iterator nvbio::PackedVector< SystemTag, SYMBOL_SIZE_T, BIG_ENDIAN_T, IndexType >::const_iterator

Definition at line 70 of file packed_vector.h.

template<typename SystemTag, uint32 SYMBOL_SIZE_T, bool BIG_ENDIAN_T = false, typename IndexType = uint32>
typedef const_stream_type nvbio::PackedVector< SystemTag, SYMBOL_SIZE_T, BIG_ENDIAN_T, IndexType >::const_plain_view_type

Definition at line 78 of file packed_vector.h.

template<typename SystemTag, uint32 SYMBOL_SIZE_T, bool BIG_ENDIAN_T = false, typename IndexType = uint32>
typedef nvbio::vector<system_tag,uint32>::const_pointer nvbio::PackedVector< SystemTag, SYMBOL_SIZE_T, BIG_ENDIAN_T, IndexType >::const_pointer

Definition at line 65 of file packed_vector.h.

template<typename SystemTag, uint32 SYMBOL_SIZE_T, bool BIG_ENDIAN_T = false, typename IndexType = uint32>
typedef PackedStreamRef<const_stream_type> nvbio::PackedVector< SystemTag, SYMBOL_SIZE_T, BIG_ENDIAN_T, IndexType >::const_reference

Definition at line 75 of file packed_vector.h.

template<typename SystemTag, uint32 SYMBOL_SIZE_T, bool BIG_ENDIAN_T = false, typename IndexType = uint32>
typedef PackedStream<const_pointer,uint8,SYMBOL_SIZE,BIG_ENDIAN,IndexType> nvbio::PackedVector< SystemTag, SYMBOL_SIZE_T, BIG_ENDIAN_T, IndexType >::const_stream_type

Definition at line 68 of file packed_vector.h.

template<typename SystemTag, uint32 SYMBOL_SIZE_T, bool BIG_ENDIAN_T = false, typename IndexType = uint32>
typedef ForwardPackedStream<const_pointer,uint8,SYMBOL_SIZE,BIG_ENDIAN,IndexType> nvbio::PackedVector< SystemTag, SYMBOL_SIZE_T, BIG_ENDIAN_T, IndexType >::forward_iterator

Definition at line 71 of file packed_vector.h.

template<typename SystemTag, uint32 SYMBOL_SIZE_T, bool BIG_ENDIAN_T = false, typename IndexType = uint32>
typedef IndexType nvbio::PackedVector< SystemTag, SYMBOL_SIZE_T, BIG_ENDIAN_T, IndexType >::index_type

Definition at line 62 of file packed_vector.h.

template<typename SystemTag, uint32 SYMBOL_SIZE_T, bool BIG_ENDIAN_T = false, typename IndexType = uint32>
typedef stream_type::iterator nvbio::PackedVector< SystemTag, SYMBOL_SIZE_T, BIG_ENDIAN_T, IndexType >::iterator

Definition at line 69 of file packed_vector.h.

template<typename SystemTag, uint32 SYMBOL_SIZE_T, bool BIG_ENDIAN_T = false, typename IndexType = uint32>
typedef stream_type nvbio::PackedVector< SystemTag, SYMBOL_SIZE_T, BIG_ENDIAN_T, IndexType >::plain_view_type

Definition at line 77 of file packed_vector.h.

template<typename SystemTag, uint32 SYMBOL_SIZE_T, bool BIG_ENDIAN_T = false, typename IndexType = uint32>
typedef nvbio::vector<system_tag,uint32>::pointer nvbio::PackedVector< SystemTag, SYMBOL_SIZE_T, BIG_ENDIAN_T, IndexType >::pointer

Definition at line 64 of file packed_vector.h.

template<typename SystemTag, uint32 SYMBOL_SIZE_T, bool BIG_ENDIAN_T = false, typename IndexType = uint32>
typedef PackedStreamRef<stream_type> nvbio::PackedVector< SystemTag, SYMBOL_SIZE_T, BIG_ENDIAN_T, IndexType >::reference

Definition at line 74 of file packed_vector.h.

template<typename SystemTag, uint32 SYMBOL_SIZE_T, bool BIG_ENDIAN_T = false, typename IndexType = uint32>
typedef PackedStream< pointer,uint8,SYMBOL_SIZE,BIG_ENDIAN,IndexType> nvbio::PackedVector< SystemTag, SYMBOL_SIZE_T, BIG_ENDIAN_T, IndexType >::stream_type

Definition at line 67 of file packed_vector.h.

template<typename SystemTag, uint32 SYMBOL_SIZE_T, bool BIG_ENDIAN_T = false, typename IndexType = uint32>
typedef SystemTag nvbio::PackedVector< SystemTag, SYMBOL_SIZE_T, BIG_ENDIAN_T, IndexType >::system_tag

Definition at line 61 of file packed_vector.h.

template<typename SystemTag, uint32 SYMBOL_SIZE_T, bool BIG_ENDIAN_T = false, typename IndexType = uint32>
typedef uint8 nvbio::PackedVector< SystemTag, SYMBOL_SIZE_T, BIG_ENDIAN_T, IndexType >::value_type

Definition at line 73 of file packed_vector.h.

Constructor & Destructor Documentation

template<typename SystemTag , uint32 SYMBOL_SIZE_T, bool BIG_ENDIAN_T, typename IndexType >
nvbio::PackedVector< SystemTag, SYMBOL_SIZE_T, BIG_ENDIAN_T, IndexType >::PackedVector ( const index_type  size = 0)

constructor

Definition at line 35 of file packed_vector_inl.h.

template<typename SystemTag, uint32 SYMBOL_SIZE_T, bool BIG_ENDIAN_T = false, typename IndexType = uint32>
template<typename other_tag >
nvbio::PackedVector< SystemTag, SYMBOL_SIZE_T, BIG_ENDIAN_T, IndexType >::PackedVector ( const PackedVector< other_tag, SYMBOL_SIZE, BIG_ENDIAN, IndexType > &  other)
inline

copy constructor

Definition at line 87 of file packed_vector.h.

Member Function Documentation

template<typename SystemTag , uint32 SYMBOL_SIZE_T, bool BIG_ENDIAN_T, typename IndexType >
void * nvbio::PackedVector< SystemTag, SYMBOL_SIZE_T, BIG_ENDIAN_T, IndexType >::addrof ( const index_type  i)

get the memory address of a symbol

Definition at line 120 of file packed_vector_inl.h.

template<typename SystemTag , uint32 SYMBOL_SIZE_T, bool BIG_ENDIAN_T, typename IndexType >
PackedVector< SystemTag, SYMBOL_SIZE_T, BIG_ENDIAN_T, IndexType >::iterator nvbio::PackedVector< SystemTag, SYMBOL_SIZE_T, BIG_ENDIAN_T, IndexType >::begin ( void  )

return the begin iterator

Definition at line 70 of file packed_vector_inl.h.

template<typename SystemTag , uint32 SYMBOL_SIZE_T, bool BIG_ENDIAN_T, typename IndexType >
PackedVector< SystemTag, SYMBOL_SIZE_T, BIG_ENDIAN_T, IndexType >::const_iterator nvbio::PackedVector< SystemTag, SYMBOL_SIZE_T, BIG_ENDIAN_T, IndexType >::begin ( void  ) const

return the begin iterator

Definition at line 90 of file packed_vector_inl.h.

template<typename SystemTag, uint32 SYMBOL_SIZE_T, bool BIG_ENDIAN_T = false, typename IndexType = uint32>
index_type nvbio::PackedVector< SystemTag, SYMBOL_SIZE_T, BIG_ENDIAN_T, IndexType >::capacity ( ) const
inline

Definition at line 110 of file packed_vector.h.

template<typename SystemTag , uint32 SYMBOL_SIZE_T, bool BIG_ENDIAN_T, typename IndexType >
void nvbio::PackedVector< SystemTag, SYMBOL_SIZE_T, BIG_ENDIAN_T, IndexType >::clear ( void  )

clear

Definition at line 61 of file packed_vector_inl.h.

template<typename SystemTag , uint32 SYMBOL_SIZE_T, bool BIG_ENDIAN_T, typename IndexType >
PackedVector< SystemTag, SYMBOL_SIZE_T, BIG_ENDIAN_T, IndexType >::iterator nvbio::PackedVector< SystemTag, SYMBOL_SIZE_T, BIG_ENDIAN_T, IndexType >::end ( void  )

return the end iterator

Definition at line 80 of file packed_vector_inl.h.

template<typename SystemTag , uint32 SYMBOL_SIZE_T, bool BIG_ENDIAN_T, typename IndexType >
PackedVector< SystemTag, SYMBOL_SIZE_T, BIG_ENDIAN_T, IndexType >::const_iterator nvbio::PackedVector< SystemTag, SYMBOL_SIZE_T, BIG_ENDIAN_T, IndexType >::end ( void  ) const

return the end iterator

Definition at line 100 of file packed_vector_inl.h.

template<typename SystemTag, uint32 SYMBOL_SIZE_T, bool BIG_ENDIAN_T = false, typename IndexType = uint32>
index_type nvbio::PackedVector< SystemTag, SYMBOL_SIZE_T, BIG_ENDIAN_T, IndexType >::length ( ) const
inline

length

Definition at line 108 of file packed_vector.h.

template<typename SystemTag, uint32 SYMBOL_SIZE_T, bool BIG_ENDIAN_T = false, typename IndexType = uint32>
NVBIO_FORCEINLINE NVBIO_HOST const stream_type::symbol_type nvbio::PackedVector< SystemTag, SYMBOL_SIZE_T, BIG_ENDIAN_T, IndexType >::operator[] ( const index_type  i) const
inline

get the i-th symbol note: no device implementation for this as PackedVectors are never used on device (only their plain view, which is a PackedStream)

Definition at line 138 of file packed_vector.h.

template<typename SystemTag, uint32 SYMBOL_SIZE_T, bool BIG_ENDIAN_T = false, typename IndexType = uint32>
NVBIO_FORCEINLINE NVBIO_HOST stream_type::reference nvbio::PackedVector< SystemTag, SYMBOL_SIZE_T, BIG_ENDIAN_T, IndexType >::operator[] ( const index_type  i)
inline

get the i-th symbol note: no device implementation for this as PackedVectors are never used on device (only their plain view, which is a PackedStream)

Definition at line 147 of file packed_vector.h.

template<typename SystemTag , uint32 SYMBOL_SIZE_T, bool BIG_ENDIAN_T, typename IndexType >
void nvbio::PackedVector< SystemTag, SYMBOL_SIZE_T, BIG_ENDIAN_T, IndexType >::push_back ( const uint8  s)

push back a symbol

Definition at line 109 of file packed_vector_inl.h.

template<typename SystemTag , uint32 SYMBOL_SIZE_T, bool BIG_ENDIAN_T, typename IndexType >
void nvbio::PackedVector< SystemTag, SYMBOL_SIZE_T, BIG_ENDIAN_T, IndexType >::reserve ( const index_type  size)

reserve

Definition at line 42 of file packed_vector_inl.h.

template<typename SystemTag , uint32 SYMBOL_SIZE_T, bool BIG_ENDIAN_T, typename IndexType >
void nvbio::PackedVector< SystemTag, SYMBOL_SIZE_T, BIG_ENDIAN_T, IndexType >::resize ( const index_type  size)

resize

Definition at line 51 of file packed_vector_inl.h.

template<typename SystemTag, uint32 SYMBOL_SIZE_T, bool BIG_ENDIAN_T = false, typename IndexType = uint32>
index_type nvbio::PackedVector< SystemTag, SYMBOL_SIZE_T, BIG_ENDIAN_T, IndexType >::size ( void  ) const
inline

size

Definition at line 104 of file packed_vector.h.

Member Data Documentation

template<typename SystemTag, uint32 SYMBOL_SIZE_T, bool BIG_ENDIAN_T = false, typename IndexType = uint32>
const uint32 nvbio::PackedVector< SystemTag, SYMBOL_SIZE_T, BIG_ENDIAN_T, IndexType >::BIG_ENDIAN = BIG_ENDIAN_T
static

Definition at line 56 of file packed_vector.h.

template<typename SystemTag, uint32 SYMBOL_SIZE_T, bool BIG_ENDIAN_T = false, typename IndexType = uint32>
index_type nvbio::PackedVector< SystemTag, SYMBOL_SIZE_T, BIG_ENDIAN_T, IndexType >::m_size

Definition at line 154 of file packed_vector.h.

template<typename SystemTag, uint32 SYMBOL_SIZE_T, bool BIG_ENDIAN_T = false, typename IndexType = uint32>
nvbio::vector<system_tag,uint32> nvbio::PackedVector< SystemTag, SYMBOL_SIZE_T, BIG_ENDIAN_T, IndexType >::m_storage

Definition at line 153 of file packed_vector.h.

template<typename SystemTag, uint32 SYMBOL_SIZE_T, bool BIG_ENDIAN_T = false, typename IndexType = uint32>
const uint32 nvbio::PackedVector< SystemTag, SYMBOL_SIZE_T, BIG_ENDIAN_T, IndexType >::SYMBOL_SIZE = SYMBOL_SIZE_T
static

Definition at line 55 of file packed_vector.h.

template<typename SystemTag, uint32 SYMBOL_SIZE_T, bool BIG_ENDIAN_T = false, typename IndexType = uint32>
const uint32 nvbio::PackedVector< SystemTag, SYMBOL_SIZE_T, BIG_ENDIAN_T, IndexType >::SYMBOLS_PER_WORD = 32 / SYMBOL_SIZE
static

Definition at line 58 of file packed_vector.h.

template<typename SystemTag, uint32 SYMBOL_SIZE_T, bool BIG_ENDIAN_T = false, typename IndexType = uint32>
const uint32 nvbio::PackedVector< SystemTag, SYMBOL_SIZE_T, BIG_ENDIAN_T, IndexType >::VECTOR_WIDTH = SYMBOLS_PER_WORD
static

Definition at line 59 of file packed_vector.h.


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