polars_compute::bitwise

Trait BitwiseKernel

Source
pub trait BitwiseKernel {
    type Scalar;

    // Required methods
    fn count_ones(&self) -> PrimitiveArray<u32>;
    fn count_zeros(&self) -> PrimitiveArray<u32>;
    fn leading_ones(&self) -> PrimitiveArray<u32>;
    fn leading_zeros(&self) -> PrimitiveArray<u32>;
    fn trailing_ones(&self) -> PrimitiveArray<u32>;
    fn trailing_zeros(&self) -> PrimitiveArray<u32>;
    fn reduce_and(&self) -> Option<Self::Scalar>;
    fn reduce_or(&self) -> Option<Self::Scalar>;
    fn reduce_xor(&self) -> Option<Self::Scalar>;
    fn bit_and(lhs: Self::Scalar, rhs: Self::Scalar) -> Self::Scalar;
    fn bit_or(lhs: Self::Scalar, rhs: Self::Scalar) -> Self::Scalar;
    fn bit_xor(lhs: Self::Scalar, rhs: Self::Scalar) -> Self::Scalar;
}

Required Associated Types§

Required Methods§

Source

fn count_ones(&self) -> PrimitiveArray<u32>

Source

fn count_zeros(&self) -> PrimitiveArray<u32>

Source

fn leading_ones(&self) -> PrimitiveArray<u32>

Source

fn leading_zeros(&self) -> PrimitiveArray<u32>

Source

fn trailing_ones(&self) -> PrimitiveArray<u32>

Source

fn trailing_zeros(&self) -> PrimitiveArray<u32>

Source

fn reduce_and(&self) -> Option<Self::Scalar>

Source

fn reduce_or(&self) -> Option<Self::Scalar>

Source

fn reduce_xor(&self) -> Option<Self::Scalar>

Source

fn bit_and(lhs: Self::Scalar, rhs: Self::Scalar) -> Self::Scalar

Source

fn bit_or(lhs: Self::Scalar, rhs: Self::Scalar) -> Self::Scalar

Source

fn bit_xor(lhs: Self::Scalar, rhs: Self::Scalar) -> Self::Scalar

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl BitwiseKernel for BooleanArray

Source§

type Scalar = bool

Source§

fn count_ones(&self) -> PrimitiveArray<u32>

Source§

fn count_zeros(&self) -> PrimitiveArray<u32>

Source§

fn leading_ones(&self) -> PrimitiveArray<u32>

Source§

fn leading_zeros(&self) -> PrimitiveArray<u32>

Source§

fn trailing_ones(&self) -> PrimitiveArray<u32>

Source§

fn trailing_zeros(&self) -> PrimitiveArray<u32>

Source§

fn reduce_and(&self) -> Option<Self::Scalar>

Source§

fn reduce_or(&self) -> Option<Self::Scalar>

Source§

fn reduce_xor(&self) -> Option<Self::Scalar>

Source§

fn bit_and(lhs: Self::Scalar, rhs: Self::Scalar) -> Self::Scalar

Source§

fn bit_or(lhs: Self::Scalar, rhs: Self::Scalar) -> Self::Scalar

Source§

fn bit_xor(lhs: Self::Scalar, rhs: Self::Scalar) -> Self::Scalar

Source§

impl BitwiseKernel for PrimitiveArray<f32>

Source§

type Scalar = f32

Source§

fn count_ones(&self) -> PrimitiveArray<u32>

Source§

fn count_zeros(&self) -> PrimitiveArray<u32>

Source§

fn leading_ones(&self) -> PrimitiveArray<u32>

Source§

fn leading_zeros(&self) -> PrimitiveArray<u32>

Source§

fn trailing_ones(&self) -> PrimitiveArray<u32>

Source§

fn trailing_zeros(&self) -> PrimitiveArray<u32>

Source§

fn reduce_and(&self) -> Option<Self::Scalar>

Source§

fn reduce_or(&self) -> Option<Self::Scalar>

Source§

fn reduce_xor(&self) -> Option<Self::Scalar>

Source§

fn bit_and(lhs: Self::Scalar, rhs: Self::Scalar) -> Self::Scalar

Source§

fn bit_or(lhs: Self::Scalar, rhs: Self::Scalar) -> Self::Scalar

Source§

fn bit_xor(lhs: Self::Scalar, rhs: Self::Scalar) -> Self::Scalar

Source§

impl BitwiseKernel for PrimitiveArray<f64>

Source§

type Scalar = f64

Source§

fn count_ones(&self) -> PrimitiveArray<u32>

Source§

fn count_zeros(&self) -> PrimitiveArray<u32>

Source§

fn leading_ones(&self) -> PrimitiveArray<u32>

Source§

fn leading_zeros(&self) -> PrimitiveArray<u32>

Source§

fn trailing_ones(&self) -> PrimitiveArray<u32>

Source§

fn trailing_zeros(&self) -> PrimitiveArray<u32>

Source§

fn reduce_and(&self) -> Option<Self::Scalar>

Source§

fn reduce_or(&self) -> Option<Self::Scalar>

Source§

fn reduce_xor(&self) -> Option<Self::Scalar>

Source§

fn bit_and(lhs: Self::Scalar, rhs: Self::Scalar) -> Self::Scalar

Source§

fn bit_or(lhs: Self::Scalar, rhs: Self::Scalar) -> Self::Scalar

Source§

fn bit_xor(lhs: Self::Scalar, rhs: Self::Scalar) -> Self::Scalar

Source§

impl BitwiseKernel for PrimitiveArray<i8>

Source§

type Scalar = i8

Source§

fn count_ones(&self) -> PrimitiveArray<u32>

Source§

fn count_zeros(&self) -> PrimitiveArray<u32>

Source§

fn leading_ones(&self) -> PrimitiveArray<u32>

Source§

fn leading_zeros(&self) -> PrimitiveArray<u32>

Source§

fn trailing_ones(&self) -> PrimitiveArray<u32>

Source§

fn trailing_zeros(&self) -> PrimitiveArray<u32>

Source§

fn reduce_and(&self) -> Option<Self::Scalar>

Source§

fn reduce_or(&self) -> Option<Self::Scalar>

Source§

fn reduce_xor(&self) -> Option<Self::Scalar>

Source§

fn bit_and(lhs: Self::Scalar, rhs: Self::Scalar) -> Self::Scalar

Source§

fn bit_or(lhs: Self::Scalar, rhs: Self::Scalar) -> Self::Scalar

Source§

fn bit_xor(lhs: Self::Scalar, rhs: Self::Scalar) -> Self::Scalar

Source§

impl BitwiseKernel for PrimitiveArray<i16>

Source§

type Scalar = i16

Source§

fn count_ones(&self) -> PrimitiveArray<u32>

Source§

fn count_zeros(&self) -> PrimitiveArray<u32>

Source§

fn leading_ones(&self) -> PrimitiveArray<u32>

Source§

fn leading_zeros(&self) -> PrimitiveArray<u32>

Source§

fn trailing_ones(&self) -> PrimitiveArray<u32>

Source§

fn trailing_zeros(&self) -> PrimitiveArray<u32>

Source§

fn reduce_and(&self) -> Option<Self::Scalar>

Source§

fn reduce_or(&self) -> Option<Self::Scalar>

Source§

fn reduce_xor(&self) -> Option<Self::Scalar>

Source§

fn bit_and(lhs: Self::Scalar, rhs: Self::Scalar) -> Self::Scalar

Source§

fn bit_or(lhs: Self::Scalar, rhs: Self::Scalar) -> Self::Scalar

Source§

fn bit_xor(lhs: Self::Scalar, rhs: Self::Scalar) -> Self::Scalar

Source§

impl BitwiseKernel for PrimitiveArray<i32>

Source§

type Scalar = i32

Source§

fn count_ones(&self) -> PrimitiveArray<u32>

Source§

fn count_zeros(&self) -> PrimitiveArray<u32>

Source§

fn leading_ones(&self) -> PrimitiveArray<u32>

Source§

fn leading_zeros(&self) -> PrimitiveArray<u32>

Source§

fn trailing_ones(&self) -> PrimitiveArray<u32>

Source§

fn trailing_zeros(&self) -> PrimitiveArray<u32>

Source§

fn reduce_and(&self) -> Option<Self::Scalar>

Source§

fn reduce_or(&self) -> Option<Self::Scalar>

Source§

fn reduce_xor(&self) -> Option<Self::Scalar>

Source§

fn bit_and(lhs: Self::Scalar, rhs: Self::Scalar) -> Self::Scalar

Source§

fn bit_or(lhs: Self::Scalar, rhs: Self::Scalar) -> Self::Scalar

Source§

fn bit_xor(lhs: Self::Scalar, rhs: Self::Scalar) -> Self::Scalar

Source§

impl BitwiseKernel for PrimitiveArray<i64>

Source§

type Scalar = i64

Source§

fn count_ones(&self) -> PrimitiveArray<u32>

Source§

fn count_zeros(&self) -> PrimitiveArray<u32>

Source§

fn leading_ones(&self) -> PrimitiveArray<u32>

Source§

fn leading_zeros(&self) -> PrimitiveArray<u32>

Source§

fn trailing_ones(&self) -> PrimitiveArray<u32>

Source§

fn trailing_zeros(&self) -> PrimitiveArray<u32>

Source§

fn reduce_and(&self) -> Option<Self::Scalar>

Source§

fn reduce_or(&self) -> Option<Self::Scalar>

Source§

fn reduce_xor(&self) -> Option<Self::Scalar>

Source§

fn bit_and(lhs: Self::Scalar, rhs: Self::Scalar) -> Self::Scalar

Source§

fn bit_or(lhs: Self::Scalar, rhs: Self::Scalar) -> Self::Scalar

Source§

fn bit_xor(lhs: Self::Scalar, rhs: Self::Scalar) -> Self::Scalar

Source§

impl BitwiseKernel for PrimitiveArray<u8>

Source§

type Scalar = u8

Source§

fn count_ones(&self) -> PrimitiveArray<u32>

Source§

fn count_zeros(&self) -> PrimitiveArray<u32>

Source§

fn leading_ones(&self) -> PrimitiveArray<u32>

Source§

fn leading_zeros(&self) -> PrimitiveArray<u32>

Source§

fn trailing_ones(&self) -> PrimitiveArray<u32>

Source§

fn trailing_zeros(&self) -> PrimitiveArray<u32>

Source§

fn reduce_and(&self) -> Option<Self::Scalar>

Source§

fn reduce_or(&self) -> Option<Self::Scalar>

Source§

fn reduce_xor(&self) -> Option<Self::Scalar>

Source§

fn bit_and(lhs: Self::Scalar, rhs: Self::Scalar) -> Self::Scalar

Source§

fn bit_or(lhs: Self::Scalar, rhs: Self::Scalar) -> Self::Scalar

Source§

fn bit_xor(lhs: Self::Scalar, rhs: Self::Scalar) -> Self::Scalar

Source§

impl BitwiseKernel for PrimitiveArray<u16>

Source§

type Scalar = u16

Source§

fn count_ones(&self) -> PrimitiveArray<u32>

Source§

fn count_zeros(&self) -> PrimitiveArray<u32>

Source§

fn leading_ones(&self) -> PrimitiveArray<u32>

Source§

fn leading_zeros(&self) -> PrimitiveArray<u32>

Source§

fn trailing_ones(&self) -> PrimitiveArray<u32>

Source§

fn trailing_zeros(&self) -> PrimitiveArray<u32>

Source§

fn reduce_and(&self) -> Option<Self::Scalar>

Source§

fn reduce_or(&self) -> Option<Self::Scalar>

Source§

fn reduce_xor(&self) -> Option<Self::Scalar>

Source§

fn bit_and(lhs: Self::Scalar, rhs: Self::Scalar) -> Self::Scalar

Source§

fn bit_or(lhs: Self::Scalar, rhs: Self::Scalar) -> Self::Scalar

Source§

fn bit_xor(lhs: Self::Scalar, rhs: Self::Scalar) -> Self::Scalar

Source§

impl BitwiseKernel for PrimitiveArray<u32>

Source§

type Scalar = u32

Source§

fn count_ones(&self) -> PrimitiveArray<u32>

Source§

fn count_zeros(&self) -> PrimitiveArray<u32>

Source§

fn leading_ones(&self) -> PrimitiveArray<u32>

Source§

fn leading_zeros(&self) -> PrimitiveArray<u32>

Source§

fn trailing_ones(&self) -> PrimitiveArray<u32>

Source§

fn trailing_zeros(&self) -> PrimitiveArray<u32>

Source§

fn reduce_and(&self) -> Option<Self::Scalar>

Source§

fn reduce_or(&self) -> Option<Self::Scalar>

Source§

fn reduce_xor(&self) -> Option<Self::Scalar>

Source§

fn bit_and(lhs: Self::Scalar, rhs: Self::Scalar) -> Self::Scalar

Source§

fn bit_or(lhs: Self::Scalar, rhs: Self::Scalar) -> Self::Scalar

Source§

fn bit_xor(lhs: Self::Scalar, rhs: Self::Scalar) -> Self::Scalar

Source§

impl BitwiseKernel for PrimitiveArray<u64>

Source§

type Scalar = u64

Source§

fn count_ones(&self) -> PrimitiveArray<u32>

Source§

fn count_zeros(&self) -> PrimitiveArray<u32>

Source§

fn leading_ones(&self) -> PrimitiveArray<u32>

Source§

fn leading_zeros(&self) -> PrimitiveArray<u32>

Source§

fn trailing_ones(&self) -> PrimitiveArray<u32>

Source§

fn trailing_zeros(&self) -> PrimitiveArray<u32>

Source§

fn reduce_and(&self) -> Option<Self::Scalar>

Source§

fn reduce_or(&self) -> Option<Self::Scalar>

Source§

fn reduce_xor(&self) -> Option<Self::Scalar>

Source§

fn bit_and(lhs: Self::Scalar, rhs: Self::Scalar) -> Self::Scalar

Source§

fn bit_or(lhs: Self::Scalar, rhs: Self::Scalar) -> Self::Scalar

Source§

fn bit_xor(lhs: Self::Scalar, rhs: Self::Scalar) -> Self::Scalar

Implementors§