Liking cljdoc? Tell your friends :D

core.matrix


*matrix-implementation*clj


absclj

(abs m)

abs!clj

(abs! m)

acosclj

(acos m)

acos!clj

(acos! m)

addclj

(add a)
(add a b)
(add a b & more)

Performs matrix addition on two matrices of same size

Performs matrix addition on two matrices of same size
raw docstring

asinclj

(asin m)

asin!clj

(asin! m)

assign!clj

(assign! m a)

Assigns a value to a matrix. Returns the mutated matrix

Assigns a value to a matrix. 
Returns the mutated matrix
raw docstring

atanclj

(atan m)

atan!clj

(atan! m)

cbrtclj

(cbrt m)

cbrt!clj

(cbrt! m)

ceilclj

(ceil m)

ceil!clj

(ceil! m)

cloneclj

(clone m)

Constructs a clone of the matrix, using the same implementation. This function is intended to allow safe defensive copying of matrices / vectors.

Guarantees that:

  1. Mutating the returned matrix will not modify any other matrix (defensive copy)
  2. The return matrix will be mutable, if the implementation supports mutable matrices.

A matrix implementation which only provides immutable matrices may safely return the same matrix.

Constructs a clone of the matrix, using the same implementation. This function is intended to
allow safe defensive copying of matrices / vectors.

Guarantees that:
1. Mutating the returned matrix will not modify any other matrix (defensive copy)
2. The return matrix will be mutable, if the implementation supports mutable matrices.

A matrix implementation which only provides immutable matrices may safely return the same matrix.
raw docstring

coerceclj

(coerce m a)

Coerces a parameter to a format usable by a specific matrix implementation

Coerces a parameter to a format usable by a specific matrix implementation
raw docstring

column-countclj

(column-count m)

Returns the number of columns in a matrix (must be 2D or more)

Returns the number of columns in a matrix (must be 2D or more)
raw docstring

column-matrix?clj

(column-matrix? m)

Returns true if a matrix is a column-matrix (i.e. has exactly one column)

Returns true if a matrix is a column-matrix (i.e. has exactly one column)
raw docstring

cosclj

(cos m)

cos!clj

(cos! m)

coshclj

(cosh m)

cosh!clj

(cosh! m)

current-implementationclj

(current-implementation)

Gets the currently active matrix implementation

Gets the currently active matrix implementation
raw docstring

detclj

(det a)

Calculates the determinant of a matrix

Calculates the determinant of a matrix
raw docstring

dimension-countclj

(dimension-count m dim)

Returns the size of the specified dimension in a matrix.

Returns the size of the specified dimension in a matrix.
raw docstring

dimensionalityclj

(dimensionality m)

Returns the dimensionality (number of array dimensions) of a matrix / array

Returns the dimensionality (number of array dimensions) of a matrix / array
raw docstring

dotclj

(dot a b)

Computes the dot product of two vectors

Computes the dot product of two vectors
raw docstring

emapclj

(emap f m)
(emap f m a)
(emap f m a & more)

Element-wise map over all elements of one or more matrices. Returns a new matrix of the same type.

Element-wise map over all elements of one or more matrices.
Returns a new matrix of the same type.
raw docstring

emap!clj

(emap! f m)
(emap! f m a)
(emap! f m a & more)

Element-wise map over all elements of one or more matrices. Performs in-place modification of the first matrix argument.

Element-wise map over all elements of one or more matrices.
Performs in-place modification of the first matrix argument.
raw docstring

emulclj

(emul a)
(emul a b)
(emul a b & more)

Performs element-wise matrix multiplication. Matrices must be same size.

Performs element-wise matrix multiplication. Matrices must be same size.
raw docstring

equalsclj

(equals a b)

Returns true if two matrices are numerically equal.

Returns true if two matrices are numerically equal.
raw docstring

ereduceclj

(ereduce f m)
(ereduce f init m)

Element-wise reduce on all elements of a matrix.

Element-wise reduce on all elements of a matrix.
raw docstring

eseqclj

(eseq m)

Returns all elements of a matrix as a sequence in row-major order

Returns all elements of a matrix as a sequence in row-major order
raw docstring

expclj

(exp m)

exp!clj

(exp! m)

floorclj

(floor m)

floor!clj

(floor! m)

get-columnclj

(get-column m y)

Gets a column of a 2D matrix

Gets a column of a 2D matrix
raw docstring

get-rowclj

(get-row m x)

Gets a row of a 2D matrix

Gets a row of a 2D matrix
raw docstring

lengthclj

(length m)

Calculates the length (magnitude) of a vector

Calculates the length (magnitude) of a vector
raw docstring

length-squaredclj

(length-squared m)

Calculates the squared length (squared magnitude) of a vector

Calculates the squared length (squared magnitude) of a vector
raw docstring

logclj

(log m)

log!clj

(log! m)

log10clj

(log10 m)

log10!clj

(log10! m)

matrixclj

(matrix data)
(matrix implementation data)

Constructs a matrix from the given data.

The data may be in one of the following forms:

  • Nested sequences, e.g. Clojure vectors
  • A valid existing matrix

If implementation is not specified, uses the current matrix library as specified in matrix-implementation

Constructs a matrix from the given data.

The data may be in one of the following forms:
- Nested sequences, e.g. Clojure vectors
- A valid existing matrix

If implementation is not specified, uses the current matrix library as specified
in *matrix-implementation*
raw docstring

matrix-1d?clj

(matrix-1d? m)

Returns true if parameter is a 1 dimensional matrix (equivalent to a column vector)

Returns true if parameter is a 1 dimensional matrix (equivalent to a column vector)
raw docstring

matrix-2d?clj

(matrix-2d? m)

Returns true if parameter is a regular matrix (2 dimensional matrix)

Returns true if parameter is a regular matrix (2 dimensional matrix)
raw docstring

matrix?clj

(matrix? m)

Returns true if parameter is a valid matrix (any dimensionality)

Returns true if parameter is a valid matrix (any dimensionality)
raw docstring

mgetclj

(mget m)
(mget m x)
(mget m x y)
(mget m x y & more)

Gets a scalar value from a matrix at a specified position. Supports any number of matrix dimensions.

Gets a scalar value from a matrix at a specified position. Supports any number of matrix dimensions.
raw docstring

mset!clj

(mset! m v)
(mset! m x v)
(mset! m x y v)
(mset! m x y z & more)

Sets a scalar value in a matrix at a specified position. Supports any number of matrix dimensions. Will throw an error if the matrix is not mutable.

Sets a scalar value in a matrix at a specified position. Supports any number of matrix dimensions.
Will throw an error if the matrix is not mutable.
raw docstring

mulclj

(mul a)
(mul a b)
(mul a b & more)

Performs matrix multiplication with matrices, vectors or scalars

Performs matrix multiplication with matrices, vectors or scalars
raw docstring

mutable?clj

(mutable? m)

Returns true if the matrix is mutable, i.e. supports setting of values

Returns true if the matrix is mutable, i.e. supports setting of values
raw docstring

new-matrixclj

(new-matrix rows columns)
(new-matrix dim-1 dim-2 & more-dim)

Constructs a new zero-filled matrix with the given dimensions

Constructs a new zero-filled matrix with the given dimensions
raw docstring

new-vectorclj

(new-vector length)
(new-vector length implementation)

Constructs a new zero-filled vector with the given length

Constructs a new zero-filled vector with the given length
raw docstring

normaliseclj

(normalise m)

Normalises a matrix (scales to unit length)

Normalises a matrix (scales to unit length)
raw docstring

roundclj

(round m)

round!clj

(round! m)

row-countclj

(row-count m)

Returns the number of rows in a matrix (must be 1D or more)

Returns the number of rows in a matrix (must be 1D or more)
raw docstring

row-matrix?clj

(row-matrix? m)

Returns true if a matrix is a row-matrix (i.e. has exactly one row)

Returns true if a matrix is a row-matrix (i.e. has exactly one row)
raw docstring

scalar?clj

(scalar? m)

Returns true if the parameter is a scalar (zero dimensionality, acceptable as matrix value).

Returns true if the parameter is a scalar (zero dimensionality, acceptable as matrix value).
raw docstring

scaleclj

(scale m factor)

Scales a matrix by a scalar factor

Scales a matrix by a scalar factor
raw docstring

set-current-implementationclj

(set-current-implementation m)

Sets the currently active matrix implementation

Sets the currently active matrix implementation
raw docstring

shapeclj

(shape m)

Returns the shape of a matrix, i.e. the dimension sizes for all dimensions.

Result may be a sequence or Java array, to allow implemenations flexibility to return their own internal representation of matrix shape.

You are guaranteed however that you can call seq on this to get a sequence of dimension sizes.

Returns the shape of a matrix, i.e. the dimension sizes for all dimensions.

Result may be a sequence or Java array, to allow implemenations flexibility to return 
their own internal representation of matrix shape.

You are guaranteed however that you can call `seq` on this to get a sequence of dimension sizes.
raw docstring

signumclj

(signum m)

signum!clj

(signum! m)

sinclj

(sin m)

sin!clj

(sin! m)

sinhclj

(sinh m)

sinh!clj

(sinh! m)

sliceclj

(slice m dimension index)

Gets a view of a slice of a matrix along a specific dimension. The returned matrix will have one less dimension. Slicing a 1D vector will return a scalar.

Slicing on the first dimension (dimension 0) is likely to perform better for many matrix implementations.

Gets a view of a slice of a matrix along a specific dimension.
The returned matrix will have one less dimension.
Slicing a 1D vector will return a scalar.

Slicing on the first dimension (dimension 0) is likely to perform better
for many matrix implementations.
raw docstring

slicesclj

(slices m)
(slices m dimension)

Gets a lazy sequence of slices of a matrix. If dimension is supplied, slices along a given dimension, otherwise slices along the first dimension.

Gets a lazy sequence of slices of a matrix. If dimension is supplied, slices along a given dimension,
otherwise slices along the first dimension.
raw docstring

sqrtclj

(sqrt m)

sqrt!clj

(sqrt! m)

square?clj

(square? m)

Returns true if matrix is square (2D with same number of rows and columns)

Returns true if matrix is square (2D with same number of rows and columns)
raw docstring

subclj

(sub a)
(sub a b)
(sub a b & more)

Performs matrix subtraction on two matrices of same size

Performs matrix subtraction on two matrices of same size
raw docstring

sub-matrixclj

(sub-matrix m index-ranges)

Gets a view of a submatrix, for a set of index-ranges. Index ranges should be [start, length] pairs. Index ranges can be nil (gets the whole range)

Gets a view of a submatrix, for a set of index-ranges.
Index ranges should be [start, length] pairs.
Index ranges can be nil (gets the whole range) 
raw docstring

sub-vectorclj

(sub-vector m start length)

Gets a view of part of a vector. The view maintains a reference to the original, so can be used to modify the original vector if it is mutable.

Gets a view of part of a vector. The view maintains a reference to the original,
so can be used to modify the original vector if it is mutable.
raw docstring

supports-dimensionality?clj

(supports-dimensionality? m dimension-count)

Returns true if the implementation for a given matrix supports a specific dimensionality, i.e. can create an manipulate matrices with the given number of dimensions

Returns true if the implementation for a given matrix supports a specific dimensionality, i.e.
can create an manipulate matrices with the given number of dimensions
raw docstring

tanclj

(tan m)

tan!clj

(tan! m)

tanhclj

(tanh m)

tanh!clj

(tanh! m)

to-degreesclj

(to-degrees m)

to-degrees!clj

(to-degrees! m)

to-nested-vectorsclj

(to-nested-vectors m)

Converts a matrix to nested vectors

Converts a matrix to nested vectors
raw docstring

to-radiansclj

(to-radians m)

to-radians!clj

(to-radians! m)

traceclj

(trace a)

Calculates the trace of a matrix (sum of elements on main diagonal)

Calculates the trace of a matrix (sum of elements on main diagonal)
raw docstring

transformclj

(transform m v)

Transforms a given vector, returning a new vector

Transforms a given vector, returning a new vector
raw docstring

transform!clj

(transform! m v)

Transforms a given vector in place

Transforms a given vector in place
raw docstring

vec?clj

(vec? m)

Returns true if the parameter is a vector

Returns true if the parameter is a vector
raw docstring

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

× close