split

Function split 

Source
pub fn split<T: Num, R: Repr<Item = T>, D: Device>(
    matrix: &Matrix<R, DimDyn, D>,
    axis: usize,
    num_splits: usize,
) -> Vec<Matrix<Owned<T>, DimDyn, D>>
Expand description

Splits a matrix into multiple sub-matrices along a specified axis.

§Arguments

  • matrix - The matrix to split.
  • axis - The axis along which to split.
  • num_splits - Number of splits (must evenly divide the size along the axis).

§Panics

  • If the axis is out of bounds.
  • If the size along the axis is not divisible by num_splits.