Java Matrix Transpose transpose(float[][] data)

Here you can find the source of transpose(float[][] data)

Description

Transposes the given (square) two-dimensional array in place.

License

Open Source License

Declaration

protected static void transpose(float[][] data) 

Method Source Code

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

public class Main {
    /**/*from w  w w  .j  a va2  s.c  om*/
     * Transposes the given (square) two-dimensional array in place.
     */
    protected static void transpose(float[][] data) {
        float tmp;
        for (int ii = 0; ii < data.length; ii++) {
            for (int jj = ii + 1; jj < data.length; jj++) {
                tmp = data[ii][jj];
                data[ii][jj] = data[jj][ii];
                data[jj][ii] = tmp;
            }
        }
    }
}

Related

  1. transpose(final double[][] A)
  2. transpose(final double[][] m)
  3. transpose(final double[][] original)
  4. transpose(final double[][] src, final double[][] dest, int l1, int l2)
  5. transpose(float[] mat, float[] dest)
  6. transpose(int N, double src[][])
  7. transpose(int[][] input)
  8. transpose(int[][] M)
  9. transpose(int[][] matrix)