Class ArrayOfDoublesIntersection
- java.lang.Object
-
- org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesIntersection
-
public abstract class ArrayOfDoublesIntersection extends Object
Computes the intersection of two or more tuple sketches of type ArrayOfDoubles. A new instance represents the Universal Set. Every update() computes an intersection with the internal set and can only reduce the internal set.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesQuickSelectSketch
createSketch(int nomEntries, int numValues, long seed)
ArrayOfDoublesCompactSketch
getResult()
Gets the internal set as an on-heap compact sketch.ArrayOfDoublesCompactSketch
getResult(org.apache.datasketches.memory.WritableMemory dstMem)
Gets the result of stateful intersections so far.void
intersect(ArrayOfDoublesSketch tupleSketch, ArrayOfDoublesCombiner combiner)
Performs a stateful intersection of the internal set with the given tupleSketch.void
reset()
Resets the internal set to the initial state, which represents the Universal Set
-
-
-
Method Detail
-
intersect
public void intersect(ArrayOfDoublesSketch tupleSketch, ArrayOfDoublesCombiner combiner)
Performs a stateful intersection of the internal set with the given tupleSketch. The given tupleSketch and the internal state must have the same numValues.- Parameters:
tupleSketch
- Input sketch to intersect with the internal set.combiner
- Method of combining two arrays of double values
-
getResult
public ArrayOfDoublesCompactSketch getResult()
Gets the internal set as an on-heap compact sketch.- Returns:
- Result of the intersections so far as a compact sketch.
-
getResult
public ArrayOfDoublesCompactSketch getResult(org.apache.datasketches.memory.WritableMemory dstMem)
Gets the result of stateful intersections so far.- Parameters:
dstMem
- Memory for the compact sketch (can be null).- Returns:
- Result of the intersections so far as a compact sketch.
-
reset
public void reset()
Resets the internal set to the initial state, which represents the Universal Set
-
createSketch
protected abstract org.apache.datasketches.tuple.arrayofdoubles.ArrayOfDoublesQuickSelectSketch createSketch(int nomEntries, int numValues, long seed)
-
-