public static class LinearCounting.Builder extends Object implements IBuilder<ICardinality>, Serializable
Modifier and Type | Field and Description |
---|---|
protected static int[] |
onePercentErrorLength
Taken from Table II of Whang et al.
|
protected int |
size |
Modifier and Type | Method and Description |
---|---|
LinearCounting |
build() |
protected static int |
lerp(int x0,
int y0,
int x1,
int y1,
int x) |
static LinearCounting.Builder |
onePercentError(int maxCardinality)
Returns a LinearCounting.Builder that generates an LC
estimator which keeps estimates below 1% error on average and has
a low likelihood of saturation (0.7%) for any stream with
cardinality less than maxCardinality
|
int |
sizeof() |
static LinearCounting.Builder |
withError(double eps,
int maxCardinality)
Builds Linear Counter with arbitrary standard error and maximum expected cardinality.
|
protected static final int[] onePercentErrorLength
protected final int size
public LinearCounting build()
build
in interface IBuilder<ICardinality>
public int sizeof()
sizeof
in interface IBuilder<ICardinality>
public static LinearCounting.Builder onePercentError(int maxCardinality)
maxCardinality
- IllegalArgumentException
- if maxCardinality is not a positive integerpublic static LinearCounting.Builder withError(double eps, int maxCardinality)
onePercentError(int)
as it is perform
solving precision inequality in runtime. Therefore, onePercentError(int)
should be
used whenever possible.eps
- standard error as a fraction (e.g. 0.01
for 1%)maxCardinality
- maximum expected cardinalityprotected static int lerp(int x0, int y0, int x1, int y1, int x)
x0
- y0
- x1
- y1
- x
- Copyright © 2019. All rights reserved.