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