vortex_array/arrays/bool/compute/
invert.rs1use std::ops::Not;
2
3use vortex_error::VortexResult;
4
5use crate::arrays::{BoolArray, BoolEncoding};
6use crate::compute::{InvertKernel, InvertKernelAdapter};
7use crate::{Array, ArrayRef, register_kernel};
8
9impl InvertKernel for BoolEncoding {
10 fn invert(&self, array: &BoolArray) -> VortexResult<ArrayRef> {
11 Ok(BoolArray::new(array.boolean_buffer().not(), array.validity().clone()).into_array())
12 }
13}
14
15register_kernel!(InvertKernelAdapter(BoolEncoding).lift());