Liking cljdoc? Tell your friends :D

mikera.vectorz.core

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.
raw docstring

*clj

(* a)
(* a b)
(* a b & vs)

Multiply one or more vectors, element-wise

Multiply one or more vectors, element-wise
raw docstring

+clj

(+ 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
raw docstring

-clj

(- a)
(- a b)
(- a b & vs)

Substract one or more vectors

Substract one or more vectors
raw docstring

absclj

(abs a)

Computes the absolute value of a vector and returns it

Computes the absolute value of a vector and returns it
raw docstring

abs!clj

(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
raw docstring

addclj

(add dest source)

Add a vector to another

Add a vector to another
raw docstring

add!clj

(add! dest source)

Add a vector to another (in-place)

Add a vector to another (in-place)
raw docstring

add-multipleclj

(add-multiple dest source factor)

Add a vector to another

Add a vector to another
raw docstring

add-multiple!clj

(add-multiple! dest source factor)

Add a vector to another (in-place)

Add a vector to another (in-place)
raw docstring

add-weightedclj

(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
raw docstring

add-weighted!clj

(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
raw docstring

angleclj

(angle a b)

Return the angle between two vectors

Return the angle between two vectors
raw docstring

approx=clj

(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
raw docstring

assign!clj

(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
raw docstring

cloneclj

(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.
raw docstring

create-lengthclj

(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
raw docstring

cross-product!clj

(cross-product! a b)

Calculates the cross product of a 3D vector in place

Calculates the cross product of a 3D vector in place 
raw docstring

distanceclj

(distance a b)

Return the euclidean distance between two vectors

Return the euclidean distance between two vectors
raw docstring

distance-squaredclj

(distance-squared a b)

Return the squared euclidean distance between two vectors

Return the squared euclidean distance between two vectors
raw docstring

divclj

(div dest source)

Divide a vector by another vector or scalar

Divide a vector by another vector or scalar
raw docstring

div!clj

(div! dest source)

Divide a vector by another vector or scalar (in-place)

Divide a vector by another vector or scalar (in-place)
raw docstring

divideclj

(divide a)
(divide a b)
(divide a b & vs)

Divide one or more vectors, element-wise

Divide one or more vectors, element-wise
raw docstring

dotclj

(dot a b)

Compute the dot product of two vectors

Compute the dot product of two vectors
raw docstring

ecountclj

(ecount v)

Returns the number of elements in a vectorz array

Returns the number of elements in a vectorz array
raw docstring

emptyclj

(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
raw docstring

fillclj

(fill a value)

Fills a vector with a specific numerical value

Fills a vector with a specific numerical value
raw docstring

fill!clj

(fill! a value)

Fills a vector in place with a specific numerical value

Fills a vector in place with a specific numerical value
raw docstring

getclj

(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
raw docstring

interpolateclj

(interpolate a b position)

joinclj

(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.
raw docstring

magnitudeclj

(magnitude a)

Return the magnitude of a vector (geometric length)

Return the magnitude of a vector (geometric length)
raw docstring

magnitude-squaredclj

(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.
raw docstring

mgetclj

(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
raw docstring

mset!clj

(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)
raw docstring

mulclj

(mul dest source)

Multiply a vector with another vector or scalar

Multiply a vector with another vector or scalar
raw docstring

mul!clj

(mul! dest source)

Multiply a vector with another vector or scalar (in-place)

Multiply a vector with another vector or scalar (in-place)
raw docstring

negateclj

(negate a)

Negates a vector and returns it

Negates a vector and returns it
raw docstring

negate!clj

(negate! a)

Negates a vector in place and returns it

Negates a vector in place and returns it
raw docstring

normaliseclj

(normalise a)

Normalises a vector to unit length and returns it

Normalises a vector to unit length and returns it
raw docstring

normalise!clj

(normalise! a)

Normalises a vector in place to unit length and returns it

Normalises a vector in place to unit length and returns it
raw docstring

normalise-get-magnitude!clj

(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
raw docstring

normalised?clj

(normalised? v)

Returns true if a vector is normalised (has unit length)

Returns true if a vector is normalised (has unit length)
raw docstring

ofclj

(of & xs)

Creates a vector from its numerical components

Creates a vector from its numerical components
raw docstring

PVectorisablecljprotocol

to-vectorclj

(to-vector a)

scaleclj

(scale a factor)

Scales a vector by a scalar numerical factor

Scales a vector by a scalar numerical factor
raw docstring

scale!clj

(scale! a factor)

Scales a vector in place by a scalar numerical factor

Scales a vector in place by a scalar numerical factor
raw docstring

scale-addclj

(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
raw docstring

scale-add!clj

(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
raw docstring

setclj

(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)
raw docstring

subclj

(sub dest source)

Subtract a vector from another

Subtract a vector from another
raw docstring

sub!clj

(sub! dest source)

Subtract a vector from another (in-place)

Subtract a vector from another (in-place)
raw docstring

subvecclj

(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)
raw docstring

to-arrayclj

(to-array a)

Converts a vector to a double array

Converts a vector to a double array
raw docstring

to-listclj

(to-list a)

Converts a vector to a list of doubles

Converts a vector to a list of doubles
raw docstring

vecclj

(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
raw docstring

vec1clj

(vec1)
(vec1 coll)

Creates a Vector1 instance

Creates a Vector1 instance
raw docstring

vec2clj

(vec2)
(vec2 coll)
(vec2 x y)

Creates a Vector2 instance

Creates a Vector2 instance
raw docstring

vec3clj

(vec3)
(vec3 coll)
(vec3 x y z)

Creates a Vector3 instance

Creates a Vector3 instance
raw docstring

vec4clj

(vec4)
(vec4 coll)
(vec4 x y z t)

Creates a Vector4 instance

Creates a Vector4 instance
raw docstring

vec?clj

(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)
raw docstring

vectorclj

(vector & xs)

Creates a vector from zero or more numerical components.

Creates a vector from zero or more numerical components.
raw docstring

vectorz?clj

(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)
raw docstring

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

× close