(compute-coll size index->any)
Function index->any
takes an index
.
Function `index->any` takes an `index`.
(compute-vector size index->number)
Function index->number
takes an index
and returns a number.
Function `index->number` takes an `index` and returns a number.
(concat-by-index coll1 coll2 i)
Returns a lazy sequence constructed by concatenating two collections, coll1
and coll2
with coll2
beginning at index i
. Preference goes to coll2
and empty spaces are filled with nil.
Returns a lazy sequence constructed by concatenating two collections, `coll1` and `coll2` with `coll2` beginning at index `i`. Preference goes to `coll2` and empty spaces are filled with nil.
(cross-product v1 v2)
Given two linearly independent 3D vectors v1
and v2
, the cross product,
v1
× v2
, is a vector that is perpendicular to both v1
and v2
. For 2D
vectors, the cross product has an analog result, which is a number. Only
defined for 2D and 3D vectors.
Given two linearly independent 3D vectors `v1` and `v2`, the cross product, `v1` × `v2`, is a vector that is perpendicular to both `v1` and `v2`. For 2D vectors, the cross product has an analog result, which is a number. Only defined for 2D and 3D vectors.
(dot-product v1 v2)
The dot product is the sum of the products of the corresponding entries of two vectors. Geometrically, the dot product is the product of the Euclidean magnitudes of the two vectors and the cosine of the angle between them. Also called [[inner-product]].
The dot product is the sum of the products of the corresponding entries of two vectors. Geometrically, the dot product is the product of the Euclidean magnitudes of the two vectors and the cosine of the angle between them. Also called [[inner-product]].
(filter-kv index+number->bool v)
Returns a vector of the items in v
for which function index+number->bool
returns true. index+number->bool
must be free of side-effects.
Returns a vector of the items in `v` for which function `index+number->bool` returns true. `index+number->bool` must be free of side-effects.
(indexes-of number v)
Returns a vector of the indexes in v
that contain 'number'.
Returns a vector of the indexes in `v` that contain 'number'.
(insertv v index number)
Returns a vector with the new number
inserted into index
.
Returns a vector with the new `number` inserted into `index`.
(kahan-sum numbers)
Kahan Summation algorithm -- for greater floating-point summation accuracy, as fast alternative to bigDecimal.
Kahan Summation algorithm -- for greater floating-point summation accuracy, as fast alternative to bigDecimal.
(projection v1 v2)
Returns vector of v1
projected onto v2
.
Returns vector of `v1` projected onto `v2`.
(removev v index)
Returns a vector with the value in the index removed.
Returns a vector with the value in the index removed.
(replace-nan replacement-number numbers)
Takes a collection of numbers
and returns the collection with any NaN
replaced with replacement-number
. Note that clojure.core/replace doesn't
work with NaN.
Takes a collection of `numbers` and returns the collection with any NaN replaced with `replacement-number`. Note that clojure.core/replace doesn't work with NaN.
(rnd-vector! size)
Returns vector v
of size
with random doubles.
Returns vector `v` of `size` with random doubles.
(some-kv index+number->bool v)
Returns the first logical true value of function index+number->bool
for any
number in v
, else nil.
Returns the first logical true value of function `index+number->bool` for any number in `v`, else nil.
(sparse->vector sparse v)
Builds a vector using a sparse representation and an existing vector v
(often a zero-vector). sparse
is a collection of tuples of [index number]
.
Later values will override prior overlapping values.
Builds a vector using a sparse representation and an existing vector `v` (often a zero-vector). `sparse` is a collection of tuples of `[index number]`. Later values will override prior overlapping values.
(to-vector x)
Creates a vector representing the flattened numbers of x
if possible.
Otherwise, returns nil.
Creates a vector representing the flattened numbers of `x` if possible. Otherwise, returns nil.
(vector? x)
Returns true if a vector (i.e., numbers only).
Returns true if a vector (i.e., numbers only).
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close