Trait vrl::SIMDPartialLoad

source ·
pub trait SIMDPartialLoad<T> {
    // Required method
    fn load_partial(data: &[T]) -> Self;
}

Required Methods§

source

fn load_partial(data: &[T]) -> Self

Loads first min(N, data.len()) elements of data into vector.

§Example
let values = [1.0, 2.0, 3.0, 4.0, 5.0];
assert_eq!(
    Vec4f::load_partial(&values),
    Vec4f::from(&values[..4].try_into().unwrap())
);
assert_eq!(
    Vec4f::load_partial(&values[..2]),
    Vec4f::new(1.0, 2.0, 0.0, 0.0)  // note zeros here
);

Object Safety§

This trait is not object safe.

Implementors§