static double[][] copyMatrix(double[][] matrix) {

		int rows = matrix.length;
		int columns = matrix[0].length;

		double[][] copy = new double[rows][columns];

		for (int row = 0; row < rows; row++) {

			for (int column = 0; column < columns; column++) {

				copy[row][column] = matrix[row][column];

			}

		}

		return copy;

	}