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

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

Description

transpose

License

Apache License

Declaration

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

Method Source Code

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

public class Main {
    public static double[][] transpose(double[][] ary) {
        if (ary == null)
            return null;
        double[][] res = new double[ary[0].length][ary.length];
        for (int i = 0; i < res.length; i++) {
            for (int j = 0; j < res[0].length; j++)
                res[i][j] = ary[j][i];/*from   w ww .  j  av a 2  s  . c  om*/
        }
        return res;
    }
}

Related

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