Here you can find the source of transpose(float[][] data)
protected static void transpose(float[][] data)
//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; } } } }