Here you can find the source of array2Dto1D(int m, int n, double[][] a)
public static double[] array2Dto1D(int m, int n, double[][] a)
//package com.java2s; //License from project: Open Source License public class Main { public static double[] array2Dto1D(int m, int n, double[][] a) { int i, j; double b[]; b = new double[m * n]; for (i = 0; i < m; i++) for (j = 0; j < n; j++) b[i * n + j] = a[i][j];// ww w . j a v a2 s . c o m return b; } }