(&self, table: &[Vec<f32>], code: &[u8])
| 178 | /// O(M) per candidate — just M table lookups and additions. |
| 179 | #[inline] |
| 180 | pub fn asymmetric_distance(&self, table: &[Vec<f32>], code: &[u8]) -> f32 { |
| 181 | debug_assert_eq!(code.len(), self.m); |
| 182 | let mut dist = 0.0f32; |
| 183 | for (sub, &c) in code.iter().enumerate() { |
| 184 | dist += table[sub][c as usize]; |
| 185 | } |
| 186 | dist |
| 187 | } |
| 188 | |
| 189 | /// Decode a PQ code back to an approximate FP32 vector. |
| 190 | /// |