Do anybody have a function with which I can transpose a Matrix in Java which has the following form:
double[][]
I have function like this:<
Here is the method
public static double[][] transpose(double arr[][]){ int m = arr.length; int n = arr[0].length; double ret[][] = new double[n][m]; for (int i = 0; i < m; i++) { for (int j = 0; j < n; j++) { ret[j][i] = arr[i][j]; } } return ret; }