Skip to main content

static_search_backend

Function static_search_backend 

Source
fn static_search_backend(bits: u32) -> SimdBackend
Examples found in repository?
crates/competitive/src/data_structure/static_search.rs (line 816)
815    pub fn from_sorted(values: &[K]) -> Self {
816        Self::build(values, static_search_backend(K::BITS), false)
817    }
818
819    /// Builds a direct lookup table over sorted 8-bit or 16-bit `values`.
820    ///
821    /// This layout uses a fixed table of 257 or 65,537 positions and is intended
822    /// for query-heavy workloads.
823    ///
824    /// # Panics
825    ///
826    /// Panics if `K::BITS` is neither 8 nor 16, or if `values` is not sorted.
827    pub fn from_sorted_direct(values: &[K]) -> Self {
828        assert!(matches!(K::BITS, 8 | 16));
829        Self::build(values, static_search_backend(K::BITS), true)
830    }