gtopt::CompressedBuffer struct

Compressed buffer with metadata for round-trip compression.

Public functions

auto decompress_data() const -> std::vector<char>
Decompress and return the original data.
auto empty() const -> bool noexcept

Public variables

CompressionCodec codec
std::vector<char> data
size_t flp_col_scales_size
size_t flp_colint_count
size_t flp_nnz
matbeg[ncols] — total non-zeros
size_t flp_row_scales_size
size_t original_size
std::shared_ptr<const CompressedBuffer> xor_base

Variable documentation

size_t gtopt::CompressedBuffer::flp_col_scales_size

col_scales / row_scales actual sizes at compress time. May be 0 (empty) when --no-scale forces equilibration=none and no per-column/row scaling is in effect — under those conditions flatten() leaves the col_scales/row_scales vectors empty and compress_flat_lp appends 0 bytes for them. Decompress must not unconditionally resize to ncols/nrows and memcpy ncols/nrows × sizeof(double) bytes — that would overread (segfault). Storing the actual compress-time sizes here keeps decompress byte-symmetric with compress.

size_t gtopt::CompressedBuffer::flp_colint_count

colint.size() — integer variable count

size_t gtopt::CompressedBuffer::flp_nnz

matbeg[ncols] — total non-zeros

FLP-specific layout metadata, populated by compress_flat_lp so that decompress_flat_lp can pre-reserve all 11 numeric vectors upfront without byte-arithmetic inference. Zero for non-FLP buffers.

std::shared_ptr<const CompressedBuffer> gtopt::CompressedBuffer::xor_base

Cross-cell dedup (see FlatLpDedupRegistry). When non-null, this buffer stores only the byte-wise XOR of its raw bytes against the raw bytes of xor_base (a plain, same-size buffer shared by every cell of the same phase): data is the compressed XOR, or EMPTY when the two are byte-identical. Restoring XORs the decompressed base back in, so the round trip is bit-exact by construction.