Leaf: keys[] :: array of values
Node: pointers[] :: links to children nodes keys[] :: max value for whole subtree node.keys[i] == max(node.pointers[i].keys) All arrays are 64..128 elements, inclusive
BTSet: root :: Node or Leaf shift :: path bit-shift of root level, == (depth - 1) * level-shift cnt :: size of a set, integer, rolling comparator :: comparator used for ordering meta :: clojure meta map __hash :: hash code, same as for clojure collections, on-demand, cached
Path: conceptually a vector of indexes from root to leaf value, but encoded in a single int. E.g. we have path [7 53 11] representing root.pointers[7].pointers[3].keys[11]. In our case level-shift is 8, meaning each index will take 8 bits: (7 << 16) | (53 << 8) | 11 = 472331 0000 0111 0011 0101 0000 1011
Iter: set :: Set this iterator belongs to left :: Current path right :: Right bound path (exclusive) keys :: Cached ref for keys array for a leaf idx :: Cached idx in keys array Keys and idx are cached for fast iteration inside a leaf
B+ tree ------- Leaf: keys[] :: array of values Node: pointers[] :: links to children nodes keys[] :: max value for whole subtree node.keys[i] == max(node.pointers[i].keys) All arrays are 64..128 elements, inclusive BTSet: root :: Node or Leaf shift :: path bit-shift of root level, == (depth - 1) * level-shift cnt :: size of a set, integer, rolling comparator :: comparator used for ordering meta :: clojure meta map __hash :: hash code, same as for clojure collections, on-demand, cached Path: conceptually a vector of indexes from root to leaf value, but encoded in a single int. E.g. we have path [7 53 11] representing root.pointers[7].pointers[3].keys[11]. In our case level-shift is 8, meaning each index will take 8 bits: (7 << 16) | (53 << 8) | 11 = 472331 0000 0111 0011 0101 0000 1011 Iter: set :: Set this iterator belongs to left :: Current path right :: Right bound path (exclusive) keys :: Cached ref for keys array for a leaf idx :: Cached idx in keys array Keys and idx are cached for fast iteration inside a leaf
(-rpath node level)
Returns rightmost path possible starting from node and going deeper
Returns rightmost path possible starting from node and going deeper
(-rseek set key)
Returns path to the first element that is > key.
If all elements in a set are <= key, returns (-rpath set) + 1
.
It’s a virtual path that is bigger than any path in a tree
Returns path to the first element that is > key. If all elements in a set are <= key, returns `(-rpath set) + 1`. It’s a virtual path that is bigger than any path in a tree
(-seek set key)
Returns path to first element >= key, or -1 if all elements in a set < key
Returns path to first element >= key, or -1 if all elements in a set < key
(btset-iter set)
Iterator that represents whole set
Iterator that represents whole set
(node-conj _ cmp key)
(node-disj _ cmp key root? left right)
(node-len _)
(node-lim-key _)
(node-lookup _ cmp key)
(node-merge _ next)
(node-merge-n-split _ next)
(next-path set path)
Returns path representing next item after path
in natural traversal order,
or -1 if end of tree has been reached
Returns path representing next item after `path` in natural traversal order, or -1 if end of tree has been reached
(prev-path set path)
Returns path representing previous item before path
in natural traversal order,
or -1 if path
was already beginning of a tree
Returns path representing previous item before `path` in natural traversal order, or -1 if `path` was already beginning of a tree
(return-array a1)
(return-array a1 a2)
(return-array a1 a2 a3)
Drop non-nil references and return array of arguments
Drop non-nil references and return array of arguments
(slice set key)
(slice set key-from key-to)
When called with single key, returns iterator over set that contains all elements equal to the key. When called with two keys (range), returns iterator for all X where key-from <= X <= key-to
When called with single key, returns iterator over set that contains all elements equal to the key. When called with two keys (range), returns iterator for all X where key-from <= X <= key-to
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close