Trait nalgebra::SimdValue [−][src]
pub trait SimdValue { type Element: SimdValue; type SimdBool: SimdBool; fn lanes() -> usize; fn splat(val: Self::Element) -> Self; fn extract(&self, i: usize) -> Self::Element; unsafe fn extract_unchecked(&self, i: usize) -> Self::Element; fn replace(&mut self, i: usize, val: Self::Element); unsafe fn replace_unchecked(&mut self, i: usize, val: Self::Element); fn select(self, cond: Self::SimdBool, other: Self) -> Self; fn map_lanes(self, f: impl Fn(Self::Element) -> Self::Element) -> Self
where
Self: Clone, { ... } fn zip_map_lanes(
self,
b: Self,
f: impl Fn(Self::Element, Self::Element) -> Self::Element
) -> Self
where
Self: Clone, { ... } }
Expand description
Base trait for every SIMD types.
Associated Types
Required methods
Extracts the i-th lane of self
.
Panics if i >= Self::lanes()
.
unsafe fn extract_unchecked(&self, i: usize) -> Self::Element
[src]
unsafe fn extract_unchecked(&self, i: usize) -> Self::Element
[src]Extracts the i-th lane of self
without bound-checking.
Replaces the i-th lane of self
by val
.
Panics if i >= Self::lanes()
.
unsafe fn replace_unchecked(&mut self, i: usize, val: Self::Element)
[src]
unsafe fn replace_unchecked(&mut self, i: usize, val: Self::Element)
[src]Replaces the i-th lane of self
by val
without bound-checking.
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
.
Provided methods
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.
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.
Implementations on Foreign Types
Implementors
type Element = Quaternion<T::Element>
type Element = UnitQuaternion<T::Element>
type Element = Translation<T::Element, D>
impl<T: RealField, C, const D: usize> SimdValue for Transform<T, C, D> where
T::Element: Scalar,
C: TCategory,
Const<D>: DimNameAdd<U1>,
DefaultAllocator: Allocator<T, DimNameSum<Const<D>, U1>, DimNameSum<Const<D>, U1>> + Allocator<T::Element, DimNameSum<Const<D>, U1>, DimNameSum<Const<D>, U1>>,
[src]
impl<T: RealField, C, const D: usize> SimdValue for Transform<T, C, D> where
T::Element: Scalar,
C: TCategory,
Const<D>: DimNameAdd<U1>,
DefaultAllocator: Allocator<T, DimNameSum<Const<D>, U1>, DimNameSum<Const<D>, U1>> + Allocator<T::Element, DimNameSum<Const<D>, U1>, DimNameSum<Const<D>, U1>>,
[src]type Element = UnitComplex<T::Element>
impl<T: SimdRealField, R, const D: usize> SimdValue for Isometry<T, R, D> where
T::Element: SimdRealField,
R: SimdValue<SimdBool = T::SimdBool> + AbstractRotation<T, D>,
R::Element: AbstractRotation<T::Element, D>,
[src]
impl<T: SimdRealField, R, const D: usize> SimdValue for Isometry<T, R, D> where
T::Element: SimdRealField,
R: SimdValue<SimdBool = T::SimdBool> + AbstractRotation<T, D>,
R::Element: AbstractRotation<T::Element, D>,
[src]impl<T: SimdRealField, R, const D: usize> SimdValue for Similarity<T, R, D> where
T::Element: SimdRealField,
R: SimdValue<SimdBool = T::SimdBool> + AbstractRotation<T, D>,
R::Element: AbstractRotation<T::Element, D>,
[src]
impl<T: SimdRealField, R, const D: usize> SimdValue for Similarity<T, R, D> where
T::Element: SimdRealField,
R: SimdValue<SimdBool = T::SimdBool> + AbstractRotation<T, D>,
R::Element: AbstractRotation<T::Element, D>,
[src]type Element = Similarity<T::Element, R::Element, D>