pub trait SearchSortedFn<A: Copy> {
// Required method
fn search_sorted(
&self,
array: A,
value: &Scalar,
side: SearchSortedSide,
) -> VortexResult<SearchResult>;
// Provided method
fn search_sorted_many(
&self,
array: A,
values: &[Scalar],
side: SearchSortedSide,
) -> VortexResult<Vec<SearchResult>> { ... }
}Expand description
Searches for value assuming the array is sorted.
Returned indices satisfy following condition if the search for value was to be inserted into the array at found positions
| side | result satisfies |
|---|---|
| left | array[i-1] < value <= array[i] |
| right | array[i-1] <= value < array[i] |
Required Methods§
fn search_sorted( &self, array: A, value: &Scalar, side: SearchSortedSide, ) -> VortexResult<SearchResult>
Provided Methods§
Sourcefn search_sorted_many(
&self,
array: A,
values: &[Scalar],
side: SearchSortedSide,
) -> VortexResult<Vec<SearchResult>>
fn search_sorted_many( &self, array: A, values: &[Scalar], side: SearchSortedSide, ) -> VortexResult<Vec<SearchResult>>
Bulk search for many values.