SDSL
3.0.0
Succinct Data Structure Library
|
A generic vector class for integers of width .
More...
#include <int_vector.hpp>
Classes | |
struct | raw_wrapper |
Public Types | |
typedef int_vector_trait< t_width >::value_type | value_type |
typedef int_vector_trait< t_width >::iterator | iterator |
typedef int_vector_trait< t_width >::const_iterator | const_iterator |
typedef int_vector_trait< t_width >::reference | reference |
typedef int_vector_trait< t_width >::const_reference | const_reference |
typedef int_vector_reference< int_vector > * | pointer |
typedef const value_type * | const_pointer |
typedef ptrdiff_t | difference_type |
typedef int_vector_size_type | size_type |
typedef int_vector_trait< t_width >::int_width_type | int_width_type |
typedef rank_support_v< 1, 1 > | rank_1_type |
typedef rank_support_v< 0, 1 > | rank_0_type |
typedef select_support_mcl< 1, 1 > | select_1_type |
typedef select_support_mcl< 0, 1 > | select_0_type |
typedef int_vec_category_trait< t_width >::type | index_category |
Public Member Functions | |
int_vector (size_type size, value_type default_value, uint8_t int_width=t_width) | |
Constructor for int_vector. More... | |
int_vector (size_type size=0) | |
Constructor to fix possible comparison with integeres issue. More... | |
int_vector (std::initializer_list< value_type > il) | |
Constructor for initializer_list. More... | |
template<typename input_iterator_t > | |
int_vector (typename std::enable_if< std::is_base_of< std::input_iterator_tag, typename std::iterator_traits< input_iterator_t >::iterator_category >::value, input_iterator_t >::type first, input_iterator_t last) | |
Constructor for iterator range. More... | |
void | clear () noexcept |
Clearing the int_vector. Allocated memory will not be released. More... | |
iterator | erase (const_iterator it) |
Remove element that iterator is pointing to. More... | |
iterator | erase (const_iterator first, const_iterator last) |
Remove elements in given iterator range. More... | |
template<class... Args> | |
iterator | emplace (const_iterator it, Args &&... args) |
Insert an element constructed with std::forward<Args>(args) before the element that the iterator is pointing to. More... | |
iterator | insert (const_iterator it, value_type value) |
Insert an element before the element that the iterator is pointing to. More... | |
iterator | insert (const_iterator it, size_type n, value_type value) |
Insert n copies of an element before the element that the iterator is pointing to. More... | |
iterator | insert (const_iterator it, std::initializer_list< value_type > il) |
Insert elements from intializer_list before the element that the iterator is pointing to. More... | |
template<typename input_iterator_t > | |
std::enable_if< std::is_base_of< std::input_iterator_tag, typename std::iterator_traits< input_iterator_t >::iterator_category >::value, iterator >::type | insert (const_iterator it, input_iterator_t first, input_iterator_t last) |
Insert elements from an iterator pair before the element that the iterator it is pointing to. More... | |
reference | front () noexcept |
Returns first element. More... | |
const_reference | front () const noexcept |
Returns first element. More... | |
reference | back () noexcept |
Returns last element. More... | |
const_reference | back () const noexcept |
Returns last element. More... | |
template<class... Args> | |
void | emplace_back (Args &&... args) |
Insert an element constructed with std::forward<Args>(args) at the end. More... | |
void | push_back (value_type value) |
Insert element at the end. More... | |
void | pop_back () |
Remove element at the end. More... | |
int_vector (int_vector &&v) | |
Move constructor. More... | |
int_vector (const int_vector &v) | |
Copy constructor. More... | |
~int_vector () | |
Destructor. More... | |
void | assign (size_type size, value_type default_value) |
Assign. Resize int_vector to size and fill elements with default_value . More... | |
void | assign (std::initializer_list< value_type > il) |
Assign. Resize int_vector and initialize with initializer_list. More... | |
template<typename input_iterator_t > | |
void | assign (input_iterator_t first, input_iterator_t last) |
Assign. Resize int_vector and initialize by copying from an iterator range. More... | |
bool | empty () const noexcept |
Equivalent to size() == 0. More... | |
void | swap (int_vector &v) noexcept |
Swap method for int_vector. More... | |
void | shrink_to_fit () |
Free unused allocated memory. More... | |
void | reserve (size_type capacity) |
Reserve storage. If the new capacity is smaller than the current, this method does nothing. More... | |
void | resize (const size_type size) |
Resize the int_vector in terms of elements. More... | |
void | resize (const size_type size, const value_type value) |
Resize the int_vector in terms of elements. Only as much space as necessary is allocated. More... | |
void | bit_resize (const size_type size) |
Resize the int_vector in terms of bits. Only as much space as necessary is allocated. More... | |
size_type | size () const noexcept |
The number of elements in the int_vector. More... | |
size_type | bit_size () const noexcept |
The number of bits in the int_vector. More... | |
size_type | capacity () const noexcept |
Returns the size of the occupied bits of the int_vector. More... | |
size_type | bit_capacity () const noexcept |
Returns the size of the occupied bits of the int_vector. More... | |
const uint64_t * | data () const noexcept |
Pointer to the raw data of the int_vector. More... | |
uint64_t * | data () noexcept |
Pointer to the raw data of the int_vector. More... | |
value_type | get_int (size_type idx, const uint8_t len=64) const |
Get the integer value of the binary string of length len starting at position idx in the int_vector. More... | |
void | set_int (size_type idx, value_type x, const uint8_t len=64) |
Set the bits from position idx to idx+len-1 to the binary representation of integer x. More... | |
uint8_t | width () const noexcept |
Returns the width of the integers which are accessed via the [] operator. More... | |
void | width (uint8_t new_width) noexcept |
Sets the width of the integers which are accessed via the [] operator, if t_width equals 0. More... | |
size_type | write_data (std::ostream &out) const |
size_type | serialize (std::ostream &out, structure_tree_node *v=nullptr, std::string name="") const |
Serializes the int_vector to a stream. More... | |
void | load (std::istream &in) |
Load the int_vector for a stream. More... | |
template<typename archive_t > | |
std::enable_if<!cereal::traits::is_output_serializable< cereal::BinaryData< int_vector< t_width > >, archive_t >::value, void >::type | CEREAL_SAVE_FUNCTION_NAME (archive_t &ar) const |
Serialise (save) via cereal if archive is not binary. More... | |
template<typename archive_t > | |
std::enable_if< cereal::traits::is_output_serializable< cereal::BinaryData< int_vector< t_width > >, archive_t >::value, void >::type | CEREAL_SAVE_FUNCTION_NAME (archive_t &ar) const |
Serialise (save) via cereal if archive is binary. More... | |
template<typename archive_t > | |
std::enable_if<!cereal::traits::is_input_serializable< cereal::BinaryData< int_vector< t_width > >, archive_t >::value, void >::type | CEREAL_LOAD_FUNCTION_NAME (archive_t &ar) |
Serialise (load) via cereal if archive is not binary. More... | |
template<typename archive_t > | |
std::enable_if< cereal::traits::is_input_serializable< cereal::BinaryData< int_vector< t_width > >, archive_t >::value, void >::type | CEREAL_LOAD_FUNCTION_NAME (archive_t &ar) |
Serialise (save) via cereal if archive is binary. More... | |
reference | operator[] (const size_type &i) noexcept |
non const version of [] operator More... | |
const_reference | operator[] (const size_type &i) const noexcept |
const version of [] operator More... | |
reference | at (const size_type &i) |
non const version of at() function More... | |
const_reference | at (const size_type &i) const |
const version of at() function More... | |
int_vector & | operator= (const int_vector &v) |
Assignment operator. More... | |
int_vector & | operator= (int_vector &&v) |
Move assignment operator. More... | |
bool | operator== (const int_vector< t_width > &v) const noexcept |
Equality operator for two int_vectors. More... | |
template<uint8_t t_width2> | |
bool | operator!= (const int_vector< t_width2 > &v) const noexcept |
Inequality operator for two int_vectors. More... | |
bool | operator< (const int_vector &v) const noexcept |
Less operator for two int_vectors. More... | |
bool | operator> (const int_vector &v) const noexcept |
Greater operator for two int_vectors. More... | |
bool | operator<= (const int_vector &v) const noexcept |
Less or equal operator. More... | |
bool | operator>= (const int_vector &v) const noexcept |
Greater of equal operator. More... | |
int_vector & | operator&= (const int_vector &v) |
bitwise-and-update operator More... | |
int_vector & | operator|= (const int_vector &v) |
bitwise-or-update equal operator More... | |
int_vector & | operator^= (const int_vector &v) |
bitwise-xor-update operator More... | |
iterator | begin () noexcept |
Iterator that points to the first element of the int_vector. More... | |
iterator | end () noexcept |
Iterator that points to the element after the last element of int_vector. More... | |
const_iterator | begin () const noexcept |
Const iterator that points to the first element of the int_vector. More... | |
const_iterator | end () const noexcept |
Const iterator that points to the element after the last element of int_vector. More... | |
const_iterator | cbegin () const noexcept |
Const iterator that points to the first element of the int_vector. More... | |
const_iterator | cend () const noexcept |
Const iterator that points to the element after the last element of int_vector. More... | |
void | flip () |
Flip all bits of bit_vector. More... | |
int_vector< 64 >::size_type | size () const noexcept |
int_vector< 32 >::size_type | size () const noexcept |
int_vector< 16 >::size_type | size () const noexcept |
int_vector< 8 >::size_type | size () const noexcept |
int_vector< 1 >::size_type | size () const noexcept |
int_vector< 64 >::size_type | capacity () const noexcept |
int_vector< 32 >::size_type | capacity () const noexcept |
int_vector< 16 >::size_type | capacity () const noexcept |
int_vector< 8 >::size_type | capacity () const noexcept |
int_vector< 1 >::size_type | capacity () const noexcept |
auto | operator[] (const size_type &idx) noexcept -> reference |
auto | operator[] (const size_type &idx) noexcept -> reference |
auto | operator[] (const size_type &idx) noexcept -> reference |
auto | operator[] (const size_type &idx) noexcept -> reference |
auto | operator[] (const size_type &idx) const noexcept -> const_reference |
auto | operator[] (const size_type &idx) const noexcept -> const_reference |
auto | operator[] (const size_type &idx) const noexcept -> const_reference |
auto | operator[] (const size_type &idx) const noexcept -> const_reference |
auto | operator[] (const size_type &idx) const noexcept -> const_reference |
auto | operator[] (const size_type &idx) const noexcept -> const_reference |
Static Public Member Functions | |
static size_type | max_size () noexcept |
Maximum size of the int_vector. More... | |
static size_t | read_header (int_vector_size_type &size, int_width_type &int_width, std::istream &in) |
Read the size and int_width of a int_vector. More... | |
static uint64_t | write_header (uint64_t size, uint8_t int_width, std::ostream &out) |
Write the size and int_width of a int_vector. More... | |
Public Attributes | |
float | growth_factor = 1.5 |
Growth factor for amortized constant time operations. More... | |
const raw_wrapper | raw = raw_wrapper(*this) |
Static Public Attributes | |
static constexpr uint8_t | fixed_int_width = t_width |
Friends | |
struct | int_vector_trait< t_width > |
class | int_vector_iterator_base< int_vector > |
class | int_vector_iterator< int_vector > |
class | int_vector_const_iterator< int_vector > |
template<uint8_t , std::ios_base::openmode > | |
class | int_vector_mapper |
template<typename T > | |
class | coder::elias_delta |
template<typename T > | |
class | coder::elias_gamma |
template<typename T > | |
class | coder::fibonacci |
template<uint8_t > | |
class | coder::comma |
class | memory_manager |
template<class container > | |
bool | operator== (const int_vector< t_width > &lhs, const container &rhs) noexcept |
Equality operator for an arbitrary container. More... | |
A generic vector class for integers of width .
This generic vector class could be used to generate a vector that contains integers of fixed width . It has a growth factor of 1.5 to achieve amortized running time. Note that resize() does not reserve more space than necessary.
t_width | Width of the integer. If set to 0 it is variable during runtime, otherwise fixed at compile time. |
Definition at line 252 of file int_vector.hpp.
typedef int_vector_trait<t_width>::const_iterator sdsl::int_vector< t_width >::const_iterator |
Definition at line 260 of file int_vector.hpp.
typedef const value_type* sdsl::int_vector< t_width >::const_pointer |
Definition at line 264 of file int_vector.hpp.
typedef int_vector_trait<t_width>::const_reference sdsl::int_vector< t_width >::const_reference |
Definition at line 262 of file int_vector.hpp.
typedef ptrdiff_t sdsl::int_vector< t_width >::difference_type |
Definition at line 265 of file int_vector.hpp.
typedef int_vec_category_trait<t_width>::type sdsl::int_vector< t_width >::index_category |
Definition at line 272 of file int_vector.hpp.
typedef int_vector_trait<t_width>::int_width_type sdsl::int_vector< t_width >::int_width_type |
Definition at line 267 of file int_vector.hpp.
typedef int_vector_trait<t_width>::iterator sdsl::int_vector< t_width >::iterator |
Definition at line 259 of file int_vector.hpp.
typedef int_vector_reference<int_vector>* sdsl::int_vector< t_width >::pointer |
Definition at line 263 of file int_vector.hpp.
typedef rank_support_v<0, 1> sdsl::int_vector< t_width >::rank_0_type |
Definition at line 269 of file int_vector.hpp.
typedef rank_support_v<1, 1> sdsl::int_vector< t_width >::rank_1_type |
Definition at line 268 of file int_vector.hpp.
typedef int_vector_trait<t_width>::reference sdsl::int_vector< t_width >::reference |
Definition at line 261 of file int_vector.hpp.
typedef select_support_mcl<0, 1> sdsl::int_vector< t_width >::select_0_type |
Definition at line 271 of file int_vector.hpp.
typedef select_support_mcl<1, 1> sdsl::int_vector< t_width >::select_1_type |
Definition at line 270 of file int_vector.hpp.
typedef int_vector_size_type sdsl::int_vector< t_width >::size_type |
Definition at line 266 of file int_vector.hpp.
typedef int_vector_trait<t_width>::value_type sdsl::int_vector< t_width >::value_type |
Definition at line 258 of file int_vector.hpp.
|
inline |
Constructor for int_vector.
size | Number of elements. Default value is 0. |
default_value | Initialize all value to default value . |
int_width | The width of each integer. |
Definition at line 1442 of file int_vector.hpp.
|
inlineexplicit |
Constructor to fix possible comparison with integeres issue.
Definition at line 335 of file int_vector.hpp.
|
inline |
Constructor for initializer_list.
Definition at line 339 of file int_vector.hpp.
|
inline |
Constructor for iterator range.
first | Iterator pointing to first element to be copied. |
last | Iterator pointing to the element behind the last one to be copied. |
Definition at line 350 of file int_vector.hpp.
|
inline |
Move constructor.
Definition at line 1453 of file int_vector.hpp.
|
inline |
Copy constructor.
Definition at line 1465 of file int_vector.hpp.
sdsl::int_vector< t_width >::~int_vector |
Destructor.
Definition at line 1512 of file int_vector.hpp.
|
inline |
Assign. Resize int_vector and initialize by copying from an iterator range.
first | Iterator pointing to first element to be inserted. |
last | Iterator pointing to the elemnt after the one to be inserted. |
Definition at line 515 of file int_vector.hpp.
|
inline |
Assign. Resize int_vector to size
and fill elements with default_value
.
size | Number of elements. |
default_value | Elements to be inserted. |
Definition at line 494 of file int_vector.hpp.
|
inline |
Assign. Resize int_vector and initialize with initializer_list.
il | Initializer_list. |
Definition at line 503 of file int_vector.hpp.
|
inline |
non const version of at() function
i | Index the i-th integer of length width(). |
Definition at line 689 of file int_vector.hpp.
|
inline |
const version of at() function
i | Index the i-th integer of length width(). |
Definition at line 695 of file int_vector.hpp.
|
inlinenoexcept |
Returns last element.
Definition at line 458 of file int_vector.hpp.
|
inlinenoexcept |
Returns last element.
Definition at line 455 of file int_vector.hpp.
|
inlinenoexcept |
Const iterator that points to the first element of the int_vector.
Definition at line 791 of file int_vector.hpp.
|
inlinenoexcept |
Iterator that points to the first element of the int_vector.
Time complexity guaranty is O(1).
Definition at line 783 of file int_vector.hpp.
|
inlinenoexcept |
Returns the size of the occupied bits of the int_vector.
The bit_capacity of a int_vector is greater or equal to the bit_size of the vector: bit_capacity() >= bit_size().
Definition at line 585 of file int_vector.hpp.
void sdsl::int_vector< t_width >::bit_resize | ( | const size_type | size | ) |
Resize the int_vector in terms of bits. Only as much space as necessary is allocated.
size | The size to resize the int_vector in terms of bits. |
Definition at line 1525 of file int_vector.hpp.
|
inlinenoexcept |
The number of bits in the int_vector.
Definition at line 571 of file int_vector.hpp.
|
inlinenoexcept |
Returns the size of the occupied bits of the int_vector.
The capacity of a int_vector is greater or equal to the size of the vector: capacity() >= size().
Definition at line 1608 of file int_vector.hpp.
|
inlinenoexcept |
Definition at line 1615 of file int_vector.hpp.
|
inlinenoexcept |
Definition at line 1622 of file int_vector.hpp.
|
inlinenoexcept |
Definition at line 1629 of file int_vector.hpp.
|
inlinenoexcept |
Definition at line 1636 of file int_vector.hpp.
|
inlinenoexcept |
Definition at line 1643 of file int_vector.hpp.
|
inlinenoexcept |
Const iterator that points to the first element of the int_vector.
Definition at line 797 of file int_vector.hpp.
|
inlinenoexcept |
Const iterator that points to the element after the last element of int_vector.
Definition at line 800 of file int_vector.hpp.
|
inline |
Serialise (load) via cereal if archive is not binary.
Definition at line 1882 of file int_vector.hpp.
|
inline |
Serialise (save) via cereal if archive is binary.
|
inline |
Serialise (save) via cereal if archive is not binary.
Definition at line 1856 of file int_vector.hpp.
|
inline |
Serialise (save) via cereal if archive is binary.
|
inlinenoexcept |
Clearing the int_vector. Allocated memory will not be released.
Definition at line 363 of file int_vector.hpp.
|
inlinenoexcept |
Pointer to the raw data of the int_vector.
Definition at line 590 of file int_vector.hpp.
|
inlinenoexcept |
Pointer to the raw data of the int_vector.
Definition at line 595 of file int_vector.hpp.
|
inline |
Insert an element constructed with std::forward<Args>(args) before the element that the iterator is pointing to.
it | Iterator pointing to an element in int_vector. |
args | Function parameter pack. |
Definition at line 394 of file int_vector.hpp.
|
inline |
Insert an element constructed with std::forward<Args>(args) at the end.
args | Function parameter pack. |
Definition at line 464 of file int_vector.hpp.
|
inlinenoexcept |
Equivalent to size() == 0.
Definition at line 524 of file int_vector.hpp.
|
inlinenoexcept |
Const iterator that points to the element after the last element of int_vector.
Definition at line 794 of file int_vector.hpp.
|
inlinenoexcept |
Iterator that points to the element after the last element of int_vector.
Time complexity guaranty is O(1).
Definition at line 788 of file int_vector.hpp.
|
inline |
Remove elements in given iterator range.
first | Iterator pointing to first element to be deleted. |
last | Iterator pointing to the elemnt after the one to be deleted. |
Definition at line 380 of file int_vector.hpp.
|
inline |
Remove element that iterator is pointing to.
it | Iterator pointing to an element in int_vector |
Definition at line 368 of file int_vector.hpp.
|
inline |
Flip all bits of bit_vector.
Definition at line 803 of file int_vector.hpp.
|
inlinenoexcept |
Returns first element.
Definition at line 452 of file int_vector.hpp.
|
inlinenoexcept |
Returns first element.
Definition at line 449 of file int_vector.hpp.
auto sdsl::int_vector< t_width >::get_int | ( | size_type | idx, |
const uint8_t | len = 64 |
||
) | const |
Get the integer value of the binary string of length len starting at position idx in the int_vector.
idx | Starting index of the binary representation of the integer. |
len | Length of the binary representation of the integer. Default value is 64. |
Definition at line 1541 of file int_vector.hpp.
|
inline |
Insert elements from an iterator pair before the element that the iterator it
is pointing to.
it | Iterator pointing to an element in int_vector. |
first | Iterator pointing to first element to be inserted. |
last | Iterator pointing to the elemnt after the one to be inserted. |
Definition at line 438 of file int_vector.hpp.
|
inline |
Insert n copies of an element before the element that the iterator is pointing to.
it | Iterator pointing to an element in int_vector. |
n | Number of copies. |
value | Element to be inserted. |
Definition at line 410 of file int_vector.hpp.
|
inline |
Insert elements from intializer_list before the element that the iterator is pointing to.
it | Iterator pointing to an element in int_vector. |
il | Elements to be inserted. |
Definition at line 424 of file int_vector.hpp.
|
inline |
Insert an element before the element that the iterator is pointing to.
it | Iterator pointing to an element in int_vector. |
value | Element to be inserted. |
Definition at line 403 of file int_vector.hpp.
void sdsl::int_vector< t_width >::load | ( | std::istream & | in | ) |
Load the int_vector for a stream.
Definition at line 1834 of file int_vector.hpp.
|
inlinestaticnoexcept |
Maximum size of the int_vector.
Definition at line 566 of file int_vector.hpp.
|
inlinenoexcept |
Inequality operator for two int_vectors.
Two int_vectors are not equal if
Definition at line 745 of file int_vector.hpp.
int_vector< t_width > & sdsl::int_vector< t_width >::operator&= | ( | const int_vector< t_width > & | v | ) |
bitwise-and-update operator
Definition at line 1780 of file int_vector.hpp.
|
noexcept |
Less operator for two int_vectors.
int_vector w is less than v if
Definition at line 1738 of file int_vector.hpp.
|
noexcept |
Less or equal operator.
Definition at line 1768 of file int_vector.hpp.
int_vector< t_width > & sdsl::int_vector< t_width >::operator= | ( | const int_vector< t_width > & | v | ) |
Assignment operator.
v | The vector v which should be assigned |
Definition at line 1483 of file int_vector.hpp.
int_vector< t_width > & sdsl::int_vector< t_width >::operator= | ( | int_vector< t_width > && | v | ) |
Move assignment operator.
Definition at line 1494 of file int_vector.hpp.
|
inlinenoexcept |
Equality operator for two int_vectors.
Two int_vectors are equal if
Definition at line 710 of file int_vector.hpp.
|
noexcept |
Greater operator for two int_vectors.
int_vector w is greater than v if
Definition at line 1753 of file int_vector.hpp.
|
noexcept |
Greater of equal operator.
Definition at line 1774 of file int_vector.hpp.
|
inlinenoexcept |
const version of [] operator
i | Index the i-th integer of length width(). |
Definition at line 1689 of file int_vector.hpp.
|
inlinenoexcept |
non const version of [] operator
i | Index the i-th integer of length width(). |
Definition at line 1649 of file int_vector.hpp.
|
inlinenoexcept |
Definition at line 1696 of file int_vector.hpp.
|
inlinenoexcept |
Definition at line 1703 of file int_vector.hpp.
|
inlinenoexcept |
Definition at line 1710 of file int_vector.hpp.
|
inlinenoexcept |
Definition at line 1717 of file int_vector.hpp.
|
inlinenoexcept |
Definition at line 1724 of file int_vector.hpp.
|
inlinenoexcept |
Definition at line 1731 of file int_vector.hpp.
|
inlinenoexcept |
Definition at line 1658 of file int_vector.hpp.
|
inlinenoexcept |
Definition at line 1666 of file int_vector.hpp.
|
inlinenoexcept |
Definition at line 1674 of file int_vector.hpp.
|
inlinenoexcept |
Definition at line 1682 of file int_vector.hpp.
int_vector< t_width > & sdsl::int_vector< t_width >::operator^= | ( | const int_vector< t_width > & | v | ) |
bitwise-xor-update operator
Definition at line 1796 of file int_vector.hpp.
int_vector< t_width > & sdsl::int_vector< t_width >::operator|= | ( | const int_vector< t_width > & | v | ) |
bitwise-or-update equal operator
Definition at line 1788 of file int_vector.hpp.
|
inline |
Remove element at the end.
Definition at line 479 of file int_vector.hpp.
|
inline |
Insert element at the end.
value | Element to be inserted. |
Definition at line 472 of file int_vector.hpp.
|
inlinestatic |
Read the size and int_width of a int_vector.
Definition at line 813 of file int_vector.hpp.
|
inline |
Reserve storage. If the new capacity is smaller than the current, this method does nothing.
capacity | New capacity in bits |
Definition at line 535 of file int_vector.hpp.
|
inline |
Resize the int_vector in terms of elements.
If the current size is smaller than size
, the additional elements are initialized with 0.
Only as much space as necessary is being allocated.
size | Number of elements. |
Definition at line 545 of file int_vector.hpp.
|
inline |
Resize the int_vector in terms of elements. Only as much space as necessary is allocated.
size | The size to resize the int_vector in terms of elements. |
value | If the current size is smaller than size , the additional elements are initialized with value. |
Definition at line 551 of file int_vector.hpp.
int_vector< t_width >::size_type sdsl::int_vector< t_width >::serialize | ( | std::ostream & | out, |
structure_tree_node * | v = nullptr , |
||
std::string | name = "" |
||
) | const |
Serializes the int_vector to a stream.
Definition at line 1822 of file int_vector.hpp.
|
inline |
Set the bits from position idx to idx+len-1 to the binary representation of integer x.
The bit at position idx represents the least significant bit(lsb), and the bit at position idx+len-1 the most significant bit (msb) of x.
idx | Starting index of the binary representation of x. |
x | The integer to store in the int_vector. |
len | The length used to store x in the int_vector. Default value is 64. |
Definition at line 1554 of file int_vector.hpp.
|
inline |
Free unused allocated memory.
Definition at line 530 of file int_vector.hpp.
|
inlinenoexcept |
The number of elements in the int_vector.
Definition at line 1567 of file int_vector.hpp.
|
inlinenoexcept |
Definition at line 1574 of file int_vector.hpp.
|
inlinenoexcept |
Definition at line 1581 of file int_vector.hpp.
|
inlinenoexcept |
Definition at line 1588 of file int_vector.hpp.
|
inlinenoexcept |
Definition at line 1595 of file int_vector.hpp.
|
inlinenoexcept |
Definition at line 1602 of file int_vector.hpp.
|
inlinenoexcept |
Swap method for int_vector.
Definition at line 527 of file int_vector.hpp.
|
inlinenoexcept |
Returns the width of the integers which are accessed via the [] operator.
Definition at line 619 of file int_vector.hpp.
|
inlinenoexcept |
Sets the width of the integers which are accessed via the [] operator, if t_width equals 0.
new_width | New width of the integers accessed via the [] operator. |
Definition at line 626 of file int_vector.hpp.
int_vector< t_width >::size_type sdsl::int_vector< t_width >::write_data | ( | std::ostream & | out | ) | const |
Definition at line 1804 of file int_vector.hpp.
|
inlinestatic |
Write the size and int_width of a int_vector.
Definition at line 830 of file int_vector.hpp.
Definition at line 287 of file int_vector.hpp.
Definition at line 281 of file int_vector.hpp.
Definition at line 283 of file int_vector.hpp.
Definition at line 285 of file int_vector.hpp.
|
friend |
Definition at line 272 of file int_vector.hpp.
|
friend |
Definition at line 272 of file int_vector.hpp.
|
friend |
Definition at line 272 of file int_vector.hpp.
|
friend |
Definition at line 279 of file int_vector.hpp.
|
friend |
Definition at line 272 of file int_vector.hpp.
|
friend |
Definition at line 288 of file int_vector.hpp.
|
friend |
Equality operator for an arbitrary container.
Note that this function is slow since it compares element by element and cannot compare the bit representations of the containers. Two containers are equal if
Definition at line 732 of file int_vector.hpp.
|
staticconstexpr |
Definition at line 289 of file int_vector.hpp.
float sdsl::int_vector< t_width >::growth_factor = 1.5 |
Growth factor for amortized constant time operations.
Definition at line 290 of file int_vector.hpp.
const raw_wrapper sdsl::int_vector< t_width >::raw = raw_wrapper(*this) |
Definition at line 861 of file int_vector.hpp.