API for clojure.core.rrb-vector - RRB-Tree-based Vectors 0.0.12 (in development)

by MichaƂ Marczyk

Full namespace name: clojure.core.rrb-vector

Overview

An implementation of the confluently persistent vector data
structure introduced in Bagwell, Rompf, "RRB-Trees: Efficient
Immutable Vectors", EPFL-REPORT-169879, September, 2011.

RRB-Trees build upon Clojure's PersistentVectors, adding logarithmic
time concatenation and slicing.

The main API entry points are clojure.core.rrb-vector/catvec,
performing vector concatenation, and clojure.core.rrb-vector/subvec,
which produces a new vector containing the appropriate subrange of
the input vector (in contrast to clojure.core/subvec, which returns
a view on the input vector).

core.rrb-vector's vectors can store objects or unboxed primitives.
The implementation allows for seamless interoperability with
clojure.lang.PersistentVector, clojure.core.Vec (more commonly known
as gvec) and clojure.lang.APersistentVector$SubVector instances:
clojure.core.rrb-vector/catvec and clojure.core.rrb-vector/subvec
convert their inputs to clojure.core.rrb-vector.rrbt.Vector
instances whenever necessary (this is a very fast constant time
operation for PersistentVector and gvec; for SubVector it is O(log
n), where n is the size of the underlying vector).

clojure.core.rrb-vector also exports its own versions of vector and
vector-of and vec which always produce
clojure.core.rrb-vector.rrbt.Vector instances. Note that vector-of
accepts :object as one of the possible type arguments, in addition
to keywords naming primitive types.

Public Variables and Functions



catvec

function
Usage: (catvec)
       (catvec v1)
       (catvec v1 v2)
       (catvec v1 v2 v3)
       (catvec v1 v2 v3 v4)
       (catvec v1 v2 v3 v4 & vn)
Concatenates the given vectors in logarithmic time.
Source


subvec

function
Usage: (subvec v start)
       (subvec v start end)
Returns a new vector containing the elements of the given vector v
lying between the start (inclusive) and end (exclusive) indices in
logarithmic time. end defaults to end of vector. The resulting
vector shares structure with the original, but does not hold on to
any elements of the original vector lying outside the given index
range.
Source


vec

function
Usage: (vec coll)
Returns a vector containing the contents of coll.

If coll is a vector, returns an RRB vector using the internal tree
of coll.
Source


vector

function
Usage: (vector)
       (vector x1)
       (vector x1 x2)
       (vector x1 x2 x3)
       (vector x1 x2 x3 x4)
       (vector x1 x2 x3 x4 & xn)
Creates a new vector containing the args.
Source


vector-of

function
Usage: (vector-of t)
       (vector-of t x1)
       (vector-of t x1 x2)
       (vector-of t x1 x2 x3)
       (vector-of t x1 x2 x3 x4)
       (vector-of t x1 x2 x3 x4 & xn)
Creates a new vector capable of storing homogenous items of type t,
which should be one of :object, :int, :long, :float, :double, :byte,
:short, :char, :boolean. Primitives are stored unboxed.

Optionally takes one or more elements to populate the vector.
Source

clojure.core.rrb-vector.rrbt





Types



Transient

type

    Fields: [nm am objects? cnt shift root tail tidx]
Protocols:
Interfaces: clojure.core.rrb_vector.rrbt.IVecImpl, clojure.lang.Counted, clojure.lang.IFn, clojure.lang.ILookup, clojure.lang.ITransientAssociative, clojure.lang.ITransientCollection, clojure.lang.ITransientVector, clojure.lang.Indexed


VecSeq

type

    Fields: [am vec anode i offset _meta _hash _hasheq]
Protocols: clojure.core.protocols/InternalReduce
Interfaces: clojure.lang.Counted, clojure.lang.IChunkedSeq, clojure.lang.IHashEq, clojure.lang.IMeta, clojure.lang.IObj, clojure.lang.ISeq, clojure.lang.Seqable, java.io.Serializable, java.lang.Iterable, java.util.Collection, java.util.List


Vector

type

    Fields: [nm am cnt shift root tail _meta _hash _hasheq]
Protocols: clojure.core.protocols/IKVReduce, clojure.core.reducers/CollFold, clojure.core.rrb-vector.protocols/PSliceableVector, clojure.core.rrb-vector.protocols/PSpliceableVector, AsRRBT
Interfaces: clojure.core.rrb_vector.rrbt.IVecImpl, clojure.lang.Associative, clojure.lang.Counted, clojure.lang.IEditableCollection, clojure.lang.IFn, clojure.lang.IHashEq, clojure.lang.ILookup, clojure.lang.IMeta, clojure.lang.IObj, clojure.lang.IPersistentCollection, clojure.lang.IPersistentStack, clojure.lang.IPersistentVector, clojure.lang.Indexed, clojure.lang.Reversible, clojure.lang.Seqable, clojure.lang.Sequential, java.io.Serializable, java.lang.Comparable, java.lang.Iterable, java.util.Collection, java.util.List, java.util.RandomAccess

Public Variables and Functions



->Transient

function
Usage: (->Transient nm am objects? cnt shift root tail tidx)
Positional factory function for class clojure.core.rrb_vector.rrbt.Transient.
Source


->VecSeq

function
Usage: (->VecSeq am vec anode i offset _meta _hash _hasheq)
Positional factory function for class clojure.core.rrb_vector.rrbt.VecSeq.
Source


->Vector

function
Usage: (->Vector nm am cnt shift root tail _meta _hash _hasheq)
Positional factory function for class clojure.core.rrb_vector.rrbt.Vector.
Source
Logo & site design by Tom Hickey.
Clojure auto-documentation system by Tom Faulhaber.