Skip to main content

flatten

Function flatten 

Source
pub fn flatten<T>(matrix: &AbstractLiteral<T>) -> impl Iterator<Item = &T>
where T: MatrixValue,
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 matrix is not a matrix.