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;
6
7use crate::{RunEndArray, RunEndVTable};
8
9impl IsSortedKernel for RunEndVTable {
10    fn is_sorted(&self, array: &RunEndArray) -> vortex_error::VortexResult<bool> {
11        is_sorted(array.values())
12    }
13
14    fn is_strict_sorted(&self, array: &RunEndArray) -> vortex_error::VortexResult<bool> {
15        is_strict_sorted(array.to_canonical()?.as_ref())
16    }
17}
18
19register_kernel!(IsSortedKernelAdapter(RunEndVTable).lift());