use of org.apache.datasketches.theta.UpdateSketch in project sketches-core by DataSketches.
the class CornerCaseTupleSetOperationsTest method exactDegenerate.
@Test
public void exactDegenerate() {
IntegerSketch tupleA = getTupleSketch(SkType.EXACT, 0, LT_LOWP_V);
// entries = 0
IntegerSketch tupleB = getTupleSketch(SkType.DEGENERATE, LOWP_FLT, GT_LOWP_V);
UpdateSketch thetaB = getThetaSketch(SkType.DEGENERATE, LOWP_FLT, GT_LOWP_V);
final double expectedIntersectTheta = LOWP_FLT;
final int expectedIntersectCount = 0;
final boolean expectedIntersectEmpty = false;
final double expectedAnotbTheta = LOWP_FLT;
final int expectedAnotbCount = 1;
final boolean expectedAnotbEmpty = false;
final double expectedUnionTheta = LOWP_FLT;
final int expectedUnionCount = 1;
final boolean expectedUnionEmpty = false;
checks(tupleA, tupleB, thetaB, expectedIntersectTheta, expectedIntersectCount, expectedIntersectEmpty, expectedAnotbTheta, expectedAnotbCount, expectedAnotbEmpty, expectedUnionTheta, expectedUnionCount, expectedUnionEmpty);
}
use of org.apache.datasketches.theta.UpdateSketch in project sketches-core by DataSketches.
the class CornerCaseTupleSetOperationsTest method exactEmpty.
// =================================
@Test
public void exactEmpty() {
IntegerSketch tupleA = getTupleSketch(SkType.EXACT, 0, GT_MIDP_V);
IntegerSketch tupleB = getTupleSketch(SkType.EMPTY, 0, 0);
UpdateSketch thetaB = getThetaSketch(SkType.EMPTY, 0, 0);
final double expectedIntersectTheta = 1.0;
final int expectedIntersectCount = 0;
final boolean expectedIntersectEmpty = true;
final double expectedAnotbTheta = 1.0;
final int expectedAnotbCount = 1;
final boolean expectedAnotbEmpty = false;
final double expectedUnionTheta = 1.0;
final int expectedUnionCount = 1;
final boolean expectedUnionEmpty = false;
checks(tupleA, tupleB, thetaB, expectedIntersectTheta, expectedIntersectCount, expectedIntersectEmpty, expectedAnotbTheta, expectedAnotbCount, expectedAnotbEmpty, expectedUnionTheta, expectedUnionCount, expectedUnionEmpty);
}
use of org.apache.datasketches.theta.UpdateSketch in project sketches-core by DataSketches.
the class CornerCaseTupleSetOperationsTest method degenerateEmpty.
// =================================
@Test
public void degenerateEmpty() {
// entries = 0
IntegerSketch tupleA = getTupleSketch(SkType.DEGENERATE, LOWP_FLT, GT_LOWP_V);
IntegerSketch tupleB = getTupleSketch(SkType.EMPTY, 0, 0);
UpdateSketch thetaB = getThetaSketch(SkType.EMPTY, 0, 0);
final double expectedIntersectTheta = 1.0;
final int expectedIntersectCount = 0;
final boolean expectedIntersectEmpty = true;
final double expectedAnotbTheta = LOWP_FLT;
final int expectedAnotbCount = 0;
final boolean expectedAnotbEmpty = false;
final double expectedUnionTheta = LOWP_FLT;
final int expectedUnionCount = 0;
final boolean expectedUnionEmpty = false;
checks(tupleA, tupleB, thetaB, expectedIntersectTheta, expectedIntersectCount, expectedIntersectEmpty, expectedAnotbTheta, expectedAnotbCount, expectedAnotbEmpty, expectedUnionTheta, expectedUnionCount, expectedUnionEmpty);
}
use of org.apache.datasketches.theta.UpdateSketch in project sketches-core by DataSketches.
the class CornerCaseTupleSetOperationsTest method emptyEmpty.
// =================================
@Test
public void emptyEmpty() {
IntegerSketch tupleA = getTupleSketch(SkType.EMPTY, 0, 0);
IntegerSketch tupleB = getTupleSketch(SkType.EMPTY, 0, 0);
UpdateSketch thetaB = getThetaSketch(SkType.EMPTY, 0, 0);
final double expectedIntersectTheta = 1.0;
final int expectedIntersectCount = 0;
final boolean expectedIntersectEmpty = true;
final double expectedAnotbTheta = 1.0;
final int expectedAnotbCount = 0;
final boolean expectedAnotbEmpty = true;
final double expectedUnionTheta = 1.0;
final int expectedUnionCount = 0;
final boolean expectedUnionEmpty = true;
checks(tupleA, tupleB, thetaB, expectedIntersectTheta, expectedIntersectCount, expectedIntersectEmpty, expectedAnotbTheta, expectedAnotbCount, expectedAnotbEmpty, expectedUnionTheta, expectedUnionCount, expectedUnionEmpty);
}
use of org.apache.datasketches.theta.UpdateSketch in project sketches-core by DataSketches.
the class CornerCaseTupleSetOperationsTest method degenerateEstimation.
@Test
public void degenerateEstimation() {
// entries = 0
IntegerSketch tupleA = getTupleSketch(SkType.DEGENERATE, MIDP_FLT, GT_MIDP_V);
IntegerSketch tupleB = getTupleSketch(SkType.ESTIMATION, LOWP_FLT, LT_LOWP_V);
UpdateSketch thetaB = getThetaSketch(SkType.ESTIMATION, LOWP_FLT, LT_LOWP_V);
final double expectedIntersectTheta = LOWP_FLT;
final int expectedIntersectCount = 0;
final boolean expectedIntersectEmpty = false;
final double expectedAnotbTheta = LOWP_FLT;
final int expectedAnotbCount = 0;
final boolean expectedAnotbEmpty = false;
final double expectedUnionTheta = LOWP_FLT;
final int expectedUnionCount = 1;
final boolean expectedUnionEmpty = false;
checks(tupleA, tupleB, thetaB, expectedIntersectTheta, expectedIntersectCount, expectedIntersectEmpty, expectedAnotbTheta, expectedAnotbCount, expectedAnotbEmpty, expectedUnionTheta, expectedUnionCount, expectedUnionEmpty);
}
Aggregations