Here you can find the source of copyArray(double[] a)
public static double[] copyArray(double[] a)
//package com.java2s; //License from project: LGPL public class Main { /**//from w w w . j a v a 2 s . c om * Returns a copy of the specified array. */ public static double[] copyArray(double[] a) { if (a != null) { return copyArray(a, a.length); } else { return null; } } /** * Returns a copy of the first <tt>length</tt> elements of the specified array. */ public static double[] copyArray(double[] a, int length) { if (a == null) { return null; } double[] copy = new double[length]; System.arraycopy(a, 0, copy, 0, length); return copy; } /** * Returns a copy of the specified array. */ public static int[] copyArray(int[] a) { if (a == null) { return null; } int[] copy = new int[a.length]; System.arraycopy(a, 0, copy, 0, a.length); return copy; } /** * Returns a copy of the specified 2-dimensional array. */ public static double[][] copyArray(double[][] a) { double[][] copy = new double[a.length][]; for (int i = 0; i < a.length; i++) { copy[i] = copyArray(a[i]); } return copy; } }