[][src]Trait polars::datatypes::PolarsNumericType

pub trait PolarsNumericType: ArrowNumericType where
    Self::Simd: Add<Output = Self::Simd> + Sub<Output = Self::Simd> + Mul<Output = Self::Simd> + Div<Output = Self::Simd> + Copy
{ type Simd; type SimdMask; fn lanes() -> usize;
fn init(value: Self::Native) -> Self::Simd;
fn load(slice: &[Self::Native]) -> Self::Simd;
fn mask_init(value: bool) -> Self::SimdMask;
fn mask_get(mask: &Self::SimdMask, idx: usize) -> bool;
fn bitmask<T>(mask: &Self::SimdMask, action: T)
    where
        T: FnMut(&[u8])
;
fn mask_set(mask: Self::SimdMask, idx: usize, value: bool) -> Self::SimdMask;
fn mask_select(
        mask: Self::SimdMask,
        a: Self::Simd,
        b: Self::Simd
    ) -> Self::Simd;
fn mask_any(mask: Self::SimdMask) -> bool;
fn bin_op<F: Fn(Self::Simd, Self::Simd) -> Self::Simd>(
        left: Self::Simd,
        right: Self::Simd,
        op: F
    ) -> Self::Simd;
fn eq(left: Self::Simd, right: Self::Simd) -> Self::SimdMask;
fn ne(left: Self::Simd, right: Self::Simd) -> Self::SimdMask;
fn lt(left: Self::Simd, right: Self::Simd) -> Self::SimdMask;
fn le(left: Self::Simd, right: Self::Simd) -> Self::SimdMask;
fn gt(left: Self::Simd, right: Self::Simd) -> Self::SimdMask;
fn ge(left: Self::Simd, right: Self::Simd) -> Self::SimdMask;
fn write(simd_result: Self::Simd, slice: &mut [Self::Native]); }

Associated Types

type Simd

Defines the SIMD type that should be used for this numeric type

type SimdMask

Defines the SIMD Mask type that should be used for this numeric type

Loading content...

Required methods

fn lanes() -> usize

The number of SIMD lanes available

fn init(value: Self::Native) -> Self::Simd

Initializes a SIMD register to a constant value

fn load(slice: &[Self::Native]) -> Self::Simd

Loads a slice into a SIMD register

fn mask_init(value: bool) -> Self::SimdMask

Creates a new SIMD mask for this SIMD type filling it with value

fn mask_get(mask: &Self::SimdMask, idx: usize) -> bool

Gets the value of a single lane in a SIMD mask

fn bitmask<T>(mask: &Self::SimdMask, action: T) where
    T: FnMut(&[u8]), 

Gets the bitmask for a SimdMask as a byte slice and passes it to the closure used as the action parameter

fn mask_set(mask: Self::SimdMask, idx: usize, value: bool) -> Self::SimdMask

Sets the value of a single lane of a SIMD mask

fn mask_select(mask: Self::SimdMask, a: Self::Simd, b: Self::Simd) -> Self::Simd

Selects elements of a and b using mask

fn mask_any(mask: Self::SimdMask) -> bool

Returns true if any of the lanes in the mask are true

fn bin_op<F: Fn(Self::Simd, Self::Simd) -> Self::Simd>(
    left: Self::Simd,
    right: Self::Simd,
    op: F
) -> Self::Simd

Performs a SIMD binary operation

fn eq(left: Self::Simd, right: Self::Simd) -> Self::SimdMask

SIMD version of equal

fn ne(left: Self::Simd, right: Self::Simd) -> Self::SimdMask

SIMD version of not equal

fn lt(left: Self::Simd, right: Self::Simd) -> Self::SimdMask

SIMD version of less than

fn le(left: Self::Simd, right: Self::Simd) -> Self::SimdMask

SIMD version of less than or equal to

fn gt(left: Self::Simd, right: Self::Simd) -> Self::SimdMask

SIMD version of greater than

fn ge(left: Self::Simd, right: Self::Simd) -> Self::SimdMask

SIMD version of greater than or equal to

fn write(simd_result: Self::Simd, slice: &mut [Self::Native])

Writes a SIMD result back to a slice

Loading content...

Implementors

impl PolarsNumericType for Date32Type[src]

type Simd = i32x16

type SimdMask = m32x16

fn mask_select(mask: Self::SimdMask, a: Self::Simd, b: Self::Simd) -> Self::Simd[src]

Selects elements of a and b using mask

impl PolarsNumericType for Date64Type[src]

type Simd = i64x8

type SimdMask = m64x8

fn mask_select(mask: Self::SimdMask, a: Self::Simd, b: Self::Simd) -> Self::Simd[src]

Selects elements of a and b using mask

impl PolarsNumericType for DurationMicrosecondType[src]

type Simd = i64x8

type SimdMask = m64x8

fn mask_select(mask: Self::SimdMask, a: Self::Simd, b: Self::Simd) -> Self::Simd[src]

Selects elements of a and b using mask

impl PolarsNumericType for DurationMillisecondType[src]

type Simd = i64x8

type SimdMask = m64x8

fn mask_select(mask: Self::SimdMask, a: Self::Simd, b: Self::Simd) -> Self::Simd[src]

Selects elements of a and b using mask

impl PolarsNumericType for DurationNanosecondType[src]

type Simd = i64x8

type SimdMask = m64x8

fn mask_select(mask: Self::SimdMask, a: Self::Simd, b: Self::Simd) -> Self::Simd[src]

Selects elements of a and b using mask

impl PolarsNumericType for DurationSecondType[src]

type Simd = i64x8

type SimdMask = m64x8

fn mask_select(mask: Self::SimdMask, a: Self::Simd, b: Self::Simd) -> Self::Simd[src]

Selects elements of a and b using mask

impl PolarsNumericType for Float32Type[src]

type Simd = f32x16

type SimdMask = m32x16

fn mask_select(mask: Self::SimdMask, a: Self::Simd, b: Self::Simd) -> Self::Simd[src]

Selects elements of a and b using mask

impl PolarsNumericType for Float64Type[src]

type Simd = f64x8

type SimdMask = m64x8

fn mask_select(mask: Self::SimdMask, a: Self::Simd, b: Self::Simd) -> Self::Simd[src]

Selects elements of a and b using mask

impl PolarsNumericType for Int8Type[src]

type Simd = i8x64

type SimdMask = m8x64

fn mask_select(mask: Self::SimdMask, a: Self::Simd, b: Self::Simd) -> Self::Simd[src]

Selects elements of a and b using mask

impl PolarsNumericType for Int16Type[src]

type Simd = i16x32

type SimdMask = m16x32

fn mask_select(mask: Self::SimdMask, a: Self::Simd, b: Self::Simd) -> Self::Simd[src]

Selects elements of a and b using mask

impl PolarsNumericType for Int32Type[src]

type Simd = i32x16

type SimdMask = m32x16

fn mask_select(mask: Self::SimdMask, a: Self::Simd, b: Self::Simd) -> Self::Simd[src]

Selects elements of a and b using mask

impl PolarsNumericType for Int64Type[src]

type Simd = i64x8

type SimdMask = m64x8

fn mask_select(mask: Self::SimdMask, a: Self::Simd, b: Self::Simd) -> Self::Simd[src]

Selects elements of a and b using mask

impl PolarsNumericType for IntervalDayTimeType[src]

type Simd = i64x8

type SimdMask = m64x8

fn mask_select(mask: Self::SimdMask, a: Self::Simd, b: Self::Simd) -> Self::Simd[src]

Selects elements of a and b using mask

impl PolarsNumericType for IntervalYearMonthType[src]

type Simd = i32x16

type SimdMask = m32x16

fn mask_select(mask: Self::SimdMask, a: Self::Simd, b: Self::Simd) -> Self::Simd[src]

Selects elements of a and b using mask

impl PolarsNumericType for Time32MillisecondType[src]

type Simd = i32x16

type SimdMask = m32x16

fn mask_select(mask: Self::SimdMask, a: Self::Simd, b: Self::Simd) -> Self::Simd[src]

Selects elements of a and b using mask

impl PolarsNumericType for Time32SecondType[src]

type Simd = i32x16

type SimdMask = m32x16

fn mask_select(mask: Self::SimdMask, a: Self::Simd, b: Self::Simd) -> Self::Simd[src]

Selects elements of a and b using mask

impl PolarsNumericType for Time64MicrosecondType[src]

type Simd = i64x8

type SimdMask = m64x8

fn mask_select(mask: Self::SimdMask, a: Self::Simd, b: Self::Simd) -> Self::Simd[src]

Selects elements of a and b using mask

impl PolarsNumericType for Time64NanosecondType[src]

type Simd = i64x8

type SimdMask = m64x8

fn mask_select(mask: Self::SimdMask, a: Self::Simd, b: Self::Simd) -> Self::Simd[src]

Selects elements of a and b using mask

impl PolarsNumericType for TimestampMicrosecondType[src]

type Simd = i64x8

type SimdMask = m64x8

fn mask_select(mask: Self::SimdMask, a: Self::Simd, b: Self::Simd) -> Self::Simd[src]

Selects elements of a and b using mask

impl PolarsNumericType for TimestampMillisecondType[src]

type Simd = i64x8

type SimdMask = m64x8

fn mask_select(mask: Self::SimdMask, a: Self::Simd, b: Self::Simd) -> Self::Simd[src]

Selects elements of a and b using mask

impl PolarsNumericType for TimestampNanosecondType[src]

type Simd = i64x8

type SimdMask = m64x8

fn mask_select(mask: Self::SimdMask, a: Self::Simd, b: Self::Simd) -> Self::Simd[src]

Selects elements of a and b using mask

impl PolarsNumericType for TimestampSecondType[src]

type Simd = i64x8

type SimdMask = m64x8

fn mask_select(mask: Self::SimdMask, a: Self::Simd, b: Self::Simd) -> Self::Simd[src]

Selects elements of a and b using mask

impl PolarsNumericType for UInt8Type[src]

type Simd = u8x64

type SimdMask = m8x64

fn mask_select(mask: Self::SimdMask, a: Self::Simd, b: Self::Simd) -> Self::Simd[src]

Selects elements of a and b using mask

impl PolarsNumericType for UInt16Type[src]

type Simd = u16x32

type SimdMask = m16x32

fn mask_select(mask: Self::SimdMask, a: Self::Simd, b: Self::Simd) -> Self::Simd[src]

Selects elements of a and b using mask

impl PolarsNumericType for UInt32Type[src]

type Simd = u32x16

type SimdMask = m32x16

fn mask_select(mask: Self::SimdMask, a: Self::Simd, b: Self::Simd) -> Self::Simd[src]

Selects elements of a and b using mask

impl PolarsNumericType for UInt64Type[src]

type Simd = u64x8

type SimdMask = m64x8

fn mask_select(mask: Self::SimdMask, a: Self::Simd, b: Self::Simd) -> Self::Simd[src]

Selects elements of a and b using mask

Loading content...