CrossClj

0.0.8 docs

SourceDocs



RECENT
    VARS
    catvec
    gen-vector-method
    gen-vector-of-method
    subvec
    vec
    vector
    vector-of

    « Index of all namespaces of this project

    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 flexvec.core/catvec, performing vector
    concatenation, and flexvec.core/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).
    
    flexvec'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:
    flexvec.core/catvec and flexvec.core/subvec convert their inputs to
    flexvec.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).
    
    flexvec.core also exports its own versions of vector, vector-of and
    vec which always produce flexvec.rrbt.Vector instances. Note that
    vector-of accepts :object as one of the possible type arguments, in
    addition to keywords naming primitive types.

    — Michał Marczyk

    (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.
    
    macroPrivate
    (gen-vector-method & params)
    macroPrivate
    (gen-vector-of-method t & params)
    (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.
    (vec coll)
    (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.
    
    (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.