Liking cljdoc? Tell your friends :D

core.matrix.protocols


PAssignmentcljprotocol

Protocol for assigning values to mutable matrices.

Protocol for assigning values to mutable matrices.

assign!clj

(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!clj

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

PCoercioncljprotocol

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-paramclj

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

PConversioncljprotocol

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-vectorsclj

(convert-to-nested-vectors m)
raw docstring

PDimensionInfocljprotocol

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-countclj

(dimension-count m dimension-number)

Returns the size of a specific dimension

Returns the size of a specific dimension 

dimensionalityclj

(dimensionality m)

Returns the number of dimensions of a matrix

Returns the number of dimensions of a matrix

get-shapeclj

(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?clj

(is-scalar? m)

Tests whether an object is a scalar value

Tests whether an object is a scalar value

is-vector?clj

(is-vector? m)

Tests whether an object is a vector (1D matrix)

Tests whether an object is a vector (1D matrix)
raw docstring

PFunctionalOperationscljprotocol

Protocol to allow functional-style operations on matrix elements.

Protocol to allow functional-style operations on matrix elements.

element-mapclj

(element-map m f)
(element-map m f a)
(element-map m f a more)

element-map!clj

(element-map! m f)
(element-map! m f a)
(element-map! m f a more)

element-reduceclj

(element-reduce m f)
(element-reduce m f init)

element-seqclj

(element-seq m)
raw docstring

PImplementationcljprotocol

Protocol for general implementation functionality

Protocol for general implementation functionality

construct-matrixclj

(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-keyclj

(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-matrixclj

(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-ndclj

(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-vectorclj

(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?clj

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

PIndexedAccesscljprotocol

Protocol for indexed read access to matrices and vectors.

Protocol for indexed read access to matrices and vectors.

get-1dclj

(get-1d m row)

get-2dclj

(get-2d m row column)

get-ndclj

(get-nd m indexes)
raw docstring

PIndexedSettingcljprotocol

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?clj

(is-mutable? m)

set-1dclj

(set-1d m row v)

set-2dclj

(set-2d m row column v)

set-ndclj

(set-nd m indexes v)
raw docstring

PMathsFunctionscljprotocol

Protocol to support mathematic functions applied element-wise to a matrix

Protocol to support mathematic functions applied element-wise to a matrix

sqrt!clj

(sqrt! m)

to-radiansclj

(to-radians m)

asin!clj

(asin! m)

cos!clj

(cos! m)

ceil!clj

(ceil! m)

logclj

(log m)

acosclj

(acos m)

to-degreesclj

(to-degrees m)

floorclj

(floor m)

tanhclj

(tanh m)

atan!clj

(atan! m)

to-radians!clj

(to-radians! m)

ceilclj

(ceil m)

abs!clj

(abs! m)

log!clj

(log! m)

atanclj

(atan m)

cosh!clj

(cosh! m)

sin!clj

(sin! m)

cosclj

(cos m)

log10clj

(log10 m)

tanclj

(tan m)

cbrtclj

(cbrt m)

tan!clj

(tan! m)

exp!clj

(exp! m)

sqrtclj

(sqrt m)

to-degrees!clj

(to-degrees! m)

cbrt!clj

(cbrt! m)

expclj

(exp m)

coshclj

(cosh m)

round!clj

(round! m)

asinclj

(asin m)

signum!clj

(signum! m)

roundclj

(round m)

acos!clj

(acos! m)

sinh!clj

(sinh! m)

tanh!clj

(tanh! m)

absclj

(abs m)

sinhclj

(sinh m)

floor!clj

(floor! m)

sinclj

(sin m)

signumclj

(signum m)

log10!clj

(log10! m)
raw docstring

PMatrixAddcljprotocol

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-addclj

(matrix-add m a)

matrix-subclj

(matrix-sub m a)
raw docstring

PMatrixEqualitycljprotocol

Protocol for matrix equality operations

Protocol for matrix equality operations

matrix-equalsclj

(matrix-equals a b)
raw docstring

PMatrixMultiplycljprotocol

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-multiplyclj

(element-multiply m a)

matrix-multiplyclj

(matrix-multiply m a)
raw docstring

PMatrixOpscljprotocol

Protocol to support common matrix operations

Protocol to support common matrix operations

determinantclj

(determinant m)

inverseclj

(inverse m)

negateclj

(negate m)

traceclj

(trace m)

transposeclj

(transpose m)
raw docstring

PMatrixScalingcljprotocol

Protocol to support matrix scaling by scalar values

Protocol to support matrix scaling by scalar values

pre-scaleclj

(pre-scale m a)

scaleclj

(scale m a)
raw docstring

PMatrixSlicescljprotocol

Protocol to support getting slices of a matrix

Protocol to support getting slices of a matrix

get-columnclj

(get-column m i)

get-major-sliceclj

(get-major-slice m i)

get-rowclj

(get-row m i)

get-sliceclj

(get-slice m dimension i)
raw docstring

PVectorOpscljprotocol

Protocol to support common vector operations.

Protocol to support common vector operations.

lengthclj

(length a)

length-squaredclj

(length-squared a)

normaliseclj

(normalise a)

vector-dotclj

(vector-dot a b)
raw docstring

PVectorTransformcljprotocol

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-transformclj

(vector-transform m v)

Transforms a vector

Transforms a vector

vector-transform!clj

(vector-transform! m v)

Transforms a vector in place - mutates the vector argument

Transforms a vector in place - mutates the vector argument
raw docstring

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

× close