public Matrix transpose() { checkTranspose(); for (int j = 0; j < numColumns; ++j) for (int i = j + 1; i < numRows; ++i) { double value = get(i, j); set(i, j, get(j, i)); set(j, i, value); } return this; }
public Matrix transpose() { checkTranspose(); for (int j = 0; j < numColumns; ++j) for (int i = j + 1; i < numRows; ++i) { double value = get(i, j); set(i, j, get(j, i)); set(j, i, value); } return this; }
public Matrix transpose(Matrix B) { checkTranspose(B); if (B == this) return transpose(); B.zero(); for (MatrixEntry e : this) B.set(e.column(), e.row(), e.get()); return B; }
public Matrix transpose(Matrix B) { checkTranspose(B); if (B == this) return transpose(); B.zero(); for (MatrixEntry e : this) B.set(e.column(), e.row(), e.get()); return B; }