Matrix<T>.concatHorizontal constructor
Matrix<T>.concatHorizontal (
- DataType<
T> dataType, - Iterable<
Matrix< matrices, {T> > - 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);
}