Clojure API for directly accessing Vectorz vector functions.
In most cases these are relatively lightweight wrappers over equivalent functions in Vectorz, but specialised with type hints for handling Vectorz vectors for performance purposes.
These are generally equivalent to similar functions in clojure.core.matrix API. If performance is less of a concern, consider using the clojure.core.matrix API directly, which offer more functionality and work with a much broader range of array shapes and argument types.
Clojure API for directly accessing Vectorz vector functions. In most cases these are relatively lightweight wrappers over equivalent functions in Vectorz, but specialised with type hints for handling Vectorz vectors for performance purposes. These are generally equivalent to similar functions in clojure.core.matrix API. If performance is less of a concern, consider using the clojure.core.matrix API directly, which offer more functionality and work with a much broader range of array shapes and argument types.
(* a)
(* a b)
(* a b & vs)
Multiply one or more vectors, element-wise
Multiply one or more vectors, element-wise
(+ a)
(+ a b)
(+ a b & vs)
Add one or more vectors, returning a new vector as the result
Add one or more vectors, returning a new vector as the result
(- a)
(- a b)
(- a b & vs)
Substract one or more vectors
Substract one or more vectors
(abs a)
Computes the absolute value of a vector and returns it
Computes the absolute value of a vector and returns it
(abs! a)
Computes the absolute value of a vector in place and returns it
Computes the absolute value of a vector in place and returns it
(add! dest source)
Add a vector to another (in-place)
Add a vector to another (in-place)
(add-multiple dest source factor)
Add a vector to another
Add a vector to another
(add-multiple! dest source factor)
Add a vector to another (in-place)
Add a vector to another (in-place)
(add-weighted dest source weight)
Create a weighted average of a vector with another. Numerical weight specifies the proportion of the second vector to use
Create a weighted average of a vector with another. Numerical weight specifies the proportion of the second vector to use
(add-weighted! dest source weight)
Create a weighted average of a vector with another in place. Numerical weight specifies the proportion of the second vector to use
Create a weighted average of a vector with another in place. Numerical weight specifies the proportion of the second vector to use
(angle a b)
Return the angle between two vectors
Return the angle between two vectors
(approx= a b)
(approx= a b epsilon)
Returns a boolean indicating whether the two vectors are approximately equal, +/- an optional tolerance
Returns a boolean indicating whether the two vectors are approximately equal, +/- an optional tolerance
(assign! a new-value)
Fills a vector in place with the value of another vector
Fills a vector in place with the value of another vector
(clone v)
Creates a (mutable) clone of a vectorz array. May not be exactly the same class as the original array.
Creates a (mutable) clone of a vectorz array. May not be exactly the same class as the original array.
(create-length len)
Creates a vector of a specified length. Will use optimised primitive vectors for small lengths
Creates a vector of a specified length. Will use optimised primitive vectors for small lengths
(cross-product! a b)
Calculates the cross product of a 3D vector in place
Calculates the cross product of a 3D vector in place
(distance a b)
Return the euclidean distance between two vectors
Return the euclidean distance between two vectors
(distance-squared a b)
Return the squared euclidean distance between two vectors
Return the squared euclidean distance between two vectors
(div dest source)
Divide a vector by another vector or scalar
Divide a vector by another vector or scalar
(div! dest source)
Divide a vector by another vector or scalar (in-place)
Divide a vector by another vector or scalar (in-place)
(divide a)
(divide a b)
(divide a b & vs)
Divide one or more vectors, element-wise
Divide one or more vectors, element-wise
(dot a b)
Compute the dot product of two vectors
Compute the dot product of two vectors
(ecount v)
Returns the number of elements in a vectorz array
Returns the number of elements in a vectorz array
(empty len)
Creates an empty vector of a specified length. Will use optimised primitive vectors for small lengths
Creates an empty vector of a specified length. Will use optimised primitive vectors for small lengths
(fill a value)
Fills a vector with a specific numerical value
Fills a vector with a specific numerical value
(fill! a value)
Fills a vector in place with a specific numerical value
Fills a vector in place with a specific numerical value
(get v index)
DEPRECATED: use mget instead for consistency with core.matrix
Returns the component of a vector at a specific index position
DEPRECATED: use mget instead for consistency with core.matrix Returns the component of a vector at a specific index position
(interpolate a b position)
(join a b)
Joins two vectors together. The returned vector is a new reference vector that refers to the originals.
Joins two vectors together. The returned vector is a new reference vector that refers to the originals.
(magnitude a)
Return the magnitude of a vector (geometric length)
Return the magnitude of a vector (geometric length)
(magnitude-squared a)
Return the squared magnitude of a vector. Slightly more efficient than getting the magnitude directly.
Return the squared magnitude of a vector. Slightly more efficient than getting the magnitude directly.
(mget v)
(mget v i)
(mget v i j)
Returns the component of a vector at a specific index position
Returns the component of a vector at a specific index position
(mset! v value)
(mset! v i value)
(mset! v i j value)
Sets the component of a vector at position i (mutates in place)
Sets the component of a vector at position i (mutates in place)
(mul dest source)
Multiply a vector with another vector or scalar
Multiply a vector with another vector or scalar
(mul! dest source)
Multiply a vector with another vector or scalar (in-place)
Multiply a vector with another vector or scalar (in-place)
(negate! a)
Negates a vector in place and returns it
Negates a vector in place and returns it
(normalise a)
Normalises a vector to unit length and returns it
Normalises a vector to unit length and returns it
(normalise! a)
Normalises a vector in place to unit length and returns it
Normalises a vector in place to unit length and returns it
(normalise-get-magnitude! a)
Normalises a vector in place to unit length and returns its magnitude
Normalises a vector in place to unit length and returns its magnitude
(normalised? v)
Returns true if a vector is normalised (has unit length)
Returns true if a vector is normalised (has unit length)
(of & xs)
Creates a vector from its numerical components
Creates a vector from its numerical components
(to-vector a)
(scale a factor)
Scales a vector by a scalar numerical factor
Scales a vector by a scalar numerical factor
(scale! a factor)
Scales a vector in place by a scalar numerical factor
Scales a vector in place by a scalar numerical factor
(scale-add a factor b)
Scales a vector by a scalar numerical factor and adds a second vector
Scales a vector by a scalar numerical factor and adds a second vector
(scale-add! a factor b)
Scales a fector in place by a scalar numerical factor and adds a second vector
Scales a fector in place by a scalar numerical factor and adds a second vector
(set v index value)
DEPRECATED: use mset! instead for consistency with core.matrix
Sets the component of a vector at position i (mutates in place)
DEPRECATED: use mset! instead for consistency with core.matrix Sets the component of a vector at position i (mutates in place)
(sub! dest source)
Subtract a vector from another (in-place)
Subtract a vector from another (in-place)
(subvec v start end)
Returns a subvector of a vector. The subvector is a reference (i.e can be sed to modify the original vector)
Returns a subvector of a vector. The subvector is a reference (i.e can be sed to modify the original vector)
(to-array a)
Converts a vector to a double array
Converts a vector to a double array
(to-list a)
Converts a vector to a list of doubles
Converts a vector to a list of doubles
(vec coll)
Creates a vector from a collection, a sequence or anything else that implements the PVectorisable protocol
Creates a vector from a collection, a sequence or anything else that implements the PVectorisable protocol
(vec2)
(vec2 coll)
(vec2 x y)
Creates a Vector2 instance
Creates a Vector2 instance
(vec3)
(vec3 coll)
(vec3 x y z)
Creates a Vector3 instance
Creates a Vector3 instance
(vec4)
(vec4 coll)
(vec4 x y z t)
Creates a Vector4 instance
Creates a Vector4 instance
(vec? v)
Returns true if v is a vectorz vector (i.e. an instance of mikera.vectorz.AVector or a 1-dimensional INDArray)
Returns true if v is a vectorz vector (i.e. an instance of mikera.vectorz.AVector or a 1-dimensional INDArray)
(vector & xs)
Creates a vector from zero or more numerical components.
Creates a vector from zero or more numerical components.
(vectorz? a)
Returns true if v is a vectorz array class (i.e. any instance of mikera.arrayz.INDArray)
Returns true if v is a vectorz array class (i.e. any instance of mikera.arrayz.INDArray)
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close