CountMinSketchImpl(int depth, int width, int seed) { if (depth <= 0 || width <= 0) { throw new IllegalArgumentException("Depth and width must be both positive"); } this.depth = depth; this.width = width; this.eps = 2.0 / width; this.confidence = 1 - 1 / Math.pow(2, depth); initTablesWith(depth, width, seed); }
CountMinSketchImpl(int depth, int width, int seed) { if (depth <= 0 || width <= 0) { throw new IllegalArgumentException("Depth and width must be both positive"); } this.depth = depth; this.width = width; this.eps = 2.0 / width; this.confidence = 1 - 1 / Math.pow(2, depth); initTablesWith(depth, width, seed); }
CountMinSketchImpl(int depth, int width, int seed) { if (depth <= 0 || width <= 0) { throw new IllegalArgumentException("Depth and width must be both positive"); } this.depth = depth; this.width = width; this.eps = 2.0 / width; this.confidence = 1 - 1 / Math.pow(2, depth); initTablesWith(depth, width, seed); }
CountMinSketchImpl(int depth, int width, int seed) { if (depth <= 0 || width <= 0) { throw new IllegalArgumentException("Depth and width must be both positive"); } this.depth = depth; this.width = width; this.eps = 2.0 / width; this.confidence = 1 - 1 / Math.pow(2, depth); initTablesWith(depth, width, seed); }
CountMinSketchImpl(double eps, double confidence, int seed) { if (eps <= 0D) { throw new IllegalArgumentException("Relative error must be positive"); } if (confidence <= 0D || confidence >= 1D) { throw new IllegalArgumentException("Confidence must be within range (0.0, 1.0)"); } // 2/w = eps ; w = 2/eps // 1/2^depth <= 1-confidence ; depth >= -log2 (1-confidence) this.eps = eps; this.confidence = confidence; this.width = (int) Math.ceil(2 / eps); this.depth = (int) Math.ceil(-Math.log(1 - confidence) / Math.log(2)); initTablesWith(depth, width, seed); }
CountMinSketchImpl(double eps, double confidence, int seed) { if (eps <= 0D) { throw new IllegalArgumentException("Relative error must be positive"); } if (confidence <= 0D || confidence >= 1D) { throw new IllegalArgumentException("Confidence must be within range (0.0, 1.0)"); } // 2/w = eps ; w = 2/eps // 1/2^depth <= 1-confidence ; depth >= -log2 (1-confidence) this.eps = eps; this.confidence = confidence; this.width = (int) Math.ceil(2 / eps); this.depth = (int) Math.ceil(-Math.log(1 - confidence) / Math.log(2)); initTablesWith(depth, width, seed); }
CountMinSketchImpl(double eps, double confidence, int seed) { if (eps <= 0D) { throw new IllegalArgumentException("Relative error must be positive"); } if (confidence <= 0D || confidence >= 1D) { throw new IllegalArgumentException("Confidence must be within range (0.0, 1.0)"); } // 2/w = eps ; w = 2/eps // 1/2^depth <= 1-confidence ; depth >= -log2 (1-confidence) this.eps = eps; this.confidence = confidence; this.width = (int) Math.ceil(2 / eps); this.depth = (int) Math.ceil(-Math.log(1 - confidence) / Math.log(2)); initTablesWith(depth, width, seed); }
CountMinSketchImpl(double eps, double confidence, int seed) { if (eps <= 0D) { throw new IllegalArgumentException("Relative error must be positive"); } if (confidence <= 0D || confidence >= 1D) { throw new IllegalArgumentException("Confidence must be within range (0.0, 1.0)"); } // 2/w = eps ; w = 2/eps // 1/2^depth <= 1-confidence ; depth >= -log2 (1-confidence) this.eps = eps; this.confidence = confidence; this.width = (int) Math.ceil(2 / eps); this.depth = (int) Math.ceil(-Math.log(1 - confidence) / Math.log(2)); initTablesWith(depth, width, seed); }