Hyperloglog 增加部分注释 - #111
Open
ziruiLiu-g wants to merge 4 commits into
Open
Conversation
enjoy-binbin
approved these changes
Feb 22, 2023
enjoy-binbin
left a comment
Collaborator
There was a problem hiding this comment.
对位运算不是很熟悉,也还没有想着去搞懂 HLL 里的具体算法,所以中间部分计算 6 bits 部分没有细看
@huihuang-chen 也请帮忙看一眼
Comment on lines
+430
to
+432
| * * +--------+--------+--------+------// | ||
| * |11000000|22221111|33333322|55444444 | ||
| * +--------+--------+--------+------// |
Collaborator
There was a problem hiding this comment.
Suggested change
| * * +--------+--------+--------+------// | |
| * |11000000|22221111|33333322|55444444 | |
| * +--------+--------+--------+------// | |
| * +--------+--------+--------+------// | |
| * |11000000|22221111|33333322|55444444 | |
| * +--------+--------+--------+------// |
| * +--------+ +--------+ | ||
| * 下标为 0 的字节数组 下标为 1 的字节数组 | ||
| * | ||
| * 因此给寄存器重新设置值可以分为两部: |
Collaborator
There was a problem hiding this comment.
Suggested change
| * 因此给寄存器重新设置值可以分为两部: | |
| * 因此给寄存器重新设置值可以分为两步: |
Contributor
Author
|
这个pr有朋友来 review下嘛 |
Comment on lines
+839
to
+841
| * ZERO 操作码:占用 1 个字节,表示为 00xxxxxx,后六位表示有 2^6 + 1 个寄存器可以被设置为 0 | ||
| * XZERO 操作码:占用 2 个字节,表示为 01xxxxxx yyyyyyyy,表示有 2^14 + 1 个寄存器可以被设置为 0 | ||
| * VAL 操作码:占用 1 个字节,表示为 1vvvvvxx。vvvvv 表示值,范围为 1-2^5。后两位 xx 表示数量 2^2,整体表示为最多有 2^2 个寄存器被设置为值 vvvvv */ |
Collaborator
There was a problem hiding this comment.
这边应该是减 1 吧
Suggested change
| * ZERO 操作码:占用 1 个字节,表示为 00xxxxxx,后六位表示有 2^6 + 1 个寄存器可以被设置为 0 | |
| * XZERO 操作码:占用 2 个字节,表示为 01xxxxxx yyyyyyyy,表示有 2^14 + 1 个寄存器可以被设置为 0 | |
| * VAL 操作码:占用 1 个字节,表示为 1vvvvvxx。vvvvv 表示值,范围为 1-2^5。后两位 xx 表示数量 2^2,整体表示为最多有 2^2 个寄存器被设置为值 vvvvv */ | |
| * ZERO 操作码:占用 1 个字节,表示为 00xxxxxx,后六位表示有 2^6 -1 个寄存器可以被设置为 0 | |
| * XZERO 操作码:占用 2 个字节,表示为 01xxxxxx yyyyyyyy,表示有 2^14 -1 个寄存器可以被设置为 0 | |
| * VAL 操作码:占用 1 个字节,表示为 1vvvvvxx。vvvvv 表示值,范围为 1 到 (2^5 -1)。后两位 xx 表示数量 2^2,整体表示为最多有 2^2 -1 个寄存器被设置为值 vvvvv */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
写完发现另一位朋友2月8号已经提交了大部分 hyperloglog 的内容
这里加上我写的部分内容