1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
//! # PGM-Index: Ultra-Fast Learned Index
//! PGM 索引:超快的学习型索引
//!
//! Piecewise Geometric Model (PGM) Index for fast lookups in sorted arrays.
//! 分段几何模型(PGM)索引,用于在已排序数组中快速查找。
//!
//! ## Usage / 使用方法
//!
//! ```rust
//! use jdb_pgm::PGMIndex;
//!
//! let data: Vec<u64> = (0..1_000_000).collect();
//! let pgm = PGMIndex::load(data, 32, true).unwrap();
//! assert_eq!(pgm.get(123_456), Some(123_456));
//! ```
pub use ;
pub use ;
pub use PGMIndex;
/// Convert key bytes to u64 prefix (big-endian, pad with 0).
/// 将键字节转换为 u64 前缀(大端序,不足补0)。
/// Useful for converting strings/bytes to keys compatible with PGM.