transpose()
public
Returns the transpose of the matrix.
Matrix[[1,2], [3,4], [5,6]]
=> 1 2
3 4
5 6
Matrix[[1,2], [3,4], [5,6]].transpose
=> 1 3 5
2 4 6
# File lib/matrix.rb, line 1169
def transpose
return Matrix.empty(column_size, 0) if row_size.zero?
new_matrix @rows.transpose, row_size
end