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 | Static Public Attributes | Friends
sdsl::enc_vector_theo< Coder, SampleDens, RankSupport, SelectSupport, fixedIntWidth > Class Template Reference

A generic immutable space-saving vector class for unsigned integers. It encodes each integer with its self-delimiting code and still provides constant time access. More...

#include <enc_vector_theo.hpp>

List of all members.

Public Types

typedef uint64_t value_type
typedef
enc_vector_theo_const_iterator
< enc_vector_theo< Coder,
SampleDens, RankSupport,
SelectSupport, fixedIntWidth > > 
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 coder
typedef RankSupport rank_support
typedef SelectSupport select_support

Public Member Functions

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

Static Public Member Functions

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

Static Public Attributes

static const uint32_t sample_dens = SampleDens

Friends

class enc_vector_theo_const_iterator< enc_vector_theo< Coder, SampleDens, RankSupport, SelectSupport, fixedIntWidth > >

Detailed Description

template<class Coder = coder::elias_delta, uint32_t SampleDens = 1, class RankSupport = rank_support_v<>, class SelectSupport = select_support_mcl<1>, uint8_t fixedIntWidth = 0>
class sdsl::enc_vector_theo< Coder, SampleDens, RankSupport, SelectSupport, fixedIntWidth >

A generic immutable space-saving vector class for unsigned integers. It encodes each integer with its self-delimiting code and still provides constant time access.

The values of a enc_vector_theo are immutable after the constructor call. The class could be parametrized with a self-delimiting codes Coder and Rank/Select-Support for constant time access to the elements.


Constructor & Destructor Documentation

template<class Coder , uint32_t SampleDens, class RankSupport , class SelectSupport , uint8_t fixedIntWidth>
sdsl::enc_vector_theo< Coder, SampleDens, RankSupport, SelectSupport, fixedIntWidth >::enc_vector_theo ( const enc_vector_theo< Coder, SampleDens, RankSupport, SelectSupport, fixedIntWidth > &  v)

Copy constructor.

Parameters:
vThe enc_vector_theo to copy. Required for the Assignable Concept of the STL
template<class Coder = coder::elias_delta, uint32_t SampleDens = 1, class RankSupport = rank_support_v<>, class SelectSupport = select_support_mcl<1>, uint8_t fixedIntWidth = 0>
template<class Container >
sdsl::enc_vector_theo< Coder, SampleDens, RankSupport, SelectSupport, fixedIntWidth >::enc_vector_theo ( 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<class Coder , uint32_t SampleDens, class RankSupport , class SelectSupport , uint8_t fixedIntWidth>
const enc_vector_theo< Coder, SampleDens, RankSupport, SelectSupport, fixedIntWidth >::const_iterator sdsl::enc_vector_theo< Coder, SampleDens, RankSupport, SelectSupport, fixedIntWidth >::begin ( ) const

Iterator that points to the first element of the enc_vector_theo.

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

Returns if the enc_vector_theo is empty.

Equivalent to size() == 0.

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

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

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

Return the largest size that this container can ever have.

Required for the Container Concept of the STL.

template<class Coder , uint32_t SampleDens, class RankSupport , class SelectSupport , uint8_t fixedIntWidth>
bool sdsl::enc_vector_theo< Coder, SampleDens, RankSupport, SelectSupport, fixedIntWidth >::operator!= ( const enc_vector_theo< Coder, SampleDens, RankSupport, SelectSupport, fixedIntWidth > &  v) const

Unequality Operator.

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

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

Assignment Operator.

Required for the Assignable Concept of the STL.

template<class Coder , uint32_t SampleDens, class RankSupport , class SelectSupport , uint8_t fixedIntWidth>
bool sdsl::enc_vector_theo< Coder, SampleDens, RankSupport, SelectSupport, fixedIntWidth >::operator== ( const enc_vector_theo< Coder, SampleDens, RankSupport, SelectSupport, fixedIntWidth > &  v) const

Equality Operator.

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

Note:
If the sample density is not equal you should use SDSAlgorithm::equal_container_values to compare two enc_vector_theos.
  Required for the Equality Comparable Concept of the STL.
See also:
operator!=
template<class Coder , uint32_t SampleDens, class RankSupport , class SelectSupport , uint8_t fixedIntWidth>
enc_vector_theo< Coder, SampleDens, RankSupport, SelectSupport, fixedIntWidth >::value_type sdsl::enc_vector_theo< Coder, SampleDens, RankSupport, SelectSupport, 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<class Coder , uint32_t SampleDens, class RankSupport , class SelectSupport , uint8_t fixedIntWidth>
enc_vector_theo< Coder, SampleDens, RankSupport, SelectSupport, fixedIntWidth >::value_type sdsl::enc_vector_theo< Coder, SampleDens, RankSupport, SelectSupport, fixedIntWidth >::sample ( const size_type  i) const [inline]

Returns the ith sample of enc_vector_theo_prac.

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

Serialzes the enc_vector_theo to a stream.

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

The number of elements in the enc_vector_theo.

Required for the Container Concept of the STL.

See also:
max_size
template<class Coder , uint32_t SampleDens, class RankSupport , class SelectSupport , uint8_t fixedIntWidth>
void sdsl::enc_vector_theo< Coder, SampleDens, RankSupport, SelectSupport, fixedIntWidth >::swap ( enc_vector_theo< Coder, SampleDens, RankSupport, SelectSupport, fixedIntWidth > &  v)

Swap method for enc_vector_theo.

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_theo to swap.

Required for the Assignable Conecpt of the STL.


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