Liking cljdoc? Tell your friends :D

me.tonsky.persistent-sorted-set

A B-tree based persistent sorted set. Supports transients, custom comparators, fast iteration, efficient slices (iterator over a part of the set) and reverse slices. Almost a drop-in replacement for [[clojure.core/sorted-set]], the only difference being this one can’t store nil.

A B-tree based persistent sorted set. Supports transients, custom comparators, fast iteration, efficient slices (iterator over a part of the set) and reverse slices. Almost a drop-in replacement for [[clojure.core/sorted-set]], the only difference being this one can’t store nil.
raw docstring

-slicecljs

(-slice set key-from key-to comparator)

alter-btsetcljs

(alter-btset set root shift cnt)

arr-map-inplacecljs

(arr-map-inplace f arr)

arr-partition-approxcljs

(arr-partition-approx min-len max-len arr)

Splits arr into arrays of size between min-len and max-len, trying to stick to (min+max)/2

Splits `arr` into arrays of size between min-len and max-len,
trying to stick to (min+max)/2
raw docstring

bit-maskcljs


bits-per-levelcljs

tunable param

tunable param
raw docstring

childcljs

(child node idx storage)

conjclj/s≠

(conj set key cmp)
clj

Analogue to [[clojure.core/conj]] but with comparator that overrides the one stored in set.

Analogue to [[clojure.core/conj]] but with comparator that overrides the one stored in set.
cljs

Analogue to [[clojure.core/conj]] with comparator that overrides the one stored in set.

Analogue to [[clojure.core/conj]] with comparator that overrides the one stored in set.
raw docstring

disjclj/s

(disj set key cmp)

Analogue to [[clojure.core/disj]] with comparator that overrides the one stored in set.

Analogue to [[clojure.core/disj]] with comparator that overrides the one stored in set.
raw docstring

empty-pathcljs


est-countcljs

(est-count iter)

factorscljs


from-sequentialclj/s≠

clj
(from-sequential cmp keys)
(from-sequential cmp keys opts)
cljs
(from-sequential cmp seq)

Create a set with custom comparator and a collection of keys. Useful when you don’t want to call [[clojure.core/apply]] on sorted-set-by.

Create a set with custom comparator and a collection of keys. Useful when you don’t want to call [[clojure.core/apply]] on [[sorted-set-by]].
raw docstring

from-sorted-arrayclj/s≠

clj
(from-sorted-array cmp keys)
(from-sorted-array cmp keys len)
(from-sorted-array cmp keys len opts)
cljs
(from-sorted-array cmp arr)
(from-sorted-array cmp arr _len)
(from-sorted-array cmp arr _len opts)

Fast path to create a set if you already have a sorted array of elements on your hands.

Fast path to create a set if you already have a sorted array of elements on your hands.
raw docstring

IItercljsprotocol

-copycljs

(-copy this left right)

INodecljsprotocol

node-childcljs

(node-child _ idx storage)

node-conjcljs

(node-conj _ cmp key storage)

node-disjcljs

(node-disj _ cmp key root? left right storage)

node-lencljs

(node-len _)

node-lim-keycljs

(node-lim-key _)

node-lookupcljs

(node-lookup _ cmp key storage)

node-mergecljs

(node-merge _ next storage)

node-merge-n-splitcljs

(node-merge-n-split _ next)

IRootcljsprotocol

-ensure-root-nodecljs

(-ensure-root-node _)

ISeekcljsprotocol

-seekcljs

(-seek this key)
(-seek this key comparator)

IStorecljsprotocol

store-auxcljs

(store-aux this storage)

itercljs

(iter set left right)

max-lencljs


max-safe-levelcljs


max-safe-pathcljs

js limitation for bit ops

js limitation for bit ops
raw docstring

min-lencljs


new-leafcljs

(new-leaf keys)
(new-leaf keys address)
(new-leaf keys address dirty)

new-nodecljs

(new-node keys children addresses)
(new-node keys children addresses address)
(new-node keys children addresses address dirty?)

restoreclj/s

(restore address storage)
(restore address storage opts)

Constructs lazily-loaded set from storage and root address. Supports all operations that normal in-memory impl would, will fetch missing nodes by calling IStorage::restore when needed

Constructs lazily-loaded set from storage and root address.
Supports all operations that normal in-memory impl would,
will fetch missing nodes by calling IStorage::restore when needed
raw docstring

restore-byclj/s≠

clj
(restore-by cmp address storage)
(restore-by cmp address storage opts)
cljs
(restore-by cmp address storage)
(restore-by cmp address storage {:keys [set-metadata]})

Constructs lazily-loaded set from storage, root address and custom comparator. Supports all operations that normal in-memory impl would, will fetch missing nodes by calling IStorage::restore when needed

Constructs lazily-loaded set from storage, root address and custom comparator.
Supports all operations that normal in-memory impl would,
will fetch missing nodes by calling IStorage::restore when needed
raw docstring

ritercljs

(riter set left right)

rsliceclj/s≠

clj
(rslice set from to)
(rslice set from to cmp)

A reverse iterator for part of the set with provided boundaries. (rslice set from to) returns backwards iterator for all Xs where from <= X <= to. (rslice set from nil) returns backwards iterator for all Xs where X <= from. Optionally pass in comparator that will override the one that set uses. Supports efficient [[clojure.core/rseq]].

A reverse iterator for part of the set with provided boundaries.
`(rslice set from to)` returns backwards iterator for all Xs where from <= X <= to.
`(rslice set from nil)` returns backwards iterator for all Xs where X <= from.
Optionally pass in comparator that will override the one that set uses. Supports efficient [[clojure.core/rseq]].
cljs
(rslice set key)
(rslice set key-from key-to)
(rslice set key-from key-to comparator)

A reverse iterator for part of the set with provided boundaries. (rslice set from to) returns backwards iterator for all Xs where from <= X <= to. Optionally pass in comparator that will override the one that set uses. Supports efficient [[clojure.core/rseq]].

A reverse iterator for part of the set with provided boundaries.
`(rslice set from to)` returns backwards iterator for all Xs where from <= X <= to.
Optionally pass in comparator that will override the one that set uses. Supports efficient [[clojure.core/rseq]].
raw docstring

seekclj/s

(seek seq to)
(seek seq to cmp)

An efficient way to seek to a specific key in a seq (either returned by [[clojure.core.seq]] or a slice.) (seek (seq set) to) returns iterator for all Xs where to <= X. Optionally pass in comparator that will override the one that set uses.

An efficient way to seek to a specific key in a seq (either returned by [[clojure.core.seq]] or a slice.)
`(seek (seq set) to)` returns iterator for all Xs where to <= X.
Optionally pass in comparator that will override the one that set uses.
raw docstring

settingsclj/s

(settings set)

sliceclj/s≠

clj
(slice set from to)
(slice set from to cmp)

An iterator for part of the set with provided boundaries. (slice set from to) returns iterator for all Xs where from <= X <= to. (slice set from nil) returns iterator for all Xs where X >= from. Optionally pass in comparator that will override the one that set uses. Supports efficient [[clojure.core/rseq]].

An iterator for part of the set with provided boundaries.
`(slice set from to)` returns iterator for all Xs where from <= X <= to.
`(slice set from nil)` returns iterator for all Xs where X >= from.
Optionally pass in comparator that will override the one that set uses. Supports efficient [[clojure.core/rseq]].
cljs
(slice set key-from key-to)
(slice set key-from key-to comparator)

An iterator for part of the set with provided boundaries. (slice set from to) returns iterator for all Xs where from <= X <= to. Optionally pass in comparator that will override the one that set uses. Supports efficient [[clojure.core/rseq]].

An iterator for part of the set with provided boundaries.
`(slice set from to)` returns iterator for all Xs where from <= X <= to.
Optionally pass in comparator that will override the one that set uses. Supports efficient [[clojure.core/rseq]].
raw docstring

sorted-arr-distinctcljs

(sorted-arr-distinct arr cmp)

Filter out repetitive values in a sorted array. Optimized for no-duplicates case

Filter out repetitive values in a sorted array.
Optimized for no-duplicates case
raw docstring

sorted-setclj/s≠

(sorted-set)
(sorted-set & keys)
clj

Create a set with default comparator.

Create a set with default comparator.
raw docstring

sorted-set*clj/s

(sorted-set* opts)

Create a set with custom comparator, metadata and settings

Create a set with custom comparator, metadata and settings
raw docstring

sorted-set-byclj/s≠

(sorted-set-by cmp)
(sorted-set-by cmp & keys)
clj

Create a set with custom comparator.

Create a set with custom comparator.
raw docstring

storeclj/s

(store set)
(store set storage)

Store each not-yet-stored node by calling IStorage::store and remembering returned address. Incremental, won’t store same node twice on subsequent calls. Returns root address. Remember it and use it for restore

Store each not-yet-stored node by calling IStorage::store and remembering
returned address. Incremental, won’t store same node twice on subsequent calls.
Returns root address. Remember it and use it for restore
raw docstring

uninitialized-addresscljs


uninitialized-hashcljs


walk-addressesclj

(walk-addresses set consume-fn)

Visit each address used by this set. Usable for cleaning up garbage left in storage from previous versions of the set

Visit each address used by this set. Usable for cleaning up
garbage left in storage from previous versions of the set
raw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close