Skip to content

Conversation

@tisonkun
Copy link
Member

This fixes #37. The current PR is for early review.

I plan to implement the following steps:

  1. PairTable (for storing sparse data)
  2. CpcSketch without union
    1. Empty state with empty data
    2. Sparse state with pair table
    3. Hybrid state with dense vector
    4. Pinned state with dense vector (with ICON estimator)
    5. Sliding state with dense vector
  3. Union
  4. Serde

Signed-off-by: tison <wander4096@gmail.com>
@tisonkun tisonkun marked this pull request as draft January 20, 2026 15:14
Signed-off-by: tison <wander4096@gmail.com>
Copy link
Member Author

Choose a reason for hiding this comment

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

We may not implement the merge function as the Java/C++ impl for PairTable but find another way to do the two-way merge. This is because in Rust, it's impossible to hold a mutable ref when an immutable ref is still in used, which is how PairTable::merge is used in practice:

    PairTable.merge(srcPairArr, 0, srcNumPairs,
        allPairs, srcNumPairs, numPairsFromArray,
        allPairs, 0);  // note the overlapping subarray trick

The real effect here is to perform a two-way merge of allPairs[srcNumPairs..numPairsFromArray] and srcPairArr. There should be a more proper way to do this in Rust.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement CpcSketch

1 participant