[−][src]Trait numeric_array::simd::Select
Selects elements from one array or another using self
as a mask.
Required methods
fn select(
self,
true_values: NumericArray<T, N>,
false_values: NumericArray<T, N>
) -> NumericArray<T, N>
self,
true_values: NumericArray<T, N>,
false_values: NumericArray<T, N>
) -> NumericArray<T, N>
Selects elements from one array or another using self
as a mask.
Example:
ⓘThis example is not tested
use numeric_array::simd::Select; let mask = narr![bool; true, false, false, true]; let a = narr![i32; 1, 2, 3, 4]; let b = narr![i32; 5, 6, 7, 8]; // Compiles to vblendvps on my machine let selected = mask.select(a, b); assert_eq!(selected, narr![i32; 1, 6, 7, 4]);
Implementors
impl<T, N: ArrayLength<T>> Select<T, N> for NumericArray<bool, N> where
N: ArrayLength<bool>,
[src]
N: ArrayLength<bool>,
fn select(
self,
true_values: NumericArray<T, N>,
false_values: NumericArray<T, N>
) -> NumericArray<T, N>
[src]
self,
true_values: NumericArray<T, N>,
false_values: NumericArray<T, N>
) -> NumericArray<T, N>