SDSL: Succinct Data Structure Library
A C++ template library for succinct data structures
|
An immutable space-saving vector class for unsigned positiv integers of the psi-values of dna data. More...
#include <enc_vector_dna.hpp>
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_dna & | operator= (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 |
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.
sdsl::enc_vector_dna< SampleDens, fixedIntWidth >::enc_vector_dna | ( | const enc_vector_dna< SampleDens, fixedIntWidth > & | v | ) |
Copy constructor.
v | The enc_vector_dna to copy. Required for the Assignable Concept of the STL |
sdsl::enc_vector_dna< SampleDens, fixedIntWidth >::enc_vector_dna | ( | const Container & | c | ) | [inline] |
Constructor for a Container of positiv integers.
c | A container of positive integers. |
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.
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.
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
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.
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).
Required for the Equality Comparable Concept of the STL.
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.
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).
Required for the Equality Comparable Concept of the STL.
enc_vector_dna< SampleDens, fixedIntWidth >::value_type sdsl::enc_vector_dna< SampleDens, fixedIntWidth >::operator[] | ( | size_type | i | ) | const [inline] |
[]-operator
i | Index of the value. . |
Required for the STL Random Access Container Concept.
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.
i | The index of the sample. 0 <= i < size()/SampleDens |
enc_vector_dna::size_type sdsl::enc_vector_dna< SampleDens, fixedIntWidth >::serialize | ( | std::ostream & | out | ) | const |
Serialzes the enc_vector_dna to a stream.
out | Outstream to write the data structure. |
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.
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.
v | enc_vector_dna to swap. |
Required for the Assignable Conecpt of the STL.