SDSL 3.0.2
Succinct Data Structure Library
Loading...
Searching...
No Matches
sdsl::detail::bit_compressed_word< value_t, bits_per_value > Class Template Reference

A bit compressed word. More...

#include <rank_support_int_v.hpp>

Public Types

using size_type = size_t
 The size type needed for serialisation.
 

Public Member Functions

 bit_compressed_word ()=default
 The default constructor.
 
 bit_compressed_word (bit_compressed_word const &)=default
 The copy constructor.
 
 bit_compressed_word (bit_compressed_word &&)=default
 The move constructor.
 
bit_compressed_wordoperator= (bit_compressed_word const &)=default
 The copy assignment.
 
bit_compressed_wordoperator= (bit_compressed_word &&)=default
 The move assignment.
 
 ~bit_compressed_word ()=default
 The destructor.
 
template<typename it_t >
constexpr bit_compressed_word (it_t it, it_t end) noexcept
 Constructs from a range of values.
 
constexpr value_t operator[] (size_t const index) const noexcept
 Extracts the value from the given index.
 
template<typename it_t >
constexpr void assign (it_t it, it_t end) noexcept
 Assigns a range to the word.
 
constexpr operator uint64_t () const noexcept
 Implicitly converts to the word type.
 
size_type serialize (std::ostream &out, structure_tree_node *v=nullptr, const std::string name="") const
 Saves to the stream.
 
void load (std::istream &in)
 Loads from the stream.
 
template<typename archive_t >
void CEREAL_SAVE_FUNCTION_NAME (archive_t &ar) const
 Saves to the archive.
 
template<typename archive_t >
void CEREAL_LOAD_FUNCTION_NAME (archive_t &ar)
 Loads from the archive.
 

Detailed Description

template<typename value_t, size_t bits_per_value>
class sdsl::detail::bit_compressed_word< value_t, bits_per_value >

A bit compressed word.

Template Parameters
value_tThe represented value_type.
bits_per_valueHow many bits are used to store one value. Must be less than 64.

Uses bit compression to pack as many values as possible into one word. The last bits won't be used if bits_per_value is not a power of two.

Definition at line 46 of file rank_support_int_v.hpp.

Member Typedef Documentation

◆ size_type

template<typename value_t , size_t bits_per_value>
using sdsl::detail::bit_compressed_word< value_t, bits_per_value >::size_type = size_t

The size type needed for serialisation.

Definition at line 61 of file rank_support_int_v.hpp.

Constructor & Destructor Documentation

◆ bit_compressed_word() [1/4]

template<typename value_t , size_t bits_per_value>
sdsl::detail::bit_compressed_word< value_t, bits_per_value >::bit_compressed_word ( )
default

The default constructor.

◆ bit_compressed_word() [2/4]

template<typename value_t , size_t bits_per_value>
sdsl::detail::bit_compressed_word< value_t, bits_per_value >::bit_compressed_word ( bit_compressed_word< value_t, bits_per_value > const &  )
default

The copy constructor.

◆ bit_compressed_word() [3/4]

template<typename value_t , size_t bits_per_value>
sdsl::detail::bit_compressed_word< value_t, bits_per_value >::bit_compressed_word ( bit_compressed_word< value_t, bits_per_value > &&  )
default

The move constructor.

◆ ~bit_compressed_word()

template<typename value_t , size_t bits_per_value>
sdsl::detail::bit_compressed_word< value_t, bits_per_value >::~bit_compressed_word ( )
default

The destructor.

◆ bit_compressed_word() [4/4]

template<typename value_t , size_t bits_per_value>
template<typename it_t >
constexpr sdsl::detail::bit_compressed_word< value_t, bits_per_value >::bit_compressed_word ( it_t  it,
it_t  end 
)
inlineconstexprnoexcept

Constructs from a range of values.

Template Parameters
it_tThe iterator type.
Parameters
[in]itThe iterator pointing to the first element to be stored.
[in]endThe end of the range.

The size of the range must be less or equal than max_size.

Definition at line 86 of file rank_support_int_v.hpp.

Member Function Documentation

◆ assign()

template<typename value_t , size_t bits_per_value>
template<typename it_t >
constexpr void sdsl::detail::bit_compressed_word< value_t, bits_per_value >::assign ( it_t  it,
it_t  end 
)
inlineconstexprnoexcept

Assigns a range to the word.

Template Parameters
it_tThe iterator type.
Parameters
[in]itThe iterator pointing to the first element to be stored.
[in]endThe end of the range.

The size of the range must be less or equal than max_size.

Definition at line 106 of file rank_support_int_v.hpp.

◆ CEREAL_LOAD_FUNCTION_NAME()

template<typename value_t , size_t bits_per_value>
template<typename archive_t >
void sdsl::detail::bit_compressed_word< value_t, bits_per_value >::CEREAL_LOAD_FUNCTION_NAME ( archive_t &  ar)
inline

Loads from the archive.

Definition at line 147 of file rank_support_int_v.hpp.

◆ CEREAL_SAVE_FUNCTION_NAME()

template<typename value_t , size_t bits_per_value>
template<typename archive_t >
void sdsl::detail::bit_compressed_word< value_t, bits_per_value >::CEREAL_SAVE_FUNCTION_NAME ( archive_t &  ar) const
inline

Saves to the archive.

Definition at line 140 of file rank_support_int_v.hpp.

◆ load()

template<typename value_t , size_t bits_per_value>
void sdsl::detail::bit_compressed_word< value_t, bits_per_value >::load ( std::istream &  in)
inline

Loads from the stream.

Definition at line 133 of file rank_support_int_v.hpp.

◆ operator uint64_t()

template<typename value_t , size_t bits_per_value>
constexpr sdsl::detail::bit_compressed_word< value_t, bits_per_value >::operator uint64_t ( ) const
inlineconstexprnoexcept

Implicitly converts to the word type.

Definition at line 118 of file rank_support_int_v.hpp.

◆ operator=() [1/2]

template<typename value_t , size_t bits_per_value>
bit_compressed_word & sdsl::detail::bit_compressed_word< value_t, bits_per_value >::operator= ( bit_compressed_word< value_t, bits_per_value > &&  )
default

The move assignment.

◆ operator=() [2/2]

template<typename value_t , size_t bits_per_value>
bit_compressed_word & sdsl::detail::bit_compressed_word< value_t, bits_per_value >::operator= ( bit_compressed_word< value_t, bits_per_value > const &  )
default

The copy assignment.

◆ operator[]()

template<typename value_t , size_t bits_per_value>
constexpr value_t sdsl::detail::bit_compressed_word< value_t, bits_per_value >::operator[] ( size_t const  index) const
inlineconstexprnoexcept

Extracts the value from the given index.

Parameters
[in]indexThe index to get the value from.
Returns
The value at given index.

Definition at line 95 of file rank_support_int_v.hpp.

◆ serialize()

template<typename value_t , size_t bits_per_value>
size_type sdsl::detail::bit_compressed_word< value_t, bits_per_value >::serialize ( std::ostream &  out,
structure_tree_node v = nullptr,
const std::string  name = "" 
) const
inline

Saves to the stream.

Definition at line 124 of file rank_support_int_v.hpp.


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