Skip to main content

array2_to_arrayd

Function array2_to_arrayd 

Source
pub fn array2_to_arrayd<T: Clone>(arr: &Array2<T>) -> ArrayD<T>
Expand description

Converts an Array2 to an ArrayD.

Works correctly for empty arrays (nrows == 0 and/or ncols == 0): this clones arr and reinterprets its dimension type via ArrayBase::into_dyn, which never indexes into arr, so there is no “template element” that would be out of bounds on an empty array.