()
| 153 | use super::*; |
| 154 | |
| 155 | fn make_codec() -> PqCodec { |
| 156 | let vecs: Vec<Vec<f32>> = (0..80) |
| 157 | .map(|i| { |
| 158 | let c = (i / 20) as f32 * 5.0; |
| 159 | vec![ |
| 160 | c + (i as f32) * 0.1, |
| 161 | c - (i as f32) * 0.05, |
| 162 | c + 1.0, |
| 163 | c - 1.0, |
| 164 | ] |
| 165 | }) |
| 166 | .collect(); |
| 167 | let refs: Vec<&[f32]> = vecs.iter().map(|v| v.as_slice()).collect(); |
| 168 | PqCodec::train(&refs, 4, 2, 8, 10) |
| 169 | } |
| 170 | |
| 171 | /// `encode` round-trip: packed_bits in the UQV must match the raw |
| 172 | /// `PqCodec::encode` output. |