SDSL 3.0.1
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 const value_typeconst_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 (const enc_vector &)=default
 
 enc_vector (enc_vector &&)=default
 
enc_vectoroperator= (const enc_vector &)=default
 
enc_vectoroperator= (enc_vector &&)=default
 
template<class Container >
 enc_vector (const Container &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== (const enc_vector &v) const
 
bool operator!= (const enc_vector &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 49 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 63 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 57 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 const value_type* sdsl::enc_vector< t_coder, t_dens, t_width >::const_pointer

Definition at line 60 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 59 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 61 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 67 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 65 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 64 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 56 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 58 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 62 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 55 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 ( const enc_vector< t_coder, t_dens, t_width > &  )
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 ( const Container &  c)

Constructor for a Container of unsigned integers.

Parameters
cA container of unsigned integers.

Definition at line 200 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 284 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 104 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 116 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 379 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 370 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 113 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 119 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 160 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 154 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 361 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 110 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!= ( const enc_vector< t_coder, t_dens, t_width > &  v) const
inline

Definition at line 126 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= ( const 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 > &&  )
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== ( const enc_vector< t_coder, t_dens, t_width > &  v) const
inline

Definition at line 121 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 179 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 190 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 347 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 107 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 69 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 66 of file enc_vector.hpp.


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