Liking cljdoc? Tell your friends :D

tupelo.vec


coerce->vecclj/s

(coerce->vec arg)

Inputs: [arg] Returns: tsk/Vec

Coerce any scalar values to a vector

Inputs: [arg]
Returns: tsk/Vec

Coerce any scalar values to a vector
sourceraw docstring

delclj/s

(del src idxs)

Inputs: [src :- tsk/Vec idxs :- IndexSpec] Returns: tsk/Vec

Delete elements at the specified indexes.

Inputs: [src :- tsk/Vec idxs :- IndexSpec]
Returns: tsk/Vec

Delete elements at the specified indexes.
sourceraw docstring

getclj/s

(get src idxs)

Inputs: [src :- tsk/Vec idxs :- IndexSpec] Returns: tsk/Vec

Given a source vector V and a list of index values idx, returns a vector: [ V(idx-1) V(idx-2) ...]

Inputs: [src :- tsk/Vec idxs :- IndexSpec]
Returns: tsk/Vec

Given a source vector V and a list of index values `idx`, returns a vector: [ V(idx-1) V(idx-2) ...]
sourceraw docstring

IndexSpecclj/s

source

pred-indexclj/s

(pred-index pred coll)

Given a predicate fn and a collection of values, returns the index values for which the predicate is true & false like: (pred-index #(zero? (rem % 3)) [0 10 20 30 40 50 60 70 80]) => {:idxs-true [0 3 6] :idxs-false [1 2 4 5 7 8] }

Given a predicate fn and a collection of values, returns the index values for which the
predicate is true & false like:
  (pred-index #(zero? (rem % 3)) [0 10 20 30 40 50 60 70 80])
    => {:idxs-true   [0 3 6]
        :idxs-false  [1 2 4 5 7 8] } 
sourceraw docstring

setclj/s

(set dest idxs src)

Inputs: [dest :- tsk/Vec idxs :- IndexSpec src :- tsk/Vec] Returns: tsk/Vec

Given a dest vector V, a list of index values idx, and a conforming src vector, returns a modified V such that V(idx-j) = src[j] for j in [0..len(idx)]

Inputs: [dest :- tsk/Vec idxs :- IndexSpec src :- tsk/Vec]
Returns: tsk/Vec

Given a dest vector V, a list of index values `idx`, and a conforming src vector,
returns a modified V such that V(idx-j) = src[j] for j in [0..len(idx)] 
sourceraw docstring

set-laxclj/s

(set-lax dest idxs src)

Inputs: [dest :- tsk/Vec idxs :- IndexSpec src :- s/Any] Returns: tsk/Vec

Like vec-put-idxs, but is lax in accepting the src vector. If a scalar is supplied, it is replaced with (repeat <src>). If the src vector is longer than the idxs, it is truncated to conform.

Inputs: [dest :- tsk/Vec idxs :- IndexSpec src :- s/Any]
Returns: tsk/Vec

Like vec-put-idxs, but is lax in accepting the src vector. If a scalar is supplied,
it is replaced with `(repeat <src>)`. If the src vector is longer than the idxs, it is truncated
to conform.
sourceraw docstring

validate-indexes-completeclj/s

(validate-indexes-complete idxs)

Inputs: [idxs] Returns: s/Any

Validates that a collection of N index values includes all values in [0..N).

Inputs: [idxs]
Returns: s/Any

Validates that a collection of N index values includes all values in [0..N).
sourceraw docstring

verify-idxsclj/s

(verify-idxs tgt idxs)

Inputs: [tgt :- tsk/Vec idxs :- [s/Int]]

Assets that an integer index is non-negative and less than a bound

Inputs: [tgt :- tsk/Vec idxs :- [s/Int]]

Assets that an integer index is non-negative and less than a bound
sourceraw docstring

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

× close