Class SetOperationCornerCases

java.lang.Object
org.apache.datasketches.thetacommon.SetOperationCornerCases

public class SetOperationCornerCases extends Object
Simplifies and speeds up set operations by resolving specific corner cases.
Author:
Lee Rhodes
  • Constructor Details

    • SetOperationCornerCases

      public SetOperationCornerCases()
  • Method Details

    • createCornerCaseId

      public static int createCornerCaseId(long thetaLongA, int countA, boolean emptyA, long thetaLongB, int countB, boolean emptyB)
      Creates the CornerCase ID
      Parameters:
      thetaLongA - the theta of A as a long
      countA - the count of A
      emptyA - true if A is empty
      thetaLongB - the theta of B as a long
      countB - the count of B
      emptyB - true if B is empty
      Returns:
      the Corner Case ID
    • sketchStateId

      public static int sketchStateId(boolean isEmpty, int numRetained, long thetaLong)
      Returns the sketch state ID
      Parameters:
      isEmpty - true if empty
      numRetained - the number of items retained
      thetaLong - the value of theta as a long
      Returns:
      the sketch state ID