Trait SearchSortedFn

Source
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

sideresult satisfies
leftarray[i-1] < value <= array[i]
rightarray[i-1] <= value < array[i]

Required Methods§

Source

fn search_sorted( &self, array: A, value: &Scalar, side: SearchSortedSide, ) -> VortexResult<SearchResult>

Provided Methods§

Source

fn search_sorted_many( &self, array: A, values: &[Scalar], side: SearchSortedSide, ) -> VortexResult<Vec<SearchResult>>

Bulk search for many values.

Implementors§