[][src]Trait nshare::RefNdarray1

pub trait RefNdarray1 {
    type Out;
    pub fn ref_ndarray1(self) -> Self::Out;
}

Borrows a 1d type to a ndarray 1d array type.

This uses an associated type to avoid ambiguity for the compiler. By calling this, the compiler always knows the returned type.

Associated Types

Loading content...

Required methods

pub fn ref_ndarray1(self) -> Self::Out[src]

Loading content...

Implementations on Foreign Types

impl<'a, N: Scalar, R: Dim, S> RefNdarray1 for &'a Vector<N, R, S> where
    S: Storage<N, R, U1>, 
[src]

use nshare::RefNdarray1;
use nalgebra::Vector4;
use ndarray::s;

let m = Vector4::new(
    0.1, 0.2, 0.3, 0.4f32,
);
let arr = m.ref_ndarray1();
assert!(arr.iter().eq(&[0.1, 0.2, 0.3, 0.4]));
assert_eq!(arr.dim(), 4);

type Out = ArrayView1<'a, N>

Loading content...

Implementors

Loading content...