Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/main/java/org/apache/datasketches/cpc/CpcSketch.java
Original file line number Diff line number Diff line change
Expand Up @@ -621,7 +621,7 @@ private static void updateWindowed(final CpcSketch sketch, final int rowCol) {
assert ((sketch.windowOffset >= 0) && (sketch.windowOffset <= 56));
final int k = 1 << sketch.lgK;
final long c32pre = sketch.numCoupons << 5;
assert c32pre >= (3L * k); // C < 3K/32, in other words flavor >= HYBRID
assert c32pre >= (3L * k); // C >= 3K/32, in other words flavor >= HYBRID
final long c8pre = sketch.numCoupons << 3;
final int w8pre = sketch.windowOffset << 3;
assert c8pre < ((27L + w8pre) * k); // C < (K * 27/8) + (K * windowOffset)
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/apache/datasketches/cpc/CpcUnion.java
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ public CpcUnion(final int lgK, final long seed) {
bitMatrix = null;
// We begin with the accumulator holding an EMPTY_MERGED sketch object.
// As an optimization the accumulator could start as NULL, but that would require changes elsewhere.
accumulator = new CpcSketch(lgK);
accumulator = new CpcSketch(lgK, seed);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can be a bug fix.

}

/**
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/apache/datasketches/cpc/PreambleUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ private PreambleUtil() {}
static final int RESERVED_FLAG_MASK = 1; //Reserved.
static final int COMPRESSED_FLAG_MASK = 2;
static final int HIP_FLAG_MASK = 4;
static final int SUP_VAL_FLAG_MASK = 8; //num Suprising Values > 0
static final int SUP_VAL_FLAG_MASK = 8; //num Surprising Values > 0
static final int WINDOW_FLAG_MASK = 16;//window length > 0

//PREAMBLE SIZE
Expand Down Expand Up @@ -253,7 +253,7 @@ static boolean isCompressed(final MemorySegment seg) {
* Do not change the order.
*
* <p>Note: NUM_SV has dual meanings: In sparse and hybrid flavors it is equivalent to
* numCoupons so it isn't stored separately. In pinned and sliding flavors is is the
* numCoupons so it isn't stored separately. In pinned and sliding flavors is the
* numSV of the PairTable, which stores only surprising values.</p>
*/
enum HiField { NUM_COUPONS, NUM_SV, KXP, HIP_ACCUM, SV_LENGTH_INTS, W_LENGTH_INTS, SV_STREAM,
Expand Down
Loading