mod access;
mod build;
mod candidate;
mod metric;
mod routing;
use crate::config::DistanceMetric;
use crate::simd::DistanceKernel;
pub(crate) use candidate::{Candidate, RoutingCandidate, splitmix64};
pub(crate) use metric::{distance, inverse_norm, squared_norm};
pub(crate) use routing::routing_probes_from_signs;
pub(crate) const ROUTING_BITS: usize = 14;
pub(crate) const ROUTING_PROBES: usize = 5;
pub(crate) const MAX_ROUTING_PROBES: usize = 1
+ ROUTING_BITS
+ (ROUTING_BITS * (ROUTING_BITS - 1)) / 2
+ (ROUTING_BITS * (ROUTING_BITS - 1) * (ROUTING_BITS - 2)) / 6;
#[derive(Debug)]
pub(crate) struct VectorStore {
pub(super) dimensions: usize,
pub(super) metric: DistanceMetric,
pub(super) keys: Vec<u64>,
pub(super) values: Vec<f32>,
pub(super) squared_norms: Vec<f32>,
pub(super) routing_signs: Vec<u16>,
pub(super) distance_kernel: DistanceKernel,
}