Java Matrix Transpose matrixTranspose(Object[][] matrix)

Here you can find the source of matrixTranspose(Object[][] matrix)

Description

matrix Transpose

License

Open Source License

Declaration

public static Object[][] matrixTranspose(Object[][] matrix) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {

    public static Object[][] matrixTranspose(Object[][] matrix) {
        if (null == matrix) {
            return null;
        }/*from  w ww.j  av  a 2  s .c  o m*/

        Object[][] matrixT = new Object[matrix[0].length][matrix.length];

        for (int i = 0; i < matrix[0].length; i++) {
            for (int j = 0; j < matrix.length; j++) {
                matrixT[i][j] = matrix[j][i];
            }
        }

        return matrixT;
    }
}

Related

  1. matrixTrans_x_diagonalMatrix(double[][] mat, double[] diag)
  2. matrixTrans_x_diagonalMatrix_x_Matrix(double[][] mat, double[] diag)
  3. matrixTrans_x_matrix(double[][] mat)
  4. matrixTransform(Object[][] datas)
  5. transpose(boolean[][] inputMatrix)
  6. transpose(boolean[][] matrix)
  7. transpose(boolean[][] toBeTransposed)
  8. transpose(byte[][] d)