Java Matrix Transpose transpose(final double[][] original)

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

Description

transpose

License

Open Source License

Declaration

static double[][] transpose(final double[][] original) 

Method Source Code

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

public class Main {
    static double[][] transpose(final double[][] original) {

        final double[][] d = new double[original[0].length][];

        if (original.length > 0) {
            for (int i = 0; i < original[0].length; i++) {
                d[i] = new double[original.length];
                for (int j = 0; j < original.length; j++) {
                    d[i][j] = original[j][i];
                }//from w  ww  .  j ava 2s  .co m
            }
        }

        return d;
    }
}

Related

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