arrayd_to_mat

Function arrayd_to_mat 

Source
pub fn arrayd_to_mat<T>(arr: &ArrayD<T>) -> Mat<T>
where T: Zeroable + Field + Clone,
Expand description

Converts an ndarray ArrayD (dynamic dimension) to an OxiBLAS Mat.

§Panics

Panics if the array is not 2-dimensional.

§Example

use ndarray::{ArrayD, IxDyn};
use oxiblas_ndarray::conversions::arrayd_to_mat;

let arr = ArrayD::from_shape_fn(IxDyn(&[3, 4]), |idx| (idx[0] * 4 + idx[1]) as f64);
let mat = arrayd_to_mat(&arr);
assert_eq!(mat.shape(), (3, 4));