![]() |
Google OR-Tools v9.14
a fast and portable software suite for combinatorial optimization
|
#include <base_types.h>
Public Types | |
using | iterator = CompressedStrongVectorIterator<EntryIndex, Index> |
using | const_iterator = CompressedStrongVectorIterator<EntryIndex, Index> |
using | value_type = Index |
Public Member Functions | |
CompressedStrongVector () | |
CompressedStrongVector (const util_intops::StrongVector< EntryIndex, Index > &strong_vector) | |
CompressedStrongVector (absl::Span< const Index > vec) | |
void | push_back (Index x) |
Appends an x to the vector in a compressed form. | |
const std::vector< uint8_t > & | byte_stream () const |
Returns a reference to the underlying byte stream. | |
size_t | size_in_bytes () const |
Returns the number of bytes needed to store the vector. | |
bool | empty () const |
void | Reserve (size_t n) |
Reserves space for n bytes. | |
iterator | begin () |
For range-for loops. | |
iterator | end () |
const_iterator | begin () const |
For const range-for loops. | |
const_iterator | end () const |
A compressed vector of strong indices (e.g. SubsetIndex, ElementIndex), with EntryIndex indicating the position in the vector (e.g. RowEntryIndex or ColumnEntryIndex). The vector is compressed in a variable-length encoding, where each element is encoded as a delta from the previous element. The vector is stored in a byte stream, which is addressed byte-by-byte, which is necessary to store variable-length integers. The variable-length encoding is little-endian base128 (LEB128) as used by protobufs. Since we only use non-negative integers, there is no need to encode the sign bit (so non-zigzag encoding or similar techniques).
Definition at line 103 of file base_types.h.
using operations_research::CompressedStrongVector< EntryIndex, Index >::const_iterator = CompressedStrongVectorIterator<EntryIndex, Index> |
Definition at line 106 of file base_types.h.
using operations_research::CompressedStrongVector< EntryIndex, Index >::iterator = CompressedStrongVectorIterator<EntryIndex, Index> |
Definition at line 105 of file base_types.h.
using operations_research::CompressedStrongVector< EntryIndex, Index >::value_type = Index |
Definition at line 107 of file base_types.h.
|
inlineexplicit |
Definition at line 109 of file base_types.h.
|
inlineexplicit |
Initializes the compressed vector from a strong vector.
Definition at line 115 of file base_types.h.
|
inlineexplicit |
Definition at line 123 of file base_types.h.
|
inline |
For range-for loops.
Definition at line 145 of file base_types.h.
|
inline |
For const range-for loops.
Definition at line 149 of file base_types.h.
|
inline |
Returns a reference to the underlying byte stream.
Definition at line 134 of file base_types.h.
|
inline |
Definition at line 139 of file base_types.h.
|
inline |
Definition at line 146 of file base_types.h.
|
inline |
Definition at line 150 of file base_types.h.
|
inline |
Appends an x to the vector in a compressed form.
Definition at line 131 of file base_types.h.
|
inline |
Reserves space for n bytes.
Definition at line 142 of file base_types.h.
|
inline |
Returns the number of bytes needed to store the vector.
Definition at line 137 of file base_types.h.