Protocol for assigning values to mutable matrices.
Protocol for assigning values to mutable matrices.
(assign! m source)
Sets all the values in a matrix from a matrix source
Sets all the values in a matrix from a matrix source
(assign-array! m arr)
Sets all the values in a matrix from a Java array, in row-major order
Sets all the values in a matrix from a Java array, in row-major order
Protocol to coerce a parameter to a format usable by a specific implementation. It is up to the implementation to determine what parameter types they support. If the implementation is unable to perform coercion, it may return nil.
Protocol to coerce a parameter to a format usable by a specific implementation. It is up to the implementation to determine what parameter types they support. If the implementation is unable to perform coercion, it may return nil.
(coerce-param m param)
Attempts to coerce param into a matrix format supported by the implementation of matrix m. May return nil if unable to do so, in which case a default implementation can be used.
Attempts to coerce param into a matrix format supported by the implementation of matrix m. May return nil if unable to do so, in which case a default implementation can be used.
Protocol to allow conversion to Clojure-friendly vector format. Optional for implementers.
Protocol to allow conversion to Clojure-friendly vector format. Optional for implementers.
(convert-to-nested-vectors m)
Protocol to return standard dimension information about a matrix. dimensionality and dimension-count are mandatory for implementations
Protocol to return standard dimension information about a matrix. dimensionality and dimension-count are mandatory for implementations
(dimension-count m dimension-number)
Returns the size of a specific dimension
Returns the size of a specific dimension
(dimensionality m)
Returns the number of dimensions of a matrix
Returns the number of dimensions of a matrix
(get-shape m)
Returns the shape of the matrix, as an array or sequence of dimension sizes
Returns the shape of the matrix, as an array or sequence of dimension sizes
(is-scalar? m)
Tests whether an object is a scalar value
Tests whether an object is a scalar value
(is-vector? m)
Tests whether an object is a vector (1D matrix)
Tests whether an object is a vector (1D matrix)
Protocol to allow functional-style operations on matrix elements.
Protocol to allow functional-style operations on matrix elements.
(element-map m f)
(element-map m f a)
(element-map m f a more)
(element-map! m f)
(element-map! m f a)
(element-map! m f a more)
(element-reduce m f)
(element-reduce m f init)
(element-seq m)
Protocol for general implementation functionality
Protocol for general implementation functionality
(construct-matrix m data)
Returns a new matrix containing the given data. Data should be in the form of either nested sequences or a valid existing matrix
Returns a new matrix containing the given data. Data should be in the form of either nested sequences or a valid existing matrix
(implementation-key m)
Returns a keyword representing this implementation. Each implementation should have one unique key.
Returns a keyword representing this implementation. Each implementation should have one unique key.
(new-matrix m rows columns)
Returns a new matrix (regular 2D matrix) with the given number of rows and columns.
Returns a new matrix (regular 2D matrix) with the given number of rows and columns.
(new-matrix-nd m shape)
Returns a new general matrix of the given shape. Shape must be a sequence of dimension sizes.
Returns a new general matrix of the given shape. Shape must be a sequence of dimension sizes.
(new-vector m length)
Returns a new vector (1D column matrix) of the given length.
Returns a new vector (1D column matrix) of the given length.
(supports-dimensionality? m dimensions)
Returns true if the implementation supports matrices with the given number of dimensions.
Returns true if the implementation supports matrices with the given number of dimensions.
Protocol for indexed read access to matrices and vectors.
Protocol for indexed read access to matrices and vectors.
(get-1d m row)
(get-2d m row column)
(get-nd m indexes)
Protocol for indexed setter access to matrices and vectors. Must be supported for any mutable matrix type.
Protocol for indexed setter access to matrices and vectors. Must be supported for any mutable matrix type.
(is-mutable? m)
(set-1d m row v)
(set-2d m row column v)
(set-nd m indexes v)
Protocol to support mathematic functions applied element-wise to a matrix
Protocol to support mathematic functions applied element-wise to a matrix
(sqrt! m)
(to-radians m)
(asin! m)
(cos! m)
(ceil! m)
(log m)
(acos m)
(to-degrees m)
(floor m)
(tanh m)
(atan! m)
(to-radians! m)
(ceil m)
(abs! m)
(log! m)
(atan m)
(cosh! m)
(sin! m)
(cos m)
(log10 m)
(tan m)
(cbrt m)
(tan! m)
(exp! m)
(sqrt m)
(to-degrees! m)
(cbrt! m)
(exp m)
(cosh m)
(round! m)
(asin m)
(signum! m)
(round m)
(acos! m)
(sinh! m)
(tanh! m)
(abs m)
(sinh m)
(floor! m)
(sin m)
(signum m)
(log10! m)
Protocol to support matrix addition on an arbitrary matrices of same size
Protocol to support matrix addition on an arbitrary matrices of same size
(matrix-add m a)
(matrix-sub m a)
Protocol for matrix equality operations
Protocol for matrix equality operations
(matrix-equals a b)
Protocol to support matrix multiplication on an arbitrary matrix, vector or scalar
Protocol to support matrix multiplication on an arbitrary matrix, vector or scalar
(element-multiply m a)
(matrix-multiply m a)
Protocol to support common matrix operations
Protocol to support common matrix operations
(determinant m)
(inverse m)
(negate m)
(trace m)
(transpose m)
Protocol to support matrix scaling by scalar values
Protocol to support matrix scaling by scalar values
(pre-scale m a)
(scale m a)
Protocol to support getting slices of a matrix
Protocol to support getting slices of a matrix
(get-column m i)
(get-major-slice m i)
(get-row m i)
(get-slice m dimension i)
Protocol to support common vector operations.
Protocol to support common vector operations.
(length a)
(length-squared a)
(normalise a)
(vector-dot a b)
Protocol to support transformation of a vector to another vector. Is equivalent to matrix multiplication when 2D matrices are used as transformations. But other transformations are possible, e.g. affine transformations.
Protocol to support transformation of a vector to another vector. Is equivalent to matrix multiplication when 2D matrices are used as transformations. But other transformations are possible, e.g. affine transformations.
(vector-transform m v)
Transforms a vector
Transforms a vector
(vector-transform! m v)
Transforms a vector in place - mutates the vector argument
Transforms a vector in place - mutates the vector argument
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close