pub struct SlicePair<'a, T>(pub &'a [T], pub &'a [T]);Expand description
A pair of immutable slices, providing SIMD-accelerated element-wise binary operations that write the result into a pre-allocated output buffer.
§Example
use rill_core::math::vector::ops::SlicePair;
use rill_core::prelude::ScalarVector4;
let a = [1.0f32, 2.0, 3.0, 4.0];
let b = [5.0f32, 6.0, 7.0, 8.0];
let mut out = [0.0f32; 4];
SlicePair::new(&a, &b).add_into::<4, ScalarVector4<f32>>(&mut out);
assert_eq!(out, [6.0, 8.0, 10.0, 12.0]);Tuple Fields§
§0: &'a [T]§1: &'a [T]Implementations§
Source§impl<'a, T: Transcendental> SlicePair<'a, T>
impl<'a, T: Transcendental> SlicePair<'a, T>
Sourcepub fn add_into<const N: usize, V: Vector<T, N>>(self, out: &mut [T])
pub fn add_into<const N: usize, V: Vector<T, N>>(self, out: &mut [T])
Element-wise addition: out[i] = a[i] + b[i].
Sourcepub fn sub_into<const N: usize, V: Vector<T, N>>(self, out: &mut [T])
pub fn sub_into<const N: usize, V: Vector<T, N>>(self, out: &mut [T])
Element-wise subtraction: out[i] = a[i] - b[i].
Sourcepub fn mul_into<const N: usize, V: Vector<T, N>>(self, out: &mut [T])
pub fn mul_into<const N: usize, V: Vector<T, N>>(self, out: &mut [T])
Element-wise multiplication: out[i] = a[i] * b[i].
Auto Trait Implementations§
impl<'a, T> Freeze for SlicePair<'a, T>
impl<'a, T> RefUnwindSafe for SlicePair<'a, T>where
T: RefUnwindSafe,
impl<'a, T> Send for SlicePair<'a, T>where
T: Sync,
impl<'a, T> Sync for SlicePair<'a, T>where
T: Sync,
impl<'a, T> Unpin for SlicePair<'a, T>
impl<'a, T> UnsafeUnpin for SlicePair<'a, T>
impl<'a, T> UnwindSafe for SlicePair<'a, T>where
T: RefUnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more