18#ifndef INCLUDE_SDSL_INT_VECTOR_IO_WRAPPERS
19#define INCLUDE_SDSL_INT_VECTOR_IO_WRAPPERS
30template <u
int8_t fixedIntW
idth = 0>
51 written_bytes += _sdsl_serialize_size_and_int_width(out, fixedIntWidth, m_vec.
width(), m_vec.
bit_size());
56 uint8_t w = ww & 0x7F;
61 out.write((
const char *)&w,
sizeof(uint8_t));
66 out.write((
const char *)&w,
sizeof(uint8_t));
74template <u
int8_t fixedIntW
idth = 0>
90 void load(std::istream & in)
97 m_vec.
width(int_width);
98 m_vec.bit_resize(
size);
101 while (i < m_vec.
size())
107 in.read((
char *)&w,
sizeof(uint8_t));
110 }
while ((w & 0x80) > 0);
116template <
class coder_type = coder::elias_delta<>>
137 coder_type::encode(m_vec, enc_vec);
138 written_bytes += enc_vec.
serialize(out, child,
"enc_vector");
140 return written_bytes;
144template <
class coder_type = coder::elias_delta<>>
164 coder_type::decode(enc_vec, m_vec);
168template <
class int_vector_type =
int_vector<>>
175 const int_vector_type & m_vec;
184 return m_vec.serialize(out, v, name);
188template <
class int_vector_type =
int_vector<>>
195 int_vector_type & m_vec;
201 void load(std::istream & in) { m_vec.load(in); }
204template <
class int_vector_serialize_wrapper_type =
int_vector_serialize_wrapper<>>
int_vector_type::size_type size_type
int_vector_type::value_type value_type
int_vector< fixedIntWidth > int_vector_type
void load(std::istream &in)
int_vector_load_vbyte_wrapper(int_vector_type &vec)
void load(std::istream &in)
int_vector_type::size_type size_type
int_vector_type::value_type value_type
int_vector int_vector_type
int_vector_load_vlen_wrapper(int_vector_type &vec)
void load(std::istream &in)
int_vector_type::size_type size_type
int_vector_load_wrapper(int_vector_type &vec)
int_vector_type::value_type value_type
int_vector< fixedIntWidth > int_vector_type
int_vector_type::size_type size_type
size_type serialize(std::ostream &out, structure_tree_node *v=nullptr, std::string name="") const
int_vector_serialize_vbyte_wrapper(const int_vector_type &vec)
size_type serialize(std::ostream &out, structure_tree_node *v=nullptr, std::string name="") const
int_vector_serialize_vlen_wrapper(const int_vector_type &vec)
int_vector_type::value_type value_type
int_vector_type::size_type size_type
int_vector int_vector_type
size_type serialize(std::ostream &out, structure_tree_node *v=nullptr, std::string name="") const
int_vector_type::size_type size_type
int_vector_serialize_wrapper(const int_vector_type &vec)
A generic vector class for integers of width .
int_vector_size_type size_type
int_vector_trait< t_width >::int_width_type int_width_type
size_type bit_size() const noexcept
The number of bits in the int_vector.
void load(std::istream &in)
Load the int_vector for a stream.
uint8_t width() const noexcept
Returns the width of the integers which are accessed via the [] operator.
size_type size() const noexcept
The number of elements in the int_vector.
int_vector_trait< t_width >::value_type value_type
size_type serialize(std::ostream &out, structure_tree_node *v=nullptr, std::string name="") const
Serializes the int_vector to a stream.
static structure_tree_node * add_child(structure_tree_node *v, const std::string &name, const std::string &type)
static void add_size(structure_tree_node *v, uint64_t value)
coder.hpp contains the coder namespace and includes the header files of sdsl::coder::fibonacci,...
int_vector.hpp contains the sdsl::int_vector class.
int_vector ::size_type size_type
Namespace for the succinct data structure library.
int_vector ::size_type size(const range_type &r)
Size of a range.
util.hpp contains some helper methods for int_vector and other stuff like demangle class names.