SDSL: Succinct Data Structure Library
A C++ template library for succinct data structures
 All Classes Namespaces Files Functions Variables Typedefs Friends
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes
sdsl::enc_vector_dna< SampleDens, fixedIntWidth > Class Template Reference

An immutable space-saving vector class for unsigned positiv integers of the psi-values of dna data. More...

#include <enc_vector_dna.hpp>

List of all members.

Public Types

typedef uint64_t value_type
typedef
random_access_const_iterator
< enc_vector_dna
iterator
typedef iterator const_iterator
typedef const value_type reference
typedef const value_type const_reference
typedef const value_type * const_pointer
typedef ptrdiff_t difference_type
typedef int_vector::size_type size_type
typedef coder::fibonacci coder

Public Member Functions

 enc_vector_dna ()
 Default Constuctor.
 enc_vector_dna (const enc_vector_dna &v)
 Copy constructor.
template<class Container >
 enc_vector_dna (const Container &c)
 Constructor for a Container of positiv integers.
template<class Container >
void init (const Container &c)
 ~enc_vector_dna ()
 Default Destructor.
size_type size () const
 The number of elements in the enc_vector_dna.
bool empty () const
 Returns if the enc_vector_dna is empty.
void swap (enc_vector_dna &v)
 Swap method for enc_vector_dna.
const const_iterator begin () const
 Iterator that points to the first element of the enc_vector_dna.
const const_iterator end () const
 Iterator that points to the position after the last element of the enc_vector_dna.
value_type operator[] (size_type i) const
 []-operator
enc_vector_dnaoperator= (const enc_vector_dna &v)
 Assignment Operator.
bool operator== (const enc_vector_dna &v) const
 Equality Operator.
bool operator!= (const enc_vector_dna &v) const
 Unequality Operator.
size_type serialize (std::ostream &out) const
 Serialzes the enc_vector_dna to a stream.
void load (std::istream &in)
 Load the enc_vector_dna from a stream.
value_type sample (const size_type i) const
 Returns the ith sample of enc_vector_dna.

Static Public Member Functions

static size_type max_size ()
 Return the largest size that this container can ever have.

Public Attributes

int_vector< 0 > m_z

Static Public Attributes

static const uint32_t sample_dens = SampleDens

Detailed Description

template<uint32_t SampleDens = 8, uint8_t fixedIntWidth = 0>
class sdsl::enc_vector_dna< SampleDens, fixedIntWidth >

An immutable space-saving vector class for unsigned positiv integers of the psi-values of dna data.

It encodes each integer with its fibonacci-code and still provides constant time access. The values of a enc_vector_dna are immutable after the constructor call. The class could be parametrized with sample denisty.


Constructor & Destructor Documentation

template<uint32_t SampleDens, uint8_t fixedIntWidth>
sdsl::enc_vector_dna< SampleDens, fixedIntWidth >::enc_vector_dna ( const enc_vector_dna< SampleDens, fixedIntWidth > &  v)

Copy constructor.

Parameters:
vThe enc_vector_dna to copy. Required for the Assignable Concept of the STL
template<uint32_t SampleDens = 8, uint8_t fixedIntWidth = 0>
template<class Container >
sdsl::enc_vector_dna< SampleDens, fixedIntWidth >::enc_vector_dna ( const Container &  c) [inline]

Constructor for a Container of positiv integers.

Parameters:
cA container of positive integers.
The container is used to build the EncVector of the
integer sequence.

Member Function Documentation

template<uint32_t SampleDens, uint8_t fixedIntWidth>
const enc_vector_dna< SampleDens, fixedIntWidth >::const_iterator sdsl::enc_vector_dna< SampleDens, fixedIntWidth >::begin ( ) const

Iterator that points to the first element of the enc_vector_dna.

  Required for the Container Concept of the STL.
See also:
end()
template<uint32_t SampleDens, uint8_t fixedIntWidth>
bool sdsl::enc_vector_dna< SampleDens, fixedIntWidth >::empty ( ) const [inline]

Returns if the enc_vector_dna is empty.

Equivalent to size() == 0.

   Required for the STL Container Concept.
See also:
size()
template<uint32_t SampleDens, uint8_t fixedIntWidth>
const enc_vector_dna< SampleDens, fixedIntWidth >::const_iterator sdsl::enc_vector_dna< SampleDens, fixedIntWidth >::end ( ) const

Iterator that points to the position after the last element of the enc_vector_dna.

  Required for the Container Concept of the STL
See also:
begin()
template<uint32_t SampleDens, uint8_t fixedIntWidth>
enc_vector_dna::size_type sdsl::enc_vector_dna< SampleDens, fixedIntWidth >::max_size ( ) [inline, static]

Return the largest size that this container can ever have.

Required for the Container Concept of the STL.

template<uint32_t SampleDens, uint8_t fixedIntWidth>
bool sdsl::enc_vector_dna< SampleDens, fixedIntWidth >::operator!= ( const enc_vector_dna< SampleDens, fixedIntWidth > &  v) const

Unequality Operator.

Two enc_vector_dnas are unuequal if not all member variables are equal (including the sample density of the enc_vector_dnas).

Note:
If the sample density is not equal you should use SDSAlgorithm::equal_container_values to compare two enc_vector_dnas.
  Required for the Equality Comparable Concept of the STL.
See also:
operator==
template<uint32_t SampleDens, uint8_t fixedIntWidth>
enc_vector_dna< SampleDens, fixedIntWidth > & sdsl::enc_vector_dna< SampleDens, fixedIntWidth >::operator= ( const enc_vector_dna< SampleDens, fixedIntWidth > &  v)

Assignment Operator.

Required for the Assignable Concept of the STL.

template<uint32_t SampleDens, uint8_t fixedIntWidth>
bool sdsl::enc_vector_dna< SampleDens, fixedIntWidth >::operator== ( const enc_vector_dna< SampleDens, fixedIntWidth > &  v) const

Equality Operator.

Two enc_vector_dnas are equal if all member variables are equal (including the sample density of the enc_vector_dnas).

Note:
If the sample density is not equal you should use SDSAlgorithm::equal_container_values to compare two enc_vector_dnas.
  Required for the Equality Comparable Concept of the STL.
See also:
operator!=
template<uint32_t SampleDens, uint8_t fixedIntWidth>
enc_vector_dna< SampleDens, fixedIntWidth >::value_type sdsl::enc_vector_dna< SampleDens, fixedIntWidth >::operator[] ( size_type  i) const [inline]

[]-operator

Parameters:
iIndex of the value. $ i \in [0..size()-1]$.

Required for the STL Random Access Container Concept.

template<uint32_t SampleDens, uint8_t fixedIntWidth>
enc_vector_dna< SampleDens, fixedIntWidth >::value_type sdsl::enc_vector_dna< SampleDens, fixedIntWidth >::sample ( const size_type  i) const [inline]

Returns the ith sample of enc_vector_dna.

Parameters:
iThe index of the sample. 0 <= i < size()/SampleDens
Returns:
The value of the ith sample.
template<uint32_t SampleDens, uint8_t fixedIntWidth>
enc_vector_dna::size_type sdsl::enc_vector_dna< SampleDens, fixedIntWidth >::serialize ( std::ostream &  out) const

Serialzes the enc_vector_dna to a stream.

Parameters:
outOutstream to write the data structure.
Returns:
The number of written bytes.
template<uint32_t SampleDens, uint8_t fixedIntWidth>
enc_vector_dna::size_type sdsl::enc_vector_dna< SampleDens, fixedIntWidth >::size ( ) const [inline]

The number of elements in the enc_vector_dna.

Required for the Container Concept of the STL.

See also:
max_size
template<uint32_t SampleDens, uint8_t fixedIntWidth>
void sdsl::enc_vector_dna< SampleDens, fixedIntWidth >::swap ( enc_vector_dna< SampleDens, fixedIntWidth > &  v)

Swap method for enc_vector_dna.

The swap method can be defined in terms of assignment. This requires three assignments, each of which, for a container type, is linear in the container's size. In a sense, then, a.swap(b) is redundant. This implementation guaranties a run-time complexity that is constant rather than linear.

Parameters:
venc_vector_dna to swap.

Required for the Assignable Conecpt of the STL.


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