[][src]Trait numeric_array::simd::Select

pub unsafe trait Select<T, N: ArrayLength<T>> {
    fn select(
        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.

Required methods

fn select(
    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]);
Loading content...

Implementors

impl<T, N: ArrayLength<T>> Select<T, N> for NumericArray<bool, N> where
    N: ArrayLength<bool>, 
[src]

Loading content...