Skip to content

Commit cf427ae

Browse files
authored
chore: tidy comment and code of CpcSketch (#722)
Signed-off-by: tison <wander4096@gmail.com>
1 parent 29837cc commit cf427ae

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/main/java/org/apache/datasketches/cpc/CpcSketch.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -621,7 +621,7 @@ private static void updateWindowed(final CpcSketch sketch, final int rowCol) {
621621
assert ((sketch.windowOffset >= 0) && (sketch.windowOffset <= 56));
622622
final int k = 1 << sketch.lgK;
623623
final long c32pre = sketch.numCoupons << 5;
624-
assert c32pre >= (3L * k); // C < 3K/32, in other words flavor >= HYBRID
624+
assert c32pre >= (3L * k); // C >= 3K/32, in other words flavor >= HYBRID
625625
final long c8pre = sketch.numCoupons << 3;
626626
final int w8pre = sketch.windowOffset << 3;
627627
assert c8pre < ((27L + w8pre) * k); // C < (K * 27/8) + (K * windowOffset)

src/main/java/org/apache/datasketches/cpc/CpcUnion.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ public CpcUnion(final int lgK, final long seed) {
124124
bitMatrix = null;
125125
// We begin with the accumulator holding an EMPTY_MERGED sketch object.
126126
// As an optimization the accumulator could start as NULL, but that would require changes elsewhere.
127-
accumulator = new CpcSketch(lgK);
127+
accumulator = new CpcSketch(lgK, seed);
128128
}
129129

130130
/**

src/main/java/org/apache/datasketches/cpc/PreambleUtil.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ private PreambleUtil() {}
152152
static final int RESERVED_FLAG_MASK = 1; //Reserved.
153153
static final int COMPRESSED_FLAG_MASK = 2;
154154
static final int HIP_FLAG_MASK = 4;
155-
static final int SUP_VAL_FLAG_MASK = 8; //num Suprising Values > 0
155+
static final int SUP_VAL_FLAG_MASK = 8; //num Surprising Values > 0
156156
static final int WINDOW_FLAG_MASK = 16;//window length > 0
157157

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

0 commit comments

Comments
 (0)