A compressed array of integers that allows appending additional data.
More...
#include "nn/nlib/succinct/Sbv.h"
A compressed array of integers that allows appending additional data.
- Description
- The integer array is divided into blocks of 64 elements, and records the black's average value, and the 64 elements as the offset from the average value. The offset value is stored after being fit to a set bit width for each block. Values may be randomly accessed by a simple calculation of adding the average value and the offset.
- This simple method allows for high compressions rates with data containing a high ratio of smaller values, usually becoming one-half to one-quarter the size of directly storing the values in an array.
Definition at line 198 of file Sbv.h.
◆ Export()
nn::nlib::succinct::CompressedArray::Export |
( |
BinaryWriter * |
w | ) |
const |
|
noexcept |
Writes the object to the file.
- Parameters
-
- Returns
- Returns
true
when successful.
- Description
- The written data can be read and restored using the
Import
function. The data is always written little endian.
◆ Import()
nn::nlib::succinct::CompressedArray::Import |
( |
BinaryReader * |
r | ) |
|
|
noexcept |
Reads the written object.
- Parameters
-
- Returns
- Returns
true
when import is successful.
◆ MemSize()
nn::nlib::succinct::CompressedArray::MemSize |
( |
| ) |
const |
|
noexcept |
Returns the amount of memory explicitly allocated by the class.
- Returns
- Returns the number of bytes.
- Description
- The actual amount of memory allocated by the system may be larger than the value returned by this function because of alignment and space for heap management.
◆ operator[]()
nn::nlib::succinct::CompressedArray::operator[] |
( |
size_t |
idx | ) |
const |
|
noexcept |
Specifies an index and extracts the value.
- Parameters
-
- Returns
- Returns the value of the array. Returns
0
when idx is out of bounds.
◆ PushBack()
nn::nlib::succinct::CompressedArray::PushBack |
( |
uint32_t |
x | ) |
|
|
inlinenoexcept |
Adds data. Compresses data after it becomes 64 elements long.
- Parameters
-
- Returns
- Returns
true
when successful.
Definition at line 213 of file Sbv.h.
◆ swap()
Swaps the contents of an object.
- Deprecated:
- This function will be deleted in a future release.
The documentation for this class was generated from the following files: