vortex_runend/compute/
is_sorted.rs

1// SPDX-License-Identifier: Apache-2.0
2// SPDX-FileCopyrightText: Copyright the Vortex contributors
3
4use vortex_array::compute::{IsSortedKernel, IsSortedKernelAdapter, is_sorted, is_strict_sorted};
5use vortex_array::register_kernel;
6use vortex_error::VortexResult;
7
8use crate::{RunEndArray, RunEndVTable};
9
10impl IsSortedKernel for RunEndVTable {
11    fn is_sorted(&self, array: &RunEndArray) -> VortexResult<Option<bool>> {
12        is_sorted(array.values())
13    }
14
15    fn is_strict_sorted(&self, array: &RunEndArray) -> VortexResult<Option<bool>> {
16        is_strict_sorted(array.to_canonical().as_ref())
17    }
18}
19
20register_kernel!(IsSortedKernelAdapter(RunEndVTable).lift());