Here you can find the source of deepArrayCopy(double[][] original)
public static double[][] deepArrayCopy(double[][] original)
//package com.java2s; //License from project: Open Source License import java.util.Arrays; public class Main { public static double[][] deepArrayCopy(double[][] original) { /*double[][] copy = original.clone(); for (int i = 0; i < copy.length; i++) {/*from w w w . j av a 2s . c o m*/ copy[i] = copy[i].clone(); }*/ double[][] copy = new double[original.length][original[0].length]; for (int i = 0; i < copy.length; i++) { copy[i] = Arrays.copyOf(original[i], original[i].length); } return copy; } public static float[][] deepArrayCopy(float[][] original) { /*double[][] copy = original.clone(); for (int i = 0; i < copy.length; i++) { copy[i] = copy[i].clone(); }*/ float[][] copy = new float[original.length][original[0].length]; for (int i = 0; i < copy.length; i++) { copy[i] = Arrays.copyOf(original[i], original[i].length); } return copy; } }