Matrix<T>.concatVertical constructor

Matrix<T>.concatVertical(
  1. DataType<T> dataType,
  2. Iterable<Matrix<T>> matrices, {
  3. MatrixFormat? format,
})

Returns the vertical concatenation of matrices.

Implementation

factory Matrix.concatVertical(
    DataType<T> dataType, Iterable<Matrix<T>> matrices,
    {MatrixFormat? format}) {
  if (matrices.isEmpty) {
    throw ArgumentError.value(
        matrices, 'matrices', 'Expected at least 1 matrix.');
  }
  final result = matrices.length == 1
      ? matrices.first
      : ConcatVerticalMatrix<T>(dataType, matrices.toList(growable: false));
  return format == null ? result : result.toMatrix(format: format);
}