Java Matrix Transpose transpose(int[][] input)

Here you can find the source of transpose(int[][] input)

Description

transpose

License

Open Source License

Declaration

public static int[][] transpose(int[][] input) 

Method Source Code

//package com.java2s;

public class Main {
    public static int[][] transpose(int[][] input) {
        int[][] output = new int[input[0].length][input.length];

        for (int i = 0; i < input.length; i++) {
            for (int j = 0; j < input[0].length; j++) {
                output[j][i] = input[i][j];
            }//from  www. java  2s  . c o  m
        }

        return output;
    }
}

Related

  1. transpose(final double[][] original)
  2. transpose(final double[][] src, final double[][] dest, int l1, int l2)
  3. transpose(float[] mat, float[] dest)
  4. transpose(float[][] data)
  5. transpose(int N, double src[][])
  6. transpose(int[][] M)
  7. transpose(int[][] matrix)
  8. transpose(int[][][] as, int A, int[][][] ast)
  9. transpose(long[] a, double offset)