Trait na::simd::SimdValue[][src]

pub trait SimdValue {
    type Element: SimdValue;
    type SimdBool: SimdBool;
    pub fn lanes() -> usize;
pub fn splat(val: Self::Element) -> Self;
pub fn extract(&self, i: usize) -> Self::Element;
pub unsafe fn extract_unchecked(&self, i: usize) -> Self::Element;
pub fn replace(&mut self, i: usize, val: Self::Element);
pub unsafe fn replace_unchecked(&mut self, i: usize, val: Self::Element);
pub fn select(self, cond: Self::SimdBool, other: Self) -> Self; pub fn map_lanes(self, f: impl Fn(Self::Element) -> Self::Element) -> Self
    where
        Self: Clone
, { ... }
pub fn zip_map_lanes(
        self,
        b: Self,
        f: impl Fn(Self::Element, Self::Element) -> Self::Element
    ) -> Self
    where
        Self: Clone
, { ... } }

Base trait for every SIMD types.

Associated Types

type Element: SimdValue[src]

The type of the elements of each lane of this SIMD value.

type SimdBool: SimdBool[src]

Type of the result of comparing two SIMD values like self.

Loading content...

Required methods

pub fn lanes() -> usize[src]

The number of lanes of this SIMD value.

pub fn splat(val: Self::Element) -> Self[src]

Initializes an SIMD value with each lanes set to val.

pub fn extract(&self, i: usize) -> Self::Element[src]

Extracts the i-th lane of self.

Panics if i >= Self::lanes().

pub unsafe fn extract_unchecked(&self, i: usize) -> Self::Element[src]

Extracts the i-th lane of self without bound-checking.

pub fn replace(&mut self, i: usize, val: Self::Element)[src]

Replaces the i-th lane of self by val.

Panics if i >= Self::lanes().

pub unsafe fn replace_unchecked(&mut self, i: usize, val: Self::Element)[src]

Replaces the i-th lane of self by val without bound-checking.

pub fn select(self, cond: Self::SimdBool, other: Self) -> Self[src]

Merges self and other depending on the lanes of cond.

For each lane of cond with bits set to 1, the result’s will contain the value of the lane of self. For each lane of cond with bits set to 0, the result’s will contain the value of the lane of other.

Loading content...

Provided methods

pub fn map_lanes(self, f: impl Fn(Self::Element) -> Self::Element) -> Self where
    Self: Clone
[src]

Applies a function to each lane of self.

Note that, while convenient, this method can be extremely slow as this requires to extract each lane of self and then combine them again into a new SIMD value.

pub fn zip_map_lanes(
    self,
    b: Self,
    f: impl Fn(Self::Element, Self::Element) -> Self::Element
) -> Self where
    Self: Clone
[src]

Applies a function to each lane of self paired with the corresponding lane of b.

Note that, while convenient, this method can be extremely slow as this requires to extract each lane of self and then combine them again into a new SIMD value.

Loading content...

Implementations on Foreign Types

impl SimdValue for u32[src]

type Element = u32

type SimdBool = bool

impl SimdValue for u16[src]

type Element = u16

type SimdBool = bool

impl SimdValue for isize[src]

type Element = isize

type SimdBool = bool

impl SimdValue for i8[src]

type Element = i8

type SimdBool = bool

impl SimdValue for i64[src]

type Element = i64

type SimdBool = bool

impl SimdValue for f32[src]

type Element = f32

type SimdBool = bool

impl SimdValue for u64[src]

type Element = u64

type SimdBool = bool

impl SimdValue for f64[src]

type Element = f64

type SimdBool = bool

impl SimdValue for i32[src]

type Element = i32

type SimdBool = bool

impl SimdValue for usize[src]

type Element = usize

type SimdBool = bool

impl SimdValue for u128[src]

type Element = u128

type SimdBool = bool

impl SimdValue for u8[src]

type Element = u8

type SimdBool = bool

impl SimdValue for bool[src]

type Element = bool

type SimdBool = bool

impl SimdValue for i16[src]

type Element = i16

type SimdBool = bool

impl SimdValue for i128[src]

type Element = i128

type SimdBool = bool

Loading content...

Implementors

impl SimdValue for AutoSimd<[bool; 1]>[src]

type Element = bool

type SimdBool = AutoSimd<[bool; 1]>

impl SimdValue for AutoSimd<[bool; 2]>[src]

type Element = bool

type SimdBool = AutoSimd<[bool; 2]>

impl SimdValue for AutoSimd<[bool; 4]>[src]

type Element = bool

type SimdBool = AutoSimd<[bool; 4]>

impl SimdValue for AutoSimd<[bool; 8]>[src]

type Element = bool

type SimdBool = AutoSimd<[bool; 8]>

impl SimdValue for AutoSimd<[bool; 16]>[src]

type Element = bool

type SimdBool = AutoSimd<[bool; 16]>

impl SimdValue for AutoSimd<[bool; 32]>[src]

type Element = bool

type SimdBool = AutoSimd<[bool; 32]>

impl SimdValue for AutoSimd<[f32; 2]>[src]

type Element = f32

type SimdBool = AutoSimd<[bool; 2]>

impl SimdValue for AutoSimd<[f32; 4]>[src]

type Element = f32

type SimdBool = AutoSimd<[bool; 4]>

impl SimdValue for AutoSimd<[f32; 8]>[src]

type Element = f32

type SimdBool = AutoSimd<[bool; 8]>

impl SimdValue for AutoSimd<[f32; 16]>[src]

type Element = f32

type SimdBool = AutoSimd<[bool; 16]>

impl SimdValue for AutoSimd<[f64; 2]>[src]

type Element = f64

type SimdBool = AutoSimd<[bool; 2]>

impl SimdValue for AutoSimd<[f64; 4]>[src]

type Element = f64

type SimdBool = AutoSimd<[bool; 4]>

impl SimdValue for AutoSimd<[f64; 8]>[src]

type Element = f64

type SimdBool = AutoSimd<[bool; 8]>

impl SimdValue for AutoSimd<[i8; 2]>[src]

type Element = i8

type SimdBool = AutoSimd<[bool; 2]>

impl SimdValue for AutoSimd<[i8; 4]>[src]

type Element = i8

type SimdBool = AutoSimd<[bool; 4]>

impl SimdValue for AutoSimd<[i8; 8]>[src]

type Element = i8

type SimdBool = AutoSimd<[bool; 8]>

impl SimdValue for AutoSimd<[i8; 16]>[src]

type Element = i8

type SimdBool = AutoSimd<[bool; 16]>

impl SimdValue for AutoSimd<[i8; 32]>[src]

type Element = i8

type SimdBool = AutoSimd<[bool; 32]>

impl SimdValue for AutoSimd<[i16; 2]>[src]

type Element = i16

type SimdBool = AutoSimd<[bool; 2]>

impl SimdValue for AutoSimd<[i16; 4]>[src]

type Element = i16

type SimdBool = AutoSimd<[bool; 4]>

impl SimdValue for AutoSimd<[i16; 8]>[src]

type Element = i16

type SimdBool = AutoSimd<[bool; 8]>

impl SimdValue for AutoSimd<[i16; 16]>[src]

type Element = i16

type SimdBool = AutoSimd<[bool; 16]>

impl SimdValue for AutoSimd<[i16; 32]>[src]

type Element = i16

type SimdBool = AutoSimd<[bool; 32]>

impl SimdValue for AutoSimd<[i32; 2]>[src]

type Element = i32

type SimdBool = AutoSimd<[bool; 2]>

impl SimdValue for AutoSimd<[i32; 4]>[src]

type Element = i32

type SimdBool = AutoSimd<[bool; 4]>

impl SimdValue for AutoSimd<[i32; 8]>[src]

type Element = i32

type SimdBool = AutoSimd<[bool; 8]>

impl SimdValue for AutoSimd<[i32; 16]>[src]

type Element = i32

type SimdBool = AutoSimd<[bool; 16]>

impl SimdValue for AutoSimd<[i64; 2]>[src]

type Element = i64

type SimdBool = AutoSimd<[bool; 2]>

impl SimdValue for AutoSimd<[i64; 4]>[src]

type Element = i64

type SimdBool = AutoSimd<[bool; 4]>

impl SimdValue for AutoSimd<[i64; 8]>[src]

type Element = i64

type SimdBool = AutoSimd<[bool; 8]>

impl SimdValue for AutoSimd<[i128; 1]>[src]

type Element = i128

type SimdBool = AutoSimd<[bool; 1]>

impl SimdValue for AutoSimd<[i128; 2]>[src]

type Element = i128

type SimdBool = AutoSimd<[bool; 2]>

impl SimdValue for AutoSimd<[i128; 4]>[src]

type Element = i128

type SimdBool = AutoSimd<[bool; 4]>

impl SimdValue for AutoSimd<[isize; 2]>[src]

type Element = isize

type SimdBool = AutoSimd<[bool; 2]>

impl SimdValue for AutoSimd<[isize; 4]>[src]

type Element = isize

type SimdBool = AutoSimd<[bool; 4]>

impl SimdValue for AutoSimd<[isize; 8]>[src]

type Element = isize

type SimdBool = AutoSimd<[bool; 8]>

impl SimdValue for AutoSimd<[u8; 2]>[src]

type Element = u8

type SimdBool = AutoSimd<[bool; 2]>

impl SimdValue for AutoSimd<[u8; 4]>[src]

type Element = u8

type SimdBool = AutoSimd<[bool; 4]>

impl SimdValue for AutoSimd<[u8; 8]>[src]

type Element = u8

type SimdBool = AutoSimd<[bool; 8]>

impl SimdValue for AutoSimd<[u8; 16]>[src]

type Element = u8

type SimdBool = AutoSimd<[bool; 16]>

impl SimdValue for AutoSimd<[u8; 32]>[src]

type Element = u8

type SimdBool = AutoSimd<[bool; 32]>

impl SimdValue for AutoSimd<[u16; 2]>[src]

type Element = u16

type SimdBool = AutoSimd<[bool; 2]>

impl SimdValue for AutoSimd<[u16; 4]>[src]

type Element = u16

type SimdBool = AutoSimd<[bool; 4]>

impl SimdValue for AutoSimd<[u16; 8]>[src]

type Element = u16

type SimdBool = AutoSimd<[bool; 8]>

impl SimdValue for AutoSimd<[u16; 16]>[src]

type Element = u16

type SimdBool = AutoSimd<[bool; 16]>

impl SimdValue for AutoSimd<[u16; 32]>[src]

type Element = u16

type SimdBool = AutoSimd<[bool; 32]>

impl SimdValue for AutoSimd<[u32; 2]>[src]

type Element = u32

type SimdBool = AutoSimd<[bool; 2]>

impl SimdValue for AutoSimd<[u32; 4]>[src]

type Element = u32

type SimdBool = AutoSimd<[bool; 4]>

impl SimdValue for AutoSimd<[u32; 8]>[src]

type Element = u32

type SimdBool = AutoSimd<[bool; 8]>

impl SimdValue for AutoSimd<[u32; 16]>[src]

type Element = u32

type SimdBool = AutoSimd<[bool; 16]>

impl SimdValue for AutoSimd<[u64; 2]>[src]

type Element = u64

type SimdBool = AutoSimd<[bool; 2]>

impl SimdValue for AutoSimd<[u64; 4]>[src]

type Element = u64

type SimdBool = AutoSimd<[bool; 4]>

impl SimdValue for AutoSimd<[u64; 8]>[src]

type Element = u64

type SimdBool = AutoSimd<[bool; 8]>

impl SimdValue for AutoSimd<[u128; 1]>[src]

type Element = u128

type SimdBool = AutoSimd<[bool; 1]>

impl SimdValue for AutoSimd<[u128; 2]>[src]

type Element = u128

type SimdBool = AutoSimd<[bool; 2]>

impl SimdValue for AutoSimd<[u128; 4]>[src]

type Element = u128

type SimdBool = AutoSimd<[bool; 4]>

impl SimdValue for AutoSimd<[usize; 2]>[src]

type Element = usize

type SimdBool = AutoSimd<[bool; 2]>

impl SimdValue for AutoSimd<[usize; 4]>[src]

type Element = usize

type SimdBool = AutoSimd<[bool; 4]>

impl SimdValue for AutoSimd<[usize; 8]>[src]

type Element = usize

type SimdBool = AutoSimd<[bool; 8]>

impl<N> SimdValue for Complex<N> where
    N: SimdValue
[src]

type Element = Complex<<N as SimdValue>::Element>

type SimdBool = <N as SimdValue>::SimdBool

impl<N> SimdValue for Quaternion<N> where
    N: Scalar + SimdValue,
    <N as SimdValue>::Element: Scalar
[src]

type Element = Quaternion<<N as SimdValue>::Element>

type SimdBool = <N as SimdValue>::SimdBool

impl<N> SimdValue for Unit<Complex<N>> where
    N: SimdRealField,
    <N as SimdValue>::Element: SimdRealField
[src]

type Element = Unit<Complex<<N as SimdValue>::Element>>

type SimdBool = <N as SimdValue>::SimdBool

impl<N> SimdValue for Unit<Quaternion<N>> where
    N: Scalar + SimdValue,
    <N as SimdValue>::Element: Scalar
[src]

type Element = Unit<Quaternion<<N as SimdValue>::Element>>

type SimdBool = <N as SimdValue>::SimdBool

impl<N, D> SimdValue for Point<N, D> where
    D: DimName,
    N: Scalar + SimdValue,
    <N as SimdValue>::Element: Scalar,
    DefaultAllocator: Allocator<N, D, U1>,
    DefaultAllocator: Allocator<<N as SimdValue>::Element, D, U1>, 
[src]

type Element = Point<<N as SimdValue>::Element, D>

type SimdBool = <N as SimdValue>::SimdBool

impl<N, D> SimdValue for Rotation<N, D> where
    D: DimName,
    N: Scalar + SimdValue,
    <N as SimdValue>::Element: Scalar,
    DefaultAllocator: Allocator<N, D, D>,
    DefaultAllocator: Allocator<<N as SimdValue>::Element, D, D>, 
[src]

type Element = Rotation<<N as SimdValue>::Element, D>

type SimdBool = <N as SimdValue>::SimdBool

impl<N, D> SimdValue for Translation<N, D> where
    D: DimName,
    N: Scalar + SimdValue,
    <N as SimdValue>::Element: Scalar,
    DefaultAllocator: Allocator<N, D, U1>,
    DefaultAllocator: Allocator<<N as SimdValue>::Element, D, U1>, 
[src]

type Element = Translation<<N as SimdValue>::Element, D>

type SimdBool = <N as SimdValue>::SimdBool

impl<N, D, C> SimdValue for Transform<N, D, C> where
    C: TCategory,
    D: DimNameAdd<U1>,
    N: RealField,
    <N as SimdValue>::Element: Scalar,
    DefaultAllocator: Allocator<N, <D as DimNameAdd<U1>>::Output, <D as DimNameAdd<U1>>::Output>,
    DefaultAllocator: Allocator<<N as SimdValue>::Element, <D as DimNameAdd<U1>>::Output, <D as DimNameAdd<U1>>::Output>, 
[src]

type Element = Transform<<N as SimdValue>::Element, D, C>

type SimdBool = <N as SimdValue>::SimdBool

impl<N, D, R> SimdValue for Isometry<N, D, R> where
    D: DimName,
    N: SimdRealField,
    R: SimdValue<SimdBool = <N as SimdValue>::SimdBool> + AbstractRotation<N, D>,
    <N as SimdValue>::Element: SimdRealField,
    <R as SimdValue>::Element: AbstractRotation<<N as SimdValue>::Element, D>,
    DefaultAllocator: Allocator<N, D, U1>,
    DefaultAllocator: Allocator<<N as SimdValue>::Element, D, U1>, 
[src]

type Element = Isometry<<N as SimdValue>::Element, D, <R as SimdValue>::Element>

type SimdBool = <N as SimdValue>::SimdBool

impl<N, D, R> SimdValue for Similarity<N, D, R> where
    D: DimName,
    N: SimdRealField,
    R: SimdValue<SimdBool = <N as SimdValue>::SimdBool> + AbstractRotation<N, D>,
    <N as SimdValue>::Element: SimdRealField,
    <R as SimdValue>::Element: AbstractRotation<<N as SimdValue>::Element, D>,
    DefaultAllocator: Allocator<N, D, U1>,
    DefaultAllocator: Allocator<<N as SimdValue>::Element, D, U1>, 
[src]

type Element = Similarity<<N as SimdValue>::Element, D, <R as SimdValue>::Element>

type SimdBool = <N as SimdValue>::SimdBool

impl<N, R, C> SimdValue for Matrix<N, R, C, <DefaultAllocator as Allocator<N, R, C>>::Buffer> where
    C: Dim,
    N: Scalar + SimdValue,
    R: Dim,
    <N as SimdValue>::Element: Scalar,
    DefaultAllocator: Allocator<N, R, C>,
    DefaultAllocator: Allocator<<N as SimdValue>::Element, R, C>, 
[src]

type Element = Matrix<<N as SimdValue>::Element, R, C, <DefaultAllocator as Allocator<<N as SimdValue>::Element, R, C>>::Buffer>

type SimdBool = <N as SimdValue>::SimdBool

Loading content...