transposed method

FLeftMatrix transposed()

Implementation

FLeftMatrix transposed() {
  // we use int32, because it is faster to convert int32 to int64 and
  // vice-versa, than to convert Float32 to double and vice-versa
  //
  FLeftMatrix result = FLeftMatrix.zero(this.nRows, this.nColumns);
  var int32Views = result.rowsData
      .map((e) => e.buffer.asInt32List())
      .toList(growable: false);
  for (int r = 0; r < nRows; ++r) {
    var currentRow = this.rowsData[r].buffer.asInt32List();
    for (int c = 0; c < nColumns; ++c) {
      int32Views[c][r] = currentRow[c];
    }
  }
  return result;
}