Procs
proc card(hlls: varargs[HLL]): int {....raises: [], tags: [].}
-
Returns the number of elements in the union of all given hlls. This is equivalent to union(hlls).len, but a little bit more performant.
See also:
Source Edit proc clear(hll: var HLL) {....raises: [], tags: [].}
- Removes all elements from hll (without freeing up memory, so it can be reused). Source Edit
proc getLen(hll: var HLL): int {....raises: [], tags: [].}
-
Returns the number of elements in hll. This will use cached cardinality if it's available, otherwise it will be computed and stored (so this call has side effects).
See also:
Source Edit proc incl[A](hll: var HLL; key: A): bool {.discardable.}
- Includes an element key in hll. Returns true if the data structure was modified by this operation. Source Edit
proc initHLL(sparseMaxBytes: int = 3000; exactMaxBytes: int = 0): HLL {. ...raises: [], tags: [].}
- Creates an HLL object. By default, HLL is created using sparse encoding (unless exactMaxBytes is greater than 0). This will be upgraded to the sparse/dense representation as needed. You can pass sparseMaxBytes/exactMaxBytes arguments to specify the actual thresholds. Source Edit
func len(hll: HLL): int {....raises: [], tags: [].}
-
Returns the number of elements in hll. This will use cached cardinality if it's available, but won't update it, so it's side-effect free.
See also:
Source Edit proc merge(hlls: varargs[HLL]): HLL {....raises: [], tags: [].}
-
Alias for union(hlls)
See also:
Source Edit proc toBytes(hll: HLL): seq[byte] {....raises: [], tags: [].}
-
Serializes hll to a byte array, so it can be stored and deserialized later.
See also:
Source Edit