# Uses of Class
org.apache.datasketches.theta.ThetaSketch

Packages that use ThetaSketch
Package
Description
org.apache.datasketches.theta
The theta package contains the basic sketch classes that are members of the Theta-Sketch Framework.
org.apache.datasketches.thetacommon
This package contains common tools and methods for the theta, tuple, tuple/* and fdt packages.
org.apache.datasketches.tuple
The tuple package contains a number of sketches based on the same fundamental algorithms of the Theta Sketch Framework and extend these concepts for whole new families of sketches.

## Uses of ThetaSketch in org.apache.datasketches.theta

Subclasses of ThetaSketch in org.apache.datasketches.theta
Modifier and Type
Class
Description
`class`
`CompactThetaSketch`
The parent class of all the CompactThetaSketches.
`class`
`UpdatableThetaSketch`
The parent class for the UpdatableThetaSketch families, such as QuickSelectThetaSketch and AlphaSketch.
Methods in org.apache.datasketches.theta that return ThetaSketch
Modifier and Type
Method
Description
`static ThetaSketch`
ThetaSketch.`heapify(MemorySegment srcSeg)`
Heapify takes the sketch image in MemorySegment and instantiates an on-heap ThetaSketch.
`static ThetaSketch`
ThetaSketch.`heapify(MemorySegment srcSeg, long expectedSeed)`
Heapify takes the sketch image in MemorySegment and instantiates an on-heap ThetaSketch.
`static ThetaSketch`
ThetaSketch.`wrap(MemorySegment srcSeg)`
Wrap takes the sketch image in the given MemorySegment and refers to it directly.
`static ThetaSketch`
ThetaSketch.`wrap(MemorySegment srcSeg, long expectedSeed)`
Wrap takes the sketch image in the given MemorySegment and refers to it directly.
Methods in org.apache.datasketches.theta with parameters of type ThetaSketch
Modifier and Type
Method
Description
`CompactThetaSketch`
ThetaAnotB.`aNotB(ThetaSketch skA, ThetaSketch skB)`
Perform A-and-not-B set operation on the two given sketches and return the result as an ordered CompactThetaSketch on the heap.
`abstract CompactThetaSketch`
ThetaAnotB.`aNotB(ThetaSketch skA, ThetaSketch skB, boolean dstOrdered, MemorySegment dstSeg)`
Perform A-and-not-B set operation on the two given sketches and return the result as a CompactThetaSketch.
`static boolean`
JaccardSimilarity.`dissimilarityTest(ThetaSketch measured, ThetaSketch expected, double threshold)`
Tests dissimilarity of a measured ThetaSketch against an expected ThetaSketch.
`static boolean`
JaccardSimilarity.`exactlyEqual(ThetaSketch sketchA, ThetaSketch sketchB)`
Returns true if the two given sketches have exactly the same hash values and the same theta values.
`abstract void`
ThetaIntersection.`intersect(ThetaSketch sketchIn)`
Intersect the given sketch with the internal state.
`CompactThetaSketch`
ThetaIntersection.`intersect(ThetaSketch a, ThetaSketch b)`
Perform intersect set operation on the two given sketch arguments and return the result as an ordered CompactThetaSketch on the heap.
`abstract CompactThetaSketch`
ThetaIntersection.`intersect(ThetaSketch a, ThetaSketch b, boolean dstOrdered, MemorySegment dstSeg)`
Perform intersect set operation on the two given sketches and return the result as a CompactThetaSketch.
`static double[]`
JaccardSimilarity.`jaccard(ThetaSketch sketchA, ThetaSketch sketchB)`
Computes the Jaccard similarity index with upper and lower bounds.
`abstract void`
ThetaAnotB.`notB(ThetaSketch skB)`
This is part of a multistep, stateful ThetaAnotB operation and sets the given ThetaSketch as the second (or n+1th) argument B of A-AND-NOT-B.
`abstract void`
ThetaAnotB.`setA(ThetaSketch skA)`
This is part of a multistep, stateful ThetaAnotB operation and sets the given ThetaSketch as the first argument A of A-AND-NOT-B.
`static boolean`
JaccardSimilarity.`similarityTest(ThetaSketch measured, ThetaSketch expected, double threshold)`
Tests similarity of a measured ThetaSketch against an expected ThetaSketch.
`abstract void`
ThetaUnion.`union(ThetaSketch sketchIn)`
Perform a union operation with this ThetaUnion and the given on-heap sketch of the Theta Family.
`CompactThetaSketch`
ThetaUnion.`union(ThetaSketch sketchA, ThetaSketch sketchB)`
This implements a stateless, pair-wise union operation.
`abstract CompactThetaSketch`
ThetaUnion.`union(ThetaSketch sketchA, ThetaSketch sketchB, boolean dstOrdered, MemorySegment dstSeg)`
This implements a stateless, pair-wise union operation.

## Uses of ThetaSketch in org.apache.datasketches.thetacommon

Methods in org.apache.datasketches.thetacommon with parameters of type ThetaSketch
Modifier and Type
Method
Description
`static double`
BoundsOnRatiosInThetaSketchedSets.`getEstimateOfBoverA(ThetaSketch sketchA, ThetaSketch sketchB)`
Gets the estimate for B over A
`static <S extends Summary>
double`
BoundsOnRatiosInTupleSketchedSets.`getEstimateOfBoverA(TupleSketch<S> sketchA, ThetaSketch sketchB)`
Gets the estimate for B over A
`static double`
BoundsOnRatiosInThetaSketchedSets.`getLowerBoundForBoverA(ThetaSketch sketchA, ThetaSketch sketchB)`
Gets the approximate lower bound for B over A based on a 95% confidence interval
`static <S extends Summary>
double`
BoundsOnRatiosInTupleSketchedSets.`getLowerBoundForBoverA(TupleSketch<S> sketchA, ThetaSketch sketchB)`
Gets the approximate lower bound for B over A based on a 95% confidence interval
`static double`
BoundsOnRatiosInThetaSketchedSets.`getUpperBoundForBoverA(ThetaSketch sketchA, ThetaSketch sketchB)`
Gets the approximate upper bound for B over A based on a 95% confidence interval
`static <S extends Summary>
double`
BoundsOnRatiosInTupleSketchedSets.`getUpperBoundForBoverA(TupleSketch<S> sketchA, ThetaSketch sketchB)`
Gets the approximate upper bound for B over A based on a 95% confidence interval

## Uses of ThetaSketch in org.apache.datasketches.tuple

Methods in org.apache.datasketches.tuple with parameters of type ThetaSketch
Modifier and Type
Method
Description
`static <S extends Summary>
CompactTupleSketch<S>`
TupleAnotB.`aNotB(TupleSketch<S> skA, ThetaSketch skB)`
Returns the A-and-not-B set operation on a TupleSketch and a ThetaSketch.
`static <S extends Summary>
boolean`
JaccardSimilarity.`dissimilarityTest(TupleSketch<S> measured, ThetaSketch expected, S summary, SummarySetOperations<S> summarySetOps, double threshold)`
Tests dissimilarity of a measured TupleSketch against an expected ThetaSketch.
`static <S extends Summary>
boolean`
JaccardSimilarity.`exactlyEqual(TupleSketch<S> sketchA, ThetaSketch sketchB, S summary, SummarySetOperations<S> summarySetOps)`
Returns true if the two given sketches have exactly the same hash values and the same theta values.
`void`
TupleIntersection.`intersect(ThetaSketch thetaSketch, S summary)`
Performs a stateful intersection of the internal set with the given ThetaSketch by combining entries using the hashes from the ThetaSketch and summary values from the given summary and rules from the summarySetOps defined by the TupleIntersection constructor.
`CompactTupleSketch<S>`
TupleIntersection.`intersect(TupleSketch<S> tupleSketch, ThetaSketch thetaSketch, S summary)`
Perform a stateless intersect set operation on a TupleSketch and a ThetaSketch and returns the result as an unordered CompactTupleSketch on the heap.
`static <S extends Summary>
double[]`
JaccardSimilarity.`jaccard(TupleSketch<S> sketchA, ThetaSketch sketchB, S summary, SummarySetOperations<S> summarySetOps)`
Computes the Jaccard similarity index with upper and lower bounds.
`void`
TupleAnotB.`notB(ThetaSketch skB)`
This is part of a multistep, stateful TupleAnotB operation and sets the given ThetaSketch as the second (or n+1th) argument B of A-AND-NOT-B.
`static <S extends Summary>
boolean`
JaccardSimilarity.`similarityTest(TupleSketch<S> measured, ThetaSketch expected, S summary, SummarySetOperations<S> summarySetOps, double threshold)`
Tests similarity of a measured TupleSketch against an expected ThetaSketch.
`void`
TupleUnion.`union(ThetaSketch thetaSketch, S summary)`
Performs a stateful union of the internal set with the given ThetaSketch by combining entries using the hashes from the ThetaSketch and summary values from the given summary.
`CompactTupleSketch<S>`
TupleUnion.`union(TupleSketch<S> tupleSketch, ThetaSketch thetaSketch, S summary)`
Perform a stateless, pair-wise union operation between a tupleSketch and a ThetaSketch.