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
sourceraw 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
sourceraw docstring

-clj

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

Substract one or more vectors

Substract one or more vectors
sourceraw docstring

absclj

(abs a)

Computes the absolute value of a vector and returns it

Computes the absolute value of a vector and returns it
sourceraw 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
sourceraw docstring

addclj

(add dest source)

Add a vector to another

Add a vector to another
sourceraw docstring

add!clj

(add! dest source)

Add a vector to another (in-place)

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

add-multipleclj

(add-multiple dest source factor)

Add a vector to another

Add a vector to another
sourceraw docstring

add-multiple!clj

(add-multiple! dest source factor)

Add a vector to another (in-place)

Add a vector to another (in-place)
sourceraw 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
sourceraw 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
sourceraw docstring

angleclj

(angle a b)

Return the angle between two vectors

Return the angle between two vectors
sourceraw 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
sourceraw 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
sourceraw 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.
sourceraw 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
sourceraw 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 
sourceraw docstring

distanceclj

(distance a b)

Return the euclidean distance between two vectors

Return the euclidean distance between two vectors
sourceraw docstring

distance-squaredclj

(distance-squared a b)

Return the squared euclidean distance between two vectors

Return the squared euclidean distance between two vectors
sourceraw docstring

divclj

(div dest source)

Divide a vector by another vector or scalar

Divide a vector by another vector or scalar
sourceraw 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)
sourceraw 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
sourceraw docstring

dotclj

(dot a b)

Compute the dot product of two vectors

Compute the dot product of two vectors
sourceraw docstring

ecountclj

(ecount v)

Returns the number of elements in a vectorz array

Returns the number of elements in a vectorz array
sourceraw 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
sourceraw docstring

fillclj

(fill a value)

Fills a vector with a specific numerical value

Fills a vector with a specific numerical value
sourceraw 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
sourceraw 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
sourceraw docstring

interpolateclj

(interpolate a b position)
source

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

magnitudeclj

(magnitude a)

Return the magnitude of a vector (geometric length)

Return the magnitude of a vector (geometric length)
sourceraw 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.
sourceraw 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
sourceraw 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)
sourceraw docstring

mulclj

(mul dest source)

Multiply a vector with another vector or scalar

Multiply a vector with another vector or scalar
sourceraw 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)
sourceraw docstring

negateclj

(negate a)

Negates a vector and returns it

Negates a vector and returns it
sourceraw docstring

negate!clj

(negate! a)

Negates a vector in place and returns it

Negates a vector in place and returns it
sourceraw docstring

normaliseclj

(normalise a)

Normalises a vector to unit length and returns it

Normalises a vector to unit length and returns it
sourceraw 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
sourceraw 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
sourceraw 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)
sourceraw docstring

ofclj

(of & xs)

Creates a vector from its numerical components

Creates a vector from its numerical components
sourceraw docstring

PVectorisablecljprotocol

to-vectorclj

(to-vector a)
source

scaleclj

(scale a factor)

Scales a vector by a scalar numerical factor

Scales a vector by a scalar numerical factor
sourceraw 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
sourceraw 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
sourceraw 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
sourceraw 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)
sourceraw docstring

subclj

(sub dest source)

Subtract a vector from another

Subtract a vector from another
sourceraw docstring

sub!clj

(sub! dest source)

Subtract a vector from another (in-place)

Subtract a vector from another (in-place)
sourceraw 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)
sourceraw docstring

to-arrayclj

(to-array a)

Converts a vector to a double array

Converts a vector to a double array
sourceraw docstring

to-listclj

(to-list a)

Converts a vector to a list of doubles

Converts a vector to a list of doubles
sourceraw 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
sourceraw docstring

vec1clj

(vec1)
(vec1 coll)

Creates a Vector1 instance

Creates a Vector1 instance
sourceraw docstring

vec2clj

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

Creates a Vector2 instance

Creates a Vector2 instance
sourceraw docstring

vec3clj

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

Creates a Vector3 instance

Creates a Vector3 instance
sourceraw docstring

vec4clj

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

Creates a Vector4 instance

Creates a Vector4 instance
sourceraw 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)
sourceraw docstring

vectorclj

(vector & xs)

Creates a vector from zero or more numerical components.

Creates a vector from zero or more numerical components.
sourceraw 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)
sourceraw docstring

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

× close