public Matrix transpose ( ) { Matrix result = blankOfShape ( columns , rows ) ; MatrixIterator it = result . iterator ( ) ; while ( it . hasNext ( ) ) { it . next ( ) ; int i = it . rowIndex ( ) ; int j = it . columnIndex ( ) ; it . set ( get ( j , i ) ) ; } return result ; }
Transposes this matrix .