Java Matrix Flatten flatten2DArray(double[][] array)

Here you can find the source of flatten2DArray(double[][] array)

Description

flatten D Array

License

Apache License

Declaration

public static double[] flatten2DArray(double[][] array) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    public static double[] flatten2DArray(double[][] array) {
        int length = 0;
        for (double[] arr : array) {
            length += arr.length;/*from ww w. jav  a 2  s .  c  om*/
        }
        double[] flattenArray = new double[length];
        int count = 0;
        for (double[] arr : array) {
            for (int j = 0; j < arr.length; j++) {
                flattenArray[count++] = arr[j];
            }
        }
        return flattenArray;
    }
}

Related

  1. flatten(double[][] spills)
  2. flatten(int[][] arr)
  3. Flatten(int[][] in, int[] out)
  4. flatten(String[][] table)
  5. flatten2DArray(byte[][] array)
  6. flatten4(float[][] in, int size, float[] out)
  7. flattenIndicesCollection(int[][] multipleIndices, int[] extents)
  8. flattenN(float[][] in, int size, int width, float[] out)