transpose method
Returns the transpose of this matrix.
This is an operation that simply flips a matrix over its diagonal (so it switches the row and column indices of the matrix to create a new one).
Implementation
@override
ComplexMatrix transpose() {
final source = List<Complex>.generate(
rowCount * columnCount,
(_) => const Complex.zero(),
);
for (var i = 0; i < rowCount; i++) {
for (var j = 0; j < columnCount; j++) {
source[rowCount * j + i] = this(i, j);
}
}
return ComplexMatrix.fromFlattenedData(
rows: columnCount,
columns: rowCount,
data: source,
);
}