public static double[][] concat(final double[][] first, final double[][] second) {
        double[][] result = Arrays.copyOf(first, first.length + second.length);
        System.arraycopy(second, 0, result, first.length, second.length);
        return result;
    }