class CountMinSketchAlt implements ISimpleFrequency<Object> {

    public static CountMinSketchAlt merge(CountMinSketchAlt... estimators) throws CMSMergeException {
        CountMinSketchAlt merged = null;
        if (estimators != null && estimators.length > 0) {
            int depth = estimators[0].depth;
            int width = estimators[0].width;
            long[] hashA = Arrays.copyOf(estimators[0].hashA, estimators[0].hashA.length);

            long[][] table = new long[depth][width];
            int size = 0;

            for (CountMinSketchAlt estimator : estimators) {
                if (estimator.depth != depth) {
                    throw new CMSMergeException("Cannot merge estimators of different depth");
                }
                if (estimator.width != width) {
                    throw new CMSMergeException("Cannot merge estimators of different width");
                }
                if (!Arrays.equals(estimator.hashA, hashA)) {
                    throw new CMSMergeException("Cannot merge estimators of different seed");
                }

                for (int i = 0; i < table.length; i++) {
                    for (int j = 0; j < table[i].length; j++) {
                        table[i][j] += estimator.table[i][j];
                    }
                }
                size += estimator.size;
            }

            merged = new CountMinSketchAlt(depth, width, size, hashA, table);
        }

        return merged;
    }

    private  CountMinSketchAlt();
    public  CountMinSketchAlt(int depth, int width, int seed);
    public  CountMinSketchAlt(double epsOfTotalCount, double confidence, int seed);
    private  CountMinSketchAlt(int depth, int width, int size, long[] hashA, long[][] table);

}