Skip to main content

Crate fastalp

Crate fastalp 

Source

Re-exports§

pub use header::ChunkType;
pub use header::MAX_HEADER_LEN;
pub use header::ParsedHeader;
pub use header::read_count;
pub use header::read_header;
pub use capi::*;capi

Modules§

bitpack
capicapi
header

Macros§

arr_8
Constructs an 8-element array by applying an expression to index 0..8. 通过对索引 0..8 分别求值构造 8 元素数组(完全内联,消除手动 +1, +2, +3)
match_pack_23
Dispatches bit-width 1..=20, 24, 28, 32 to monomorphized chunk packing function. 统一分发 1..=20, 24, 28, 32 位宽至单态化 8 元素块打包内核
unroll_8
Unrolls a block 8 times with $idx bound to 0..8. 将逻辑按索引 0..8 重复展开 8 次顺序执行
write_4
Writes 4 evaluated elements to consecutive raw pointer memory *($dst).add(k) = expr(k). 向连续裸指针内存顺序写入 4 个计算结果(局部绑定 base 指针)
write_8
Writes 8 evaluated elements to consecutive raw pointer memory *($dst).add(k) = expr(k). 向连续裸指针内存顺序写入 8 个计算结果(局部绑定 base 指针,杜绝表达式重复求值)

Structs§

AlpParams
Compact ALP encoding and decoding parameters. 封装 ALP 核心参数 (exp, fac, bit_width, use_div),消除多参数冗余传递并统一头部打包与类型判断
BestParams
Optimal parameters discovered by sampling 采样与最优系数选择结果
Encoder
Stateful encoder that caches optimal parameters and scratch buffers across adjacent chunks. 状态化编码器:在连续数据块编码时复用已探测的最优参数与内部工作缓冲区,消除重复采样开销与内存分配。

Enums§

Error

Constants§

CHUNK_SIZE
Standard chunk size for typical ALP blocks. 典型 ALP 标准块大小 (1024)
CHUNK_SIZE_1024

Traits§

AlpFloat
ALP floating-point abstraction trait (unifies zero-cost f32 and f64 compression). ALP 浮点数抽象特征(统一 f32 与 f64 零成本编解码)

Functions§

compress
Generic floating-point slice compression. 通用压缩浮点数切片
compress_delta
Generic floating-point slice compression enforcing Delta differential mode. 强制使用 Delta 差分模式压缩浮点数切片
compress_delta_into
Floating-point compression with enforced Delta differential encoding. 强制使用 Delta 一阶差分模式压缩浮点数组并直接写入 dst 缓冲区
compress_into
Generic floating-point compression writing directly into dst buffer. 通用压缩浮点数组并直接写入 dst 缓冲区(自适应选择 FOR 或 Delta 差分模式)
count
Reads the element count from the compressed data header in O(1) time without decompressing the payload.
decompress
Generic floating-point slice decompression. 通用解压浮点数切片
decompress_into
Generic floating-point decompression into dst buffer. 通用解压浮点数组至 dst 缓冲区(自动分发 RAW、标准 FOR 与 Delta 差分块)
decompress_into_raw
Generic floating-point decompression directly into raw pointer memory. 通用解压浮点数组至裸指针内存(零堆分配、零内存拷贝,避免未初始化切片构造)
decompress_into_slice
Generic floating-point decompression into destination slice. 通用解压浮点数组至目标切片(零堆分配、零内存拷贝)
max_compressed_size
Computes the maximum possible compressed buffer size in bytes for count values of type F. Guaranteed to never overflow even in the worst-case uncompressible fallback.

Type Aliases§

Result