Matrix<T>.concatHorizontal constructor

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

Returns the horizontal concatenation of matrices.

Implementation

factory Matrix.concatHorizontal(
    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
      : ConcatHorizontalMatrix<T>(dataType, matrices.toList(growable: false));
  return format == null ? result : result.toMatrix(format: format);
}