SDSL 3.0.3
Succinct Data Structure Library
Loading...
Searching...
No Matches
sdsl::enc_vector< t_coder, t_dens, t_width > Class Template Reference

A generic immutable space-saving vector class for unsigned integers. More...

#include <enc_vector.hpp>

Public Types

typedef uint64_t value_type
 
typedef random_access_const_iterator< enc_vectoriterator
 
typedef iterator const_iterator
 
typedef const value_type reference
 
typedef const value_type const_reference
 
typedef value_type const * const_pointer
 
typedef ptrdiff_t difference_type
 
typedef int_vector ::size_type size_type
 
typedef t_coder coder
 
typedef enc_vector_trait< t_width >::int_vector_type int_vector_type
 
typedef iv_tag index_category
 
typedef enc_vector enc_vec_type
 

Public Member Functions

 enc_vector ()=default
 
 enc_vector (enc_vector const &)=default
 
 enc_vector (enc_vector &&)=default
 
enc_vectoroperator= (enc_vector const &)=default
 
enc_vectoroperator= (enc_vector &&)=default
 
template<class Container>
 enc_vector (Container const &c)
 Constructor for a Container of unsigned integers.
 
template<uint8_t int_width>
 enc_vector (int_vector_buffer< int_width > &v_buf)
 Constructor for an int_vector_buffer of unsigned integers.
 
 ~enc_vector ()
 Default Destructor.
 
size_type size () const
 The number of elements in the enc_vector.
 
bool empty () const
 Returns if the enc_vector is empty.
 
const const_iterator begin () const
 Iterator that points to the first element of the enc_vector.
 
const const_iterator end () const
 Iterator that points to the position after the last element of the enc_vector.
 
bool operator== (enc_vector const &v) const
 
bool operator!= (enc_vector const &v) const
 
value_type operator[] (size_type i) const
 operator[]
 
size_type serialize (std::ostream &out, structure_tree_node *v=nullptr, std::string name="") const
 Serialize the enc_vector to a stream.
 
void load (std::istream &in)
 Load the enc_vector from a stream.
 
template<typename archive_t>
void CEREAL_SAVE_FUNCTION_NAME (archive_t &ar) const
 
template<typename archive_t>
void CEREAL_LOAD_FUNCTION_NAME (archive_t &ar)
 
value_type sample (const size_type i) const
 Returns the i-th sample of enc_vector.
 
uint32_t get_sample_dens () const
 
void get_inter_sampled_values (const size_type i, uint64_t *it) const
 

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 = t_dens
 

Detailed Description

template<class t_coder = coder::elias_delta<>, uint32_t t_dens = 128, uint8_t t_width = 0>
class sdsl::enc_vector< t_coder, t_dens, t_width >

A generic immutable space-saving vector class for unsigned integers.

A vector v is stored more space-efficiently by self-delimiting coding the deltas v[i+1]-v[i] (v[-1]:=0). Space of the structure and random access time to it can be controlled by a sampling parameter t_dens.

Template Parameters
t_coderSelf-delimiting coder.
t_densEvery t_dens-th element of v is sampled.
t_widthWidth of the int_vector used to store the samples and pointers. This class is a parameter of csa_sada.

Definition at line 62 of file enc_vector.hpp.

Member Typedef Documentation

◆ coder

template<class t_coder = coder::elias_delta<>, uint32_t t_dens = 128, uint8_t t_width = 0>
typedef t_coder sdsl::enc_vector< t_coder, t_dens, t_width >::coder

Definition at line 76 of file enc_vector.hpp.

◆ const_iterator

template<class t_coder = coder::elias_delta<>, uint32_t t_dens = 128, uint8_t t_width = 0>
typedef iterator sdsl::enc_vector< t_coder, t_dens, t_width >::const_iterator

Definition at line 70 of file enc_vector.hpp.

◆ const_pointer

template<class t_coder = coder::elias_delta<>, uint32_t t_dens = 128, uint8_t t_width = 0>
typedef value_type const* sdsl::enc_vector< t_coder, t_dens, t_width >::const_pointer

Definition at line 73 of file enc_vector.hpp.

◆ const_reference

template<class t_coder = coder::elias_delta<>, uint32_t t_dens = 128, uint8_t t_width = 0>
typedef const value_type sdsl::enc_vector< t_coder, t_dens, t_width >::const_reference

Definition at line 72 of file enc_vector.hpp.

◆ difference_type

template<class t_coder = coder::elias_delta<>, uint32_t t_dens = 128, uint8_t t_width = 0>
typedef ptrdiff_t sdsl::enc_vector< t_coder, t_dens, t_width >::difference_type

Definition at line 74 of file enc_vector.hpp.

◆ enc_vec_type

template<class t_coder = coder::elias_delta<>, uint32_t t_dens = 128, uint8_t t_width = 0>
typedef enc_vector sdsl::enc_vector< t_coder, t_dens, t_width >::enc_vec_type

Definition at line 80 of file enc_vector.hpp.

◆ index_category

template<class t_coder = coder::elias_delta<>, uint32_t t_dens = 128, uint8_t t_width = 0>
typedef iv_tag sdsl::enc_vector< t_coder, t_dens, t_width >::index_category

Definition at line 78 of file enc_vector.hpp.

◆ int_vector_type

template<class t_coder = coder::elias_delta<>, uint32_t t_dens = 128, uint8_t t_width = 0>
typedef enc_vector_trait<t_width>::int_vector_type sdsl::enc_vector< t_coder, t_dens, t_width >::int_vector_type

Definition at line 77 of file enc_vector.hpp.

◆ iterator

template<class t_coder = coder::elias_delta<>, uint32_t t_dens = 128, uint8_t t_width = 0>
typedef random_access_const_iterator<enc_vector> sdsl::enc_vector< t_coder, t_dens, t_width >::iterator

Definition at line 69 of file enc_vector.hpp.

◆ reference

template<class t_coder = coder::elias_delta<>, uint32_t t_dens = 128, uint8_t t_width = 0>
typedef const value_type sdsl::enc_vector< t_coder, t_dens, t_width >::reference

Definition at line 71 of file enc_vector.hpp.

◆ size_type

template<class t_coder = coder::elias_delta<>, uint32_t t_dens = 128, uint8_t t_width = 0>
typedef int_vector ::size_type sdsl::enc_vector< t_coder, t_dens, t_width >::size_type

Definition at line 75 of file enc_vector.hpp.

◆ value_type

template<class t_coder = coder::elias_delta<>, uint32_t t_dens = 128, uint8_t t_width = 0>
typedef uint64_t sdsl::enc_vector< t_coder, t_dens, t_width >::value_type

Definition at line 68 of file enc_vector.hpp.

Constructor & Destructor Documentation

◆ enc_vector() [1/5]

template<class t_coder = coder::elias_delta<>, uint32_t t_dens = 128, uint8_t t_width = 0>
sdsl::enc_vector< t_coder, t_dens, t_width >::enc_vector ( )
default

◆ enc_vector() [2/5]

template<class t_coder = coder::elias_delta<>, uint32_t t_dens = 128, uint8_t t_width = 0>
sdsl::enc_vector< t_coder, t_dens, t_width >::enc_vector ( enc_vector< t_coder, t_dens, t_width > const & )
default

◆ enc_vector() [3/5]

template<class t_coder = coder::elias_delta<>, uint32_t t_dens = 128, uint8_t t_width = 0>
sdsl::enc_vector< t_coder, t_dens, t_width >::enc_vector ( enc_vector< t_coder, t_dens, t_width > && )
default

◆ enc_vector() [4/5]

template<class t_coder, uint32_t t_dens, uint8_t t_width>
template<class Container>
sdsl::enc_vector< t_coder, t_dens, t_width >::enc_vector ( Container const & c)

Constructor for a Container of unsigned integers.

Parameters
cA container of unsigned integers.

Definition at line 236 of file enc_vector.hpp.

◆ enc_vector() [5/5]

template<class t_coder, uint32_t t_dens, uint8_t t_width>
template<uint8_t int_width>
sdsl::enc_vector< t_coder, t_dens, t_width >::enc_vector ( int_vector_buffer< int_width > & v_buf)

Constructor for an int_vector_buffer of unsigned integers.

Definition at line 321 of file enc_vector.hpp.

◆ ~enc_vector()

template<class t_coder = coder::elias_delta<>, uint32_t t_dens = 128, uint8_t t_width = 0>
sdsl::enc_vector< t_coder, t_dens, t_width >::~enc_vector ( )
inline

Default Destructor.

Definition at line 118 of file enc_vector.hpp.

Member Function Documentation

◆ begin()

template<class t_coder = coder::elias_delta<>, uint32_t t_dens = 128, uint8_t t_width = 0>
const const_iterator sdsl::enc_vector< t_coder, t_dens, t_width >::begin ( ) const
inline

Iterator that points to the first element of the enc_vector.

Definition at line 140 of file enc_vector.hpp.

◆ CEREAL_LOAD_FUNCTION_NAME()

template<class t_coder, uint32_t t_dens, uint8_t t_width>
template<typename archive_t>
void sdsl::enc_vector< t_coder, t_dens, t_width >::CEREAL_LOAD_FUNCTION_NAME ( archive_t & ar)

Definition at line 416 of file enc_vector.hpp.

◆ CEREAL_SAVE_FUNCTION_NAME()

template<class t_coder, uint32_t t_dens, uint8_t t_width>
template<typename archive_t>
void sdsl::enc_vector< t_coder, t_dens, t_width >::CEREAL_SAVE_FUNCTION_NAME ( archive_t & ar) const

Definition at line 407 of file enc_vector.hpp.

◆ empty()

template<class t_coder = coder::elias_delta<>, uint32_t t_dens = 128, uint8_t t_width = 0>
bool sdsl::enc_vector< t_coder, t_dens, t_width >::empty ( ) const
inline

Returns if the enc_vector is empty.

Definition at line 134 of file enc_vector.hpp.

◆ end()

template<class t_coder = coder::elias_delta<>, uint32_t t_dens = 128, uint8_t t_width = 0>
const const_iterator sdsl::enc_vector< t_coder, t_dens, t_width >::end ( ) const
inline

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

Definition at line 146 of file enc_vector.hpp.

◆ get_inter_sampled_values()

template<class t_coder = coder::elias_delta<>, uint32_t t_dens = 128, uint8_t t_width = 0>
void sdsl::enc_vector< t_coder, t_dens, t_width >::get_inter_sampled_values ( const size_type i,
uint64_t * it ) const
inline
Parameters
iThe index of the sample for which all values till the next sample should be decoded. 0 <= i < size()/get_sample_dens()
itA pointer to a uint64_t vector, whereto the values should be written

Definition at line 196 of file enc_vector.hpp.

◆ get_sample_dens()

template<class t_coder = coder::elias_delta<>, uint32_t t_dens = 128, uint8_t t_width = 0>
uint32_t sdsl::enc_vector< t_coder, t_dens, t_width >::get_sample_dens ( ) const
inline

Definition at line 187 of file enc_vector.hpp.

◆ load()

template<class t_coder, uint32_t t_dens, uint8_t t_width>
void sdsl::enc_vector< t_coder, t_dens, t_width >::load ( std::istream & in)

Load the enc_vector from a stream.

Definition at line 398 of file enc_vector.hpp.

◆ max_size()

template<class t_coder = coder::elias_delta<>, uint32_t t_dens = 128, uint8_t t_width = 0>
static size_type sdsl::enc_vector< t_coder, t_dens, t_width >::max_size ( )
inlinestatic

Return the largest size that this container can ever have.

Definition at line 128 of file enc_vector.hpp.

◆ operator!=()

template<class t_coder = coder::elias_delta<>, uint32_t t_dens = 128, uint8_t t_width = 0>
bool sdsl::enc_vector< t_coder, t_dens, t_width >::operator!= ( enc_vector< t_coder, t_dens, t_width > const & v) const
inline

Definition at line 156 of file enc_vector.hpp.

◆ operator=() [1/2]

template<class t_coder = coder::elias_delta<>, uint32_t t_dens = 128, uint8_t t_width = 0>
enc_vector & sdsl::enc_vector< t_coder, t_dens, t_width >::operator= ( enc_vector< t_coder, t_dens, t_width > && )
default

◆ operator=() [2/2]

template<class t_coder = coder::elias_delta<>, uint32_t t_dens = 128, uint8_t t_width = 0>
enc_vector & sdsl::enc_vector< t_coder, t_dens, t_width >::operator= ( enc_vector< t_coder, t_dens, t_width > const & )
default

◆ operator==()

template<class t_coder = coder::elias_delta<>, uint32_t t_dens = 128, uint8_t t_width = 0>
bool sdsl::enc_vector< t_coder, t_dens, t_width >::operator== ( enc_vector< t_coder, t_dens, t_width > const & v) const
inline

Definition at line 151 of file enc_vector.hpp.

◆ operator[]()

template<class t_coder, uint32_t t_dens, uint8_t t_width>
enc_vector< t_coder, t_dens, t_width >::value_type sdsl::enc_vector< t_coder, t_dens, t_width >::operator[] ( size_type i) const
inline

operator[]

Parameters
iIndex. $ i \in [0..size()-1]$.

Definition at line 216 of file enc_vector.hpp.

◆ sample()

template<class t_coder, uint32_t t_dens, uint8_t t_width>
enc_vector< t_coder, t_dens, t_width >::value_type sdsl::enc_vector< t_coder, t_dens, t_width >::sample ( const size_type i) const
inline

Returns the i-th sample of enc_vector.

Parameters
iThe index of the sample. 0 <= i < size()/get_sample_dens()
Returns
The value of the i-th sample.

Definition at line 227 of file enc_vector.hpp.

◆ serialize()

template<class t_coder, uint32_t t_dens, uint8_t t_width>
enc_vector::size_type sdsl::enc_vector< t_coder, t_dens, t_width >::serialize ( std::ostream & out,
structure_tree_node * v = nullptr,
std::string name = "" ) const

Serialize the enc_vector to a stream.

Parameters
outOut stream to write the data structure.
Returns
The number of written bytes.

Definition at line 386 of file enc_vector.hpp.

◆ size()

template<class t_coder = coder::elias_delta<>, uint32_t t_dens = 128, uint8_t t_width = 0>
size_type sdsl::enc_vector< t_coder, t_dens, t_width >::size ( ) const
inline

The number of elements in the enc_vector.

Definition at line 122 of file enc_vector.hpp.

Member Data Documentation

◆ m_z

template<class t_coder = coder::elias_delta<>, uint32_t t_dens = 128, uint8_t t_width = 0>
int_vector<0> sdsl::enc_vector< t_coder, t_dens, t_width >::m_z

Definition at line 82 of file enc_vector.hpp.

◆ sample_dens

template<class t_coder = coder::elias_delta<>, uint32_t t_dens = 128, uint8_t t_width = 0>
const uint32_t sdsl::enc_vector< t_coder, t_dens, t_width >::sample_dens = t_dens
static

Definition at line 79 of file enc_vector.hpp.


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