Trait ndarray::AsArray [−][src]
Argument conversion into an array view
The trait is parameterized over A
, the element type, and D
, the
dimensionality of the array. D
defaults to one-dimensional.
Use .into()
to do the conversion.
use ndarray::AsArray; fn sum<'a, V: AsArray<'a, f64>>(data: V) -> f64 { let array_view = data.into(); array_view.sum() } assert_eq!( sum(&[1., 2., 3.]), 6. );
Implementors
impl<'a, A: 'a, D, T> AsArray<'a, A, D> for T where
T: Into<ArrayView<'a, A, D>>,
D: Dimension,
[src]
T: Into<ArrayView<'a, A, D>>,
D: Dimension,