pub fn flatten<T: MatrixValue>(
matrix: &AbstractLiteral<T>,
) -> impl Iterator<Item = &T>Expand description
Flattens a multi-dimensional matrix into a one-dimensional slice of its elements.
The elements are returned in row-major ordering (see enumerate_indices).
The elements are borrowed; To consume the matrix and return owned values, see flatten_owned.
ยงPanics
- If the number or type of elements in each dimension is inconsistent.
- If
matrixis not a matrix.