davecromberge commented on a change in pull request #369:
URL: https://github.com/apache/datasketches-java/pull/369#discussion_r742037422
##########
File path: src/main/java/org/apache/datasketches/tuple/AnotB.java
##########
@@ -143,19 +142,58 @@ public void setA(final Sketch<S> skA) {
*
* @param skB The incoming Tuple sketch for the second (or following)
argument <i>B</i>.
*/
+ @SuppressWarnings("unchecked")
public void notB(final Sketch<S> skB) {
- if (empty_ || skB == null || skB.isEmpty() || hashArr_ == null) { return; }
- //skB is not empty
- final long thetaLongB = skB.getThetaLong();
- thetaLong_ = Math.min(thetaLong_, thetaLongB);
-
- //process B
- final DataArrays<S> daB = getResultArraysTuple(thetaLong_, curCount_,
hashArr_, summaryArr_, skB);
- hashArr_ = daB.hashArr;
- summaryArr_ = daB.summaryArr;
+ if (skB == null) { return; } //ignore
- curCount_ = hashArr_.length;
- empty_ = curCount_ == 0 && thetaLong_ == Long.MAX_VALUE;
+ final long thetaLongB = skB.getThetaLong();
+ final int countB = skB.getRetainedEntries();
+ final boolean emptyB = skB.isEmpty();
+
+ final int id =
+ SetOperationCornerCases.createCornerCaseId(thetaLong_, curCount_,
empty_, thetaLongB, countB, emptyB);
+ final CornerCase cCase = CornerCase.idToCornerCase(id);
+ final AnotbResult anotbResult = cCase.getAnotbResult();
+
+ switch (anotbResult) {
+ case NEW_1_0_T: {
+ reset();
+ break;
Review comment:
Thanks for the additional details, I understand the reason now.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]