Skip to main content

StaticSearchStorage

Enum StaticSearchStorage 

Source
enum StaticSearchStorage {
    Direct(DirectStaticSearch),
    U16(StaticSearchTree<u16, 32>),
    U32(StaticSearchTree<u32, 16>),
    U64(StaticSearchTree<u64, 8>),
    U128(StaticSearchTree<u128, 4>),
}

Variants§

Implementations§

Source§

impl StaticSearchStorage

Source

fn lower_bound(&self, value: u128) -> usize

Examples found in repository?
crates/competitive/src/data_structure/static_search.rs (line 845)
844    pub fn lower_bound(&self, value: K) -> usize {
845        self.storage.lower_bound(value.encode())
846    }
847
848    /// Returns one past the last index whose value is less than or equal to `value`.
849    #[inline]
850    pub fn upper_bound(&self, value: K) -> usize {
851        self.storage.upper_bound(value.encode())
852    }
853
854    /// Writes the first index greater than or equal to each value into `output`.
855    ///
856    /// # Panics
857    ///
858    /// Panics if `values` and `output` have different lengths.
859    pub fn lower_bound_batch(&self, values: &[K], output: &mut [usize]) {
860        assert_eq!(values.len(), output.len());
861        self.storage.lower_bound_batch(values, output);
862    }
863
864    /// Writes one past the last index less than or equal to each value into `output`.
865    ///
866    /// # Panics
867    ///
868    /// Panics if `values` and `output` have different lengths.
869    pub fn upper_bound_batch(&self, values: &[K], output: &mut [usize]) {
870        assert_eq!(values.len(), output.len());
871        self.storage.upper_bound_batch(values, output);
872    }
873
874    #[inline]
875    pub fn range(&self, value: K) -> Range<usize> {
876        let value = value.encode();
877        self.storage.lower_bound(value)..self.storage.upper_bound(value)
878    }
Source

fn upper_bound(&self, value: u128) -> usize

Examples found in repository?
crates/competitive/src/data_structure/static_search.rs (line 851)
850    pub fn upper_bound(&self, value: K) -> usize {
851        self.storage.upper_bound(value.encode())
852    }
853
854    /// Writes the first index greater than or equal to each value into `output`.
855    ///
856    /// # Panics
857    ///
858    /// Panics if `values` and `output` have different lengths.
859    pub fn lower_bound_batch(&self, values: &[K], output: &mut [usize]) {
860        assert_eq!(values.len(), output.len());
861        self.storage.lower_bound_batch(values, output);
862    }
863
864    /// Writes one past the last index less than or equal to each value into `output`.
865    ///
866    /// # Panics
867    ///
868    /// Panics if `values` and `output` have different lengths.
869    pub fn upper_bound_batch(&self, values: &[K], output: &mut [usize]) {
870        assert_eq!(values.len(), output.len());
871        self.storage.upper_bound_batch(values, output);
872    }
873
874    #[inline]
875    pub fn range(&self, value: K) -> Range<usize> {
876        let value = value.encode();
877        self.storage.lower_bound(value)..self.storage.upper_bound(value)
878    }
Source

fn contains(&self, value: u128) -> bool

Examples found in repository?
crates/competitive/src/data_structure/static_search.rs (line 882)
881    pub fn contains(&self, value: K) -> bool {
882        self.storage.contains(value.encode())
883    }
Source

fn lower_bound_batch<K: SimdKey>(&self, values: &[K], output: &mut [usize])

Examples found in repository?
crates/competitive/src/data_structure/static_search.rs (line 861)
859    pub fn lower_bound_batch(&self, values: &[K], output: &mut [usize]) {
860        assert_eq!(values.len(), output.len());
861        self.storage.lower_bound_batch(values, output);
862    }
Source

fn upper_bound_batch<K: SimdKey>(&self, values: &[K], output: &mut [usize])

Examples found in repository?
crates/competitive/src/data_structure/static_search.rs (line 871)
869    pub fn upper_bound_batch(&self, values: &[K], output: &mut [usize]) {
870        assert_eq!(values.len(), output.len());
871        self.storage.upper_bound_batch(values, output);
872    }

Trait Implementations§

Source§

impl Clone for StaticSearchStorage

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for StaticSearchStorage

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToArrayVecScalar for T

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.