Java Matrix Transpose transpose(double[][] A)

Here you can find the source of transpose(double[][] A)

Description

transpose

License

BSD License

Declaration

public static double[][] transpose(double[][] A) 

Method Source Code

//package com.java2s;
//License from project: BSD License 

public class Main {
    public static double[][] transpose(double[][] A) {
        int m = A.length;
        if (m == 0)
            return new double[0][0];
        int n = A[0].length;
        double[][] out = new double[n][m];
        for (int i = 0; i < m; i++)
            for (int j = 0; j < n; j++)
                out[j][i] = A[i][j];/*from   w  w  w  .j av a2 s  .  com*/
        return out;
    }
}

Related

  1. transpose(boolean[][] matrix)
  2. transpose(boolean[][] toBeTransposed)
  3. transpose(byte[][] d)
  4. transpose(double array[], int W, int H, int D)
  5. transpose(double[] m)
  6. transpose(double[][] arr)
  7. transpose(double[][] ary)
  8. transpose(double[][] in)
  9. transpose(double[][] matrix)