Liking cljdoc? Tell your friends :D

vaelii.impl.types.postings

The tiered handle posting — a sorted int[] while small, a RoaringBitmap past promote — and the intersections over it, as a held namespace (vaelii.impl.types.prover states what that means). IntPostings mutates its own fields, which only its inline methods can do, so the type and the code it calls live here together. The dense index backend (vaelii.impl.dense-kv), the columnar trie and the dense TMS's adjacency columns store their handle sets in it.

The tiered handle posting — a sorted `int[]` while small, a `RoaringBitmap` past
`promote` — and the intersections over it, as a held namespace
(`vaelii.impl.types.prover` states what that means).  `IntPostings` mutates its own
fields, which only its inline methods can do, so the type and the code it calls live
here together.  The dense index backend (`vaelii.impl.dense-kv`), the columnar trie and
the dense TMS's adjacency columns store their handle sets in it.
raw docstring

as-setclj

(as-set v)
source

int-postingsclj

(int-postings)
source

intersect-postingsclj

(intersect-postings postings)

The intersection of postings — each an IntPostings or an ascending int[] — as a Clojure set of Longs.

Smallest first, which is not the tie-break it looks like: the accumulator can only shrink, so seeding it with the narrowest column is what keeps every later step a probe of a few entries rather than a scan of a hot one. An accumulator that empties stops the fold, since nothing after it can put a handle back.

Public because vaelii.impl.dense-roots holds the same postings under its own keys and must narrow them the same way.

The intersection of `postings` — each an `IntPostings` or an ascending `int[]` — as a
Clojure set of Longs.

**Smallest first**, which is not the tie-break it looks like: the accumulator can only
shrink, so seeding it with the narrowest column is what keeps every later step a probe of
a few entries rather than a scan of a hot one.  An accumulator that empties stops the
fold, since nothing after it can put a handle back.

Public because `vaelii.impl.dense-roots` holds the same postings under its own keys and
must narrow them the same way.
sourceraw docstring

IPostingscljprotocol

padd!clj

(padd! p h)

Add handle h (in place); return p.

Add handle h (in place); return p.

pandclj

(pand p acc)

acc — a sorted int[] or a RoaringBitmap — narrowed to the handles this posting also holds, as a fresh accumulator. Dispatches on both representations: two hot postings meet in RoaringBitmap/and, two cold ones in a sorted merge, and a mixed pair probes the cold side's entries into the bitmap. So neither side is materialized, and neither side is mutated — RoaringBitmap.and the instance method would mutate its receiver, and a query that quietly shrank a posting is a corrupt index the oracle finds late rather than never.

`acc` — a sorted `int[]` or a `RoaringBitmap` — narrowed to the handles this posting
also holds, as a **fresh** accumulator.  Dispatches on both representations: two hot
postings meet in `RoaringBitmap/and`, two cold ones in a sorted merge, and a mixed
pair probes the cold side's entries into the bitmap.  So neither side is materialized,
and neither side is mutated — `RoaringBitmap.and` the *instance* method would mutate
its receiver, and a query that quietly shrank a posting is a corrupt index the oracle
finds late rather than never.

pcardclj

(pcard p)

Cardinality.

Cardinality.

pcontains?clj

(pcontains? p h)

Is handle h present? A binary search on the int[], or the bitmap's own test — the O(log n) / O(1) probe that answers membership without building the set pmembers builds, which is what an index gate calling it per firing needs.

Is handle h present?  A binary search on the `int[]`, or the bitmap's own test —
the O(log n) / O(1) probe that answers membership without building the set
`pmembers` builds, which is what an index gate calling it per firing needs.

pintsclj

(pints p)

A fresh sorted int[] of the handles — the boxing-free read, for a caller that iterates rather than set-tests. Fresh (never the live array) because callers walk it while mutating the posting, which is exactly what vaelii.impl.dense-jtms does when it pushes a node's justifications onto a worklist.

A fresh sorted `int[]` of the handles — the boxing-free read, for a caller that
iterates rather than set-tests.  Fresh (never the live array) because callers walk
it while mutating the posting, which is exactly what `vaelii.impl.dense-jtms` does
when it pushes a node's justifications onto a worklist.

pmembersclj

(pmembers p)

A fresh Clojure set of the handles (as Longs).

A fresh Clojure set of the handles (as Longs).

prem!clj

(prem! p h)

Remove handle h (in place); return p.

Remove handle h (in place); return p.

pseedclj

(pseed p)

This posting as an intersection accumulator — its own int[] or its own RoaringBitmap, handed back rather than copied. Safe because pand allocates its result on every arm, so nothing downstream can write through it.

This posting as an intersection accumulator — its own `int[]` or its own
`RoaringBitmap`, handed back rather than copied.  Safe because `pand` allocates its
result on every arm, so nothing downstream can write through it.
source

postings-setclj

(postings-set p)

A posting — an IntPostings or an ascending int[] — as a fresh Clojure set of Longs, for the mixed fold a caller falls back to when one of the keys is not a handle family.

A posting — an `IntPostings` or an ascending `int[]` — as a fresh Clojure set of Longs,
for the mixed fold a caller falls back to when one of the keys is not a handle family.
sourceraw docstring

promoteclj

source

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close