Skip to content
Permalink
Browse files
Renaming of enum constants to be consistent with website documentation.
  • Loading branch information
leerho committed Nov 1, 2021
1 parent 370df32 commit 80b990c45b092f2e98f551df729b2c06f8226061
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 40 deletions.
@@ -27,7 +27,7 @@ public class SetOperationCornerCases {

public enum InterResult {
NEW_1_0_T(1, "New{1.0, 0, T}"),
NEW_MIN_0_F(2, "New{MinTheta, 0, F}"),
RESULTDEGEN_MIN_0_F(2, "New{MinTheta, 0, F}"),
FULL_INTER(6, "Full Intersect");

private int interRid;
@@ -49,8 +49,8 @@ public String getDesc() {

public enum AnotbResult {
NEW_1_0_T(1, "New{1.0, 0, T}"),
NEW_MIN_0_F(2, "New{MinTheta, 0, F}"),
NEW_THA_0_F(3, "New{ThetaA, 0, F}"),
RESULTDEGEN_MIN_0_F(2, "New{MinTheta, 0, F}"),
RESULTDEGEN_THA_0_F(3, "New{ThetaA, 0, F}"),
SKA_TRIM(4, "Trim Sketch A by MinTheta"),
SKETCH_A(5, "Sketch A Exactly"),
FULL_ANOTB(7, "Full AnotB");
@@ -73,35 +73,60 @@ public String getDesc() {
}

public enum CornerCase {
ResultDegen_ResultDegen(0, "A{>1.0, 0, F} ; B{>1.0, 0, F}", InterResult.NEW_MIN_0_F, AnotbResult.NEW_MIN_0_F), //0
ResultDegen_NewDegen(01, "A{>1.0, 0, F} ; B{>1.0, 0, T}", InterResult.NEW_1_0_T, AnotbResult.NEW_THA_0_F), //1
ResultDegen_Estimation(02, "A{>1.0, 0, F} ; B{>1.0,>0, F}", InterResult.NEW_MIN_0_F, AnotbResult.NEW_MIN_0_F), //2
ResultDegen_New(05, "A{>1.0, 0, F} ; B{ 1.0, 0, T}", InterResult.NEW_1_0_T, AnotbResult.NEW_THA_0_F), //5
ResultDegen_Exact(06, "A{>1.0, 0, F} ; B{ 1.0,>0, F}", InterResult.NEW_MIN_0_F, AnotbResult.NEW_THA_0_F), //6

NewDegen_ResultDegen(010, "A{>1.0, 0, T} ; B{>1.0, 0, F}", InterResult.NEW_1_0_T, AnotbResult.NEW_1_0_T), //8
NewDegen_NewDegen(011, "A{>1.0, 0, T} ; B{>1.0, 0, T}", InterResult.NEW_1_0_T, AnotbResult.NEW_1_0_T), //9
NewDegen_Estimation(012, "A{>1.0, 0, T} ; B{>1.0,>0, F}", InterResult.NEW_1_0_T, AnotbResult.NEW_1_0_T), //10
NewDegen_New(015, "A{>1.0, 0, T} ; B{ 1.0, 0, T}", InterResult.NEW_1_0_T, AnotbResult.NEW_1_0_T), //13
NewDegen_Exact(016, "A{>1.0, 0, T} ; B{ 1.0,>0, F}", InterResult.NEW_1_0_T, AnotbResult.NEW_1_0_T), //14

Estimation_ResultDegen(020, "A{>1.0,>0, F} ; B{>1.0, 0, F}", InterResult.NEW_MIN_0_F, AnotbResult.SKA_TRIM), //16
Estimation_NewDegen(021, "A{>1.0,>0, F} ; B{>1.0, 0, T}", InterResult.NEW_1_0_T, AnotbResult.SKETCH_A), //17
Estimation_Estimation(022, "A{>1.0,>0, F} ; B{>1.0,>0, F}", InterResult.FULL_INTER, AnotbResult.FULL_ANOTB), //18
Estimation_New(025, "A{>1.0,>0, F} ; B{ 1.0, 0, T}", InterResult.NEW_1_0_T, AnotbResult.SKETCH_A), //21
Estimation_Exact(026, "A{>1.0,>0, F} ; B{ 1.0,>0, F}", InterResult.FULL_INTER, AnotbResult.FULL_ANOTB), //22

New_ResultDegen(050, "A{ 1.0, 0, T} ; B{>1.0, 0, F}", InterResult.NEW_1_0_T, AnotbResult.NEW_1_0_T), //40
New_NewDegen(051, "A{ 1.0, 0, T} ; B{>1.0, 0, T}", InterResult.NEW_1_0_T, AnotbResult.NEW_1_0_T), //41
New_Estimation(052, "A{ 1.0, 0, T} ; B{>1.0,>0, F}", InterResult.NEW_1_0_T, AnotbResult.NEW_1_0_T), //42
New_New(055, "A{ 1.0, 0, T} ; B{ 1.0, 0, T}", InterResult.NEW_1_0_T, AnotbResult.NEW_1_0_T), //45
New_Exact(056, "A{ 1.0, 0, T} ; B{ 1.0,>0, F}", InterResult.NEW_1_0_T, AnotbResult.NEW_1_0_T), //46

Exact_ResultDegen(060, "A{ 1.0,>0, F} ; B{>1.0, 0, F}", InterResult.NEW_MIN_0_F, AnotbResult.SKA_TRIM), //48
Exact_NewDegen(061, "A{ 1.0,>0, F} ; B{>1.0, 0, T}", InterResult.NEW_1_0_T, AnotbResult.SKETCH_A), //49
Exact_Estimation(062, "A{ 1.0,>0, F} ; B{>1.0,>0, F}", InterResult.FULL_INTER, AnotbResult.FULL_ANOTB), //50
Exact_New(065, "A{ 1.0,>0, F} ; B{ 1.0, 0, T}", InterResult.NEW_1_0_T, AnotbResult.SKETCH_A), //53
Exact_Exact(066, "A{ 1.0,>0, F} ; B{ 1.0,>0, F}", InterResult.FULL_INTER, AnotbResult.FULL_ANOTB); //54
ResultDegen_ResultDegen(0, "A{>1.0, 0, F} ; B{>1.0, 0, F}",
InterResult.RESULTDEGEN_MIN_0_F, AnotbResult.RESULTDEGEN_MIN_0_F), //0
ResultDegen_NewDegen(01, "A{>1.0, 0, F} ; B{>1.0, 0, T}",
InterResult.NEW_1_0_T, AnotbResult.RESULTDEGEN_THA_0_F), //1
ResultDegen_Estimation(02, "A{>1.0, 0, F} ; B{>1.0,>0, F}",
InterResult.RESULTDEGEN_MIN_0_F, AnotbResult.RESULTDEGEN_MIN_0_F), //2
ResultDegen_New(05, "A{>1.0, 0, F} ; B{ 1.0, 0, T}",
InterResult.NEW_1_0_T, AnotbResult.RESULTDEGEN_THA_0_F), //5
ResultDegen_Exact(06, "A{>1.0, 0, F} ; B{ 1.0,>0, F}",
InterResult.RESULTDEGEN_MIN_0_F, AnotbResult.RESULTDEGEN_THA_0_F), //6

NewDegen_ResultDegen(010, "A{>1.0, 0, T} ; B{>1.0, 0, F}",
InterResult.NEW_1_0_T, AnotbResult.NEW_1_0_T), //8
NewDegen_NewDegen(011, "A{>1.0, 0, T} ; B{>1.0, 0, T}",
InterResult.NEW_1_0_T, AnotbResult.NEW_1_0_T), //9
NewDegen_Estimation(012, "A{>1.0, 0, T} ; B{>1.0,>0, F}",
InterResult.NEW_1_0_T, AnotbResult.NEW_1_0_T), //10
NewDegen_New(015, "A{>1.0, 0, T} ; B{ 1.0, 0, T}",
InterResult.NEW_1_0_T, AnotbResult.NEW_1_0_T), //13
NewDegen_Exact(016, "A{>1.0, 0, T} ; B{ 1.0,>0, F}",
InterResult.NEW_1_0_T, AnotbResult.NEW_1_0_T), //14

Estimation_ResultDegen(020, "A{>1.0,>0, F} ; B{>1.0, 0, F}",
InterResult.RESULTDEGEN_MIN_0_F, AnotbResult.SKA_TRIM), //16
Estimation_NewDegen(021, "A{>1.0,>0, F} ; B{>1.0, 0, T}",
InterResult.NEW_1_0_T, AnotbResult.SKETCH_A), //17
Estimation_Estimation(022, "A{>1.0,>0, F} ; B{>1.0,>0, F}",
InterResult.FULL_INTER, AnotbResult.FULL_ANOTB), //18
Estimation_New(025, "A{>1.0,>0, F} ; B{ 1.0, 0, T}",
InterResult.NEW_1_0_T, AnotbResult.SKETCH_A), //21
Estimation_Exact(026, "A{>1.0,>0, F} ; B{ 1.0,>0, F}",
InterResult.FULL_INTER, AnotbResult.FULL_ANOTB), //22

New_ResultDegen(050, "A{ 1.0, 0, T} ; B{>1.0, 0, F}",
InterResult.NEW_1_0_T, AnotbResult.NEW_1_0_T), //40
New_NewDegen(051, "A{ 1.0, 0, T} ; B{>1.0, 0, T}",
InterResult.NEW_1_0_T, AnotbResult.NEW_1_0_T), //41
New_Estimation(052, "A{ 1.0, 0, T} ; B{>1.0,>0, F}",
InterResult.NEW_1_0_T, AnotbResult.NEW_1_0_T), //42
New_New(055, "A{ 1.0, 0, T} ; B{ 1.0, 0, T}",
InterResult.NEW_1_0_T, AnotbResult.NEW_1_0_T), //45
New_Exact(056, "A{ 1.0, 0, T} ; B{ 1.0,>0, F}",
InterResult.NEW_1_0_T, AnotbResult.NEW_1_0_T), //46

Exact_ResultDegen(060, "A{ 1.0,>0, F} ; B{>1.0, 0, F}",
InterResult.RESULTDEGEN_MIN_0_F, AnotbResult.SKA_TRIM), //48
Exact_NewDegen(061, "A{ 1.0,>0, F} ; B{>1.0, 0, T}",
InterResult.NEW_1_0_T, AnotbResult.SKETCH_A), //49
Exact_Estimation(062, "A{ 1.0,>0, F} ; B{>1.0,>0, F}",
InterResult.FULL_INTER, AnotbResult.FULL_ANOTB), //50
Exact_New(065, "A{ 1.0,>0, F} ; B{ 1.0, 0, T}",
InterResult.NEW_1_0_T, AnotbResult.SKETCH_A), //53
Exact_Exact(066, "A{ 1.0,>0, F} ; B{ 1.0,>0, F}",
InterResult.FULL_INTER, AnotbResult.FULL_ANOTB); //54

private static final Map<Integer, CornerCase> idToCornerCaseMap = new HashMap<>();
private int id;
@@ -160,13 +160,13 @@ public void notB(final Sketch<S> skB) {
reset();
break;
}
case NEW_MIN_0_F: {
case RESULTDEGEN_MIN_0_F: {
reset();
thetaLong_ = min(thetaLong_, thetaLongB);
empty_ = false;
break;
}
case NEW_THA_0_F: {
case RESULTDEGEN_THA_0_F: {
empty_ = false;
curCount_ = 0;
//thetaLong_ is ok
@@ -233,13 +233,13 @@ public void notB(final org.apache.datasketches.theta.Sketch skB) {
reset();
break;
}
case NEW_MIN_0_F: {
case RESULTDEGEN_MIN_0_F: {
reset();
thetaLong_ = min(thetaLong_, thetaLongB);
empty_ = false;
break;
}
case NEW_THA_0_F: {
case RESULTDEGEN_THA_0_F: {
empty_ = false;
curCount_ = 0;
//thetaLong_ is ok
@@ -339,12 +339,12 @@ public static <S extends Summary> CompactSketch<S> aNotB(
result = new CompactSketch<>(null, null, Long.MAX_VALUE, true);
break;
}
case NEW_MIN_0_F: {
case RESULTDEGEN_MIN_0_F: {
final long thetaLong = min(thetaLongA, thetaLongB);
result = new CompactSketch<>(null, null, thetaLong, false);
break;
}
case NEW_THA_0_F: {
case RESULTDEGEN_THA_0_F: {
result = new CompactSketch<>(null, null, thetaLongA, false);
break;
}
@@ -431,12 +431,12 @@ public static <S extends Summary> CompactSketch<S> aNotB(
result = new CompactSketch<>(null, null, Long.MAX_VALUE, true);
break;
}
case NEW_MIN_0_F: {
case RESULTDEGEN_MIN_0_F: {
final long thetaLong = min(thetaLongA, thetaLongB);
result = new CompactSketch<>(null, null, thetaLong, false);
break;
}
case NEW_THA_0_F: {
case RESULTDEGEN_THA_0_F: {
result = new CompactSketch<>(null, null, thetaLongA, false);
break;
}

0 comments on commit 80b990c

Please sign in to comment.