(abs m)
(abs! m)
(acos m)
(acos! m)
(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
(asin m)
(asin! m)
(assign! m a)
Assigns a value to a matrix. Returns the mutated matrix
Assigns a value to a matrix. Returns the mutated matrix
(atan m)
(atan! m)
(cbrt m)
(cbrt! m)
(ceil m)
(ceil! m)
(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:
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.
(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
(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)
(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)
(cos m)
(cos! m)
(cosh m)
(cosh! m)
(current-implementation)
Gets the currently active matrix implementation
Gets the currently active matrix implementation
(det a)
Calculates the determinant of a matrix
Calculates the determinant of a matrix
(dimension-count m dim)
Returns the size of the specified dimension in a matrix.
Returns the size of the specified dimension in a matrix.
(dimensionality m)
Returns the dimensionality (number of array dimensions) of a matrix / array
Returns the dimensionality (number of array dimensions) of a matrix / array
(dot a b)
Computes the dot product of two vectors
Computes the dot product of two vectors
(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.
(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.
(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.
(equals a b)
Returns true if two matrices are numerically equal.
Returns true if two matrices are numerically equal.
(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.
(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
(exp m)
(exp! m)
(floor m)
(floor! m)
(get-column m y)
Gets a column of a 2D matrix
Gets a column of a 2D matrix
(length m)
Calculates the length (magnitude) of a vector
Calculates the length (magnitude) of a vector
(length-squared m)
Calculates the squared length (squared magnitude) of a vector
Calculates the squared length (squared magnitude) of a vector
(log m)
(log! m)
(log10 m)
(log10! m)
(matrix data)
(matrix implementation data)
Constructs a matrix from the given data.
The data may be in one of the following forms:
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*
(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)
(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)
(matrix? m)
Returns true if parameter is a valid matrix (any dimensionality)
Returns true if parameter is a valid matrix (any dimensionality)
(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.
(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.
(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
(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
(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
(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
(normalise m)
Normalises a matrix (scales to unit length)
Normalises a matrix (scales to unit length)
(round m)
(round! m)
(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)
(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)
(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).
(scale m factor)
Scales a matrix by a scalar factor
Scales a matrix by a scalar factor
(set-current-implementation m)
Sets the currently active matrix implementation
Sets the currently active matrix implementation
(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.
(signum m)
(signum! m)
(sin m)
(sin! m)
(sinh m)
(sinh! m)
(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.
(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.
(sqrt m)
(sqrt! m)
(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)
(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
(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)
(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.
(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
(tan m)
(tan! m)
(tanh m)
(tanh! m)
(to-degrees m)
(to-degrees! m)
(to-nested-vectors m)
Converts a matrix to nested vectors
Converts a matrix to nested vectors
(to-radians m)
(to-radians! m)
(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)
(transform m v)
Transforms a given vector, returning a new vector
Transforms a given vector, returning a new vector
(transform! m v)
Transforms a given vector in place
Transforms a given vector in place
(vec? m)
Returns true if the parameter is a vector
Returns true if the parameter is a vector
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close