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

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

Description

flatten

License

Open Source License

Declaration

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

Method Source Code

//package com.java2s;

public class Main {
    public static double[] flatten(double[][] array) {
        int size = 0;
        for (double[] a : array) {
            size += a.length;//w ww  .  j  a v  a  2s. c om
        }
        double[] newArray = new double[size];
        int i = 0;
        for (double[] a : array) {
            for (double d : a) {
                newArray[i++] = d;
            }
        }
        return newArray;
    }
}

Related

  1. flatten(boolean[][] array)
  2. flatten(byte[][] matrix)
  3. flatten(double[][] arr)
  4. flatten(double[][] array)
  5. flatten(double[][] matrix)
  6. flatten(double[][] matrix)
  7. flatten(double[][] spills)