Here you can find the source of copyMatrix(final double[][] c)
static double[][] copyMatrix(final double[][] c)
//package com.java2s; //License from project: Open Source License public class Main { static double[][] copyMatrix(final double[][] c) { final double[][] a = new double[c.length][]; for (int i = 0; i < c.length; ++i) { a[i] = new double[c[i].length]; for (int j = 0; j < c[i].length; ++j) { //Gaussian distributions with mean 0 and standard deviation 1 a[i][j] = c[i][j];//w w w. j av a 2 s.c o m } } return a; } static double[][][] copyMatrix(final double[][][] c) { final double[][][] a = new double[c.length][][]; for (int i = 0; i < c.length; ++i) { a[i] = copyMatrix(c[i]); } return a; } }