enum StaticSearchStorage {
Direct(DirectStaticSearch),
U16(StaticSearchTree<u16, 32>),
U32(StaticSearchTree<u32, 16>),
U64(StaticSearchTree<u64, 8>),
U128(StaticSearchTree<u128, 4>),
}Variants§
Direct(DirectStaticSearch)
U16(StaticSearchTree<u16, 32>)
U32(StaticSearchTree<u32, 16>)
U64(StaticSearchTree<u64, 8>)
U128(StaticSearchTree<u128, 4>)
Implementations§
Source§impl StaticSearchStorage
impl StaticSearchStorage
Sourcefn lower_bound(&self, value: u128) -> usize
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 }Sourcefn upper_bound(&self, value: u128) -> usize
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 }Sourcefn lower_bound_batch<K: SimdKey>(&self, values: &[K], output: &mut [usize])
fn lower_bound_batch<K: SimdKey>(&self, values: &[K], output: &mut [usize])
Sourcefn upper_bound_batch<K: SimdKey>(&self, values: &[K], output: &mut [usize])
fn upper_bound_batch<K: SimdKey>(&self, values: &[K], output: &mut [usize])
Trait Implementations§
Source§impl Clone for StaticSearchStorage
impl Clone for StaticSearchStorage
Auto Trait Implementations§
impl Freeze for StaticSearchStorage
impl RefUnwindSafe for StaticSearchStorage
impl Send for StaticSearchStorage
impl Sync for StaticSearchStorage
impl Unpin for StaticSearchStorage
impl UnsafeUnpin for StaticSearchStorage
impl UnwindSafe for StaticSearchStorage
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more