Package org.apache.datasketches.cpc
Class CpcUnion
java.lang.Object
org.apache.datasketches.cpc.CpcUnion
The union (merge) operation for the CPC sketches.
- Author:
- Lee Rhodes, Kevin Lang
-
Constructor Summary
-
Method Summary
-
Constructor Details
-
CpcUnion
public CpcUnion()Construct this unioning object with the default LgK and the default update seed. -
CpcUnion
public CpcUnion(int lgK) Construct this unioning object with LgK and the default update seed.- Parameters:
lgK
- The given log2 of K.
-
CpcUnion
public CpcUnion(int lgK, long seed) Construct this unioning object with LgK and a given seed.- Parameters:
lgK
- The given log2 of K.seed
- The given seed.
-
-
Method Details
-
update
Update this union with a CpcSketch.- Parameters:
sketch
- the given CpcSketch.
-
getResult
Returns the result of union operations as a CPC sketch.- Returns:
- the result of union operations as a CPC sketch.
-
getLgK
public int getLgK()Returns the current value of Log_base2 of K. Note that due to merging with source sketches that may have a lower value of LgK, this value can be less than what the union object was configured with.- Returns:
- the current value of Log_base2 of K.
-
getFamily
Return the DataSketches identifier for this CPC family of sketches.- Returns:
- the DataSketches identifier for this CPC family of sketches.
-