Return the byte offset of the full-precision vector for node `idx`. This is the offset to pass to an io_uring `IORING_OP_READ` or `pread` call to fetch `dim * 4` bytes of FP32 data for the given node. # Example ``` use nodedb_vector::vamana::storage::{VamanaStorageLayout, vector_offset}; let layout = VamanaStorageLayout::new(4, 64, 1.2, 100, 0); let off = vector_offset(&layout, 5); // adjacenc
(layout: &VamanaStorageLayout, idx: u64)
| 118 | /// assert_eq!(off, 25744); |
| 119 | /// ``` |
| 120 | pub fn vector_offset(layout: &VamanaStorageLayout, idx: u64) -> u64 { |
| 121 | layout.vectors_offset + idx * layout.dim as u64 * 4 |
| 122 | } |
| 123 | |
| 124 | #[cfg(test)] |
| 125 | mod tests { |
no outgoing calls
no test coverage detected