Liking cljdoc? Tell your friends :D

fastmath.matrix

Fixed size (2x2, 3x3, 4x4) matrix types.

Fixed size (2x2, 3x3, 4x4) matrix types.
raw docstring

acosclj

(acos vector)

Apply acos to matrix elements.

Apply acos to matrix elements.
sourceraw docstring

acoshclj

(acosh vector)

Apply acosh to matrix elements.

Apply acosh to matrix elements.
sourceraw docstring

acotclj

(acot vector)

Apply acot to matrix elements.

Apply acot to matrix elements.
sourceraw docstring

acothclj

(acoth vector)

Apply acoth to matrix elements.

Apply acoth to matrix elements.
sourceraw docstring

acscclj

(acsc vector)

Apply acsc to matrix elements.

Apply acsc to matrix elements.
sourceraw docstring

acschclj

(acsch vector)

Apply acsch to matrix elements.

Apply acsch to matrix elements.
sourceraw docstring

addclj

(add A)
(add A B)

Add matrices, C=A+B.

Add matrices, C=A+B.
sourceraw docstring

addsclj

(adds A s)

Add scalar to all matrix elements

Add scalar to all matrix elements
sourceraw docstring

asecclj

(asec vector)

Apply asec to matrix elements.

Apply asec to matrix elements.
sourceraw docstring

asechclj

(asech vector)

Apply asech to matrix elements.

Apply asech to matrix elements.
sourceraw docstring

asinclj

(asin vector)

Apply asin to matrix elements.

Apply asin to matrix elements.
sourceraw docstring

asinhclj

(asinh vector)

Apply asinh to matrix elements.

Apply asinh to matrix elements.
sourceraw docstring

atanclj

(atan vector)

Apply atan to matrix elements.

Apply atan to matrix elements.
sourceraw docstring

atanhclj

(atanh vector)

Apply atanh to matrix elements.

Apply atanh to matrix elements.
sourceraw docstring

cbclj

(cb vector)

Apply cb to matrix elements.

Apply cb to matrix elements.
sourceraw docstring

cbrtclj

(cbrt vector)

Apply cbrt to matrix elements.

Apply cbrt to matrix elements.
sourceraw docstring

ceilclj

(ceil vector)

Apply ceil to matrix elements.

Apply ceil to matrix elements.
sourceraw docstring

choleskyclj

(cholesky A)
(cholesky A upper?)

Calculate L (lower by default) triangular for where L * L^T = A.

Checks only for symmetry, can return NaNs when A is not positive-definite.

Calculate L (lower by default) triangular for where L * L^T = A.

Checks only for symmetry, can return NaNs when A is not positive-definite.
sourceraw docstring

colclj

(col A c)

Return column as a vector

Return column as a vector
sourceraw docstring

colsclj

(cols A)

Return matrix columns

Return matrix columns
sourceraw docstring

cols->matclj

(cols->mat [a00 a10] [a01 a11])
(cols->mat [a00 a10 a20] [a01 a11 a21] [a02 a12 a22])
(cols->mat [a00 a10 a20 a30]
           [a01 a11 a21 a31]
           [a02 a12 a22 a32]
           [a03 a13 a23 a33])

Create nxn matrix from nd vectors (columns).

Create nxn matrix from nd vectors (columns).
sourceraw docstring

cols->mat2x2clj

(cols->mat2x2 [a00 a10] [a01 a11])

Create 2x2 matrix from 2d vectors (columns).

Create 2x2 matrix from 2d vectors (columns).
sourceraw docstring

cols->mat3x3clj

(cols->mat3x3 [a00 a10 a20] [a01 a11 a21] [a02 a12 a22])

Create 3x3 matrix from 3d vectors (columns).

Create 3x3 matrix from 3d vectors (columns).
sourceraw docstring

cols->mat4x4clj

(cols->mat4x4 [a00 a10 a20 a30]
              [a01 a11 a21 a31]
              [a02 a12 a22 a32]
              [a03 a13 a23 a33])

Create 4x4 matrix from 4d vectors (columns).

Create 4x4 matrix from 4d vectors (columns).
sourceraw docstring

conditionclj

(condition A)
(condition A norm-type)

Condition number calculated for L2 norm by default (see norm for other norm types).

Cond(A) = norm(A) * norm(inv(A))

Condition number calculated for L2 norm by default (see [[norm]] for other norm types).

Cond(A) = norm(A) * norm(inv(A))
sourceraw docstring

cosclj

(cos vector)

Apply cos to matrix elements.

Apply cos to matrix elements.
sourceraw docstring

coshclj

(cosh vector)

Apply cosh to matrix elements.

Apply cosh to matrix elements.
sourceraw docstring

cotclj

(cot vector)

Apply cot to matrix elements.

Apply cot to matrix elements.
sourceraw docstring

cothclj

(coth vector)

Apply coth to matrix elements.

Apply coth to matrix elements.
sourceraw docstring

cscclj

(csc vector)

Apply csc to matrix elements.

Apply csc to matrix elements.
sourceraw docstring

cschclj

(csch vector)

Apply csch to matrix elements.

Apply csch to matrix elements.
sourceraw docstring

degreesclj

(degrees vector)

Apply degrees to matrix elements.

Apply degrees to matrix elements.
sourceraw docstring

detclj

(det A)

Return determinant of the matrix.

Return determinant of the matrix.
sourceraw docstring

diagclj

(diag A)

Return diagonal of the matrix as a vector.

Return diagonal of the matrix as a vector.
sourceraw docstring

diagonalclj

(diagonal v)
(diagonal a11 a22)
(diagonal a11 a22 a33)
(diagonal a11 a22 a33 a44)

Create diagonal matrix

Create diagonal matrix
sourceraw docstring

eigenvaluesclj

(eigenvalues A)

Return complex eigenvalues for given matrix as a sequence

Return complex eigenvalues for given matrix as a sequence
sourceraw docstring

eigenvalues-matrixclj

(eigenvalues-matrix A)

Return eigenvalues for given matrix as a diagonal or block diagonal matrix

Return eigenvalues for given matrix as a diagonal or block diagonal matrix
sourceraw docstring

eigenvectorsclj

(eigenvectors A)
(eigenvectors A normalize?)

Return eigenvectors as a matrix (columns). Vectors can be normalized.

Return eigenvectors as a matrix (columns). Vectors can be normalized.
sourceraw docstring

emulmclj

(emulm A B)

Multiply two matrices element-wise, Hadamard product, C=AoB

Multiply two matrices element-wise, Hadamard product, C=AoB
sourceraw docstring

expclj

(exp vector)

Apply exp to matrix elements.

Apply exp to matrix elements.
sourceraw docstring

expm1clj

(expm1 vector)

Apply expm1 to matrix elements.

Apply expm1 to matrix elements.
sourceraw docstring

eyeclj

source

floorclj

(floor vector)

Apply floor to matrix elements.

Apply floor to matrix elements.
sourceraw docstring

fmapclj

(fmap A f)

Apply a function f to each matrix element.

Apply a function `f` to each matrix element.
sourceraw docstring

fracclj

(frac vector)

Apply frac to matrix elements.

Apply frac to matrix elements.
sourceraw docstring

inverseclj

(inverse m)

Matrix inversion.

Returns nil if inversion doesn't exist.

Matrix inversion.

Returns `nil` if inversion doesn't exist.
sourceraw docstring

jincclj

(jinc vector)

Apply jinc to matrix elements.

Apply jinc to matrix elements.
sourceraw docstring

lnclj

(ln vector)

Apply ln to matrix elements.

Apply ln to matrix elements.
sourceraw docstring

logclj

(log vector)

Apply log to matrix elements.

Apply log to matrix elements.
sourceraw docstring

log10clj

(log10 vector)

Apply log10 to matrix elements.

Apply log10 to matrix elements.
sourceraw docstring

log1mexpclj

(log1mexp vector)

Apply log1mexp to matrix elements.

Apply log1mexp to matrix elements.
sourceraw docstring

log1pclj

(log1p vector)

Apply log1p to matrix elements.

Apply log1p to matrix elements.
sourceraw docstring

log1pexpclj

(log1pexp vector)

Apply log1pexp to matrix elements.

Apply log1pexp to matrix elements.
sourceraw docstring

log1pmxclj

(log1pmx vector)

Apply log1pmx to matrix elements.

Apply log1pmx to matrix elements.
sourceraw docstring

log1psqclj

(log1psq vector)

Apply log1psq to matrix elements.

Apply log1psq to matrix elements.
sourceraw docstring

log2clj

(log2 vector)

Apply log2 to matrix elements.

Apply log2 to matrix elements.
sourceraw docstring

logexpm1clj

(logexpm1 vector)

Apply logexpm1 to matrix elements.

Apply logexpm1 to matrix elements.
sourceraw docstring

logitclj

(logit vector)

Apply logit to matrix elements.

Apply logit to matrix elements.
sourceraw docstring

logmxp1clj

(logmxp1 vector)

Apply logmxp1 to matrix elements.

Apply logmxp1 to matrix elements.
sourceraw docstring

matclj

(mat a00 a01 a10 a11)
(mat a00 a01 a02 a10 a11 a12 a20 a21 a22)
(mat a00 a01 a02 a03 a10 a11 a12 a13 a20 a21 a22 a23 a30 a31 a32 a33)

Create mat2x2, mat3x3 or mat4x4

Create mat2x2, mat3x3 or mat4x4
sourceraw docstring

mat->arrayclj

(mat->array A)

Return doubles of doubles

Return doubles of doubles
sourceraw docstring

mat->array2dclj

(mat->array2d A)

Return doubles of doubles

Return doubles of doubles
sourceraw docstring

mat->float-arrayclj

(mat->float-array A)

Return doubles of doubles

Return doubles of doubles
sourceraw docstring

mat->float-array2dclj

(mat->float-array2d A)

Return doubles of doubles

Return doubles of doubles
sourceraw docstring

mat->RealMatrixclj

(mat->RealMatrix A)

Return Apache Commons Math Array2DRowMatrix from a matrix

Return Apache Commons Math Array2DRowMatrix from a matrix
sourceraw docstring

mat2x2clj

(mat2x2 v)
(mat2x2 d1 d2)
(mat2x2 a00 a01 a10 a11)

Create 2x2 matrix.

Arity:

  • 1 - fills matrix with given value
  • 2 - creates diagonal matrix
  • 4 - creates row ordered matrix
Create 2x2 matrix.

Arity:

* 1 - fills matrix with given value
* 2 - creates diagonal matrix
* 4 - creates row ordered matrix
sourceraw docstring

mat3x3clj

(mat3x3 v)
(mat3x3 d1 d2 d3)
(mat3x3 a00 a01 a02 a10 a11 a12 a20 a21 a22)

Create 3x3 matrix.

Arity:

  • 1 - fills matrix with given value
  • 3 - creates diagonal matrix
  • 9 - creates row ordered matrix
Create 3x3 matrix.

Arity:

* 1 - fills matrix with given value
* 3 - creates diagonal matrix
* 9 - creates row ordered matrix
sourceraw docstring

mat4x4clj

(mat4x4 v)
(mat4x4 d1 d2 d3 d4)
(mat4x4 a00 a01 a02 a03 a10 a11 a12 a13 a20 a21 a22 a23 a30 a31 a32 a33)

Create 4x4 matrix.

Arity:

  • 1 - fills matrix with given value
  • 4 - creates diagonal matrix
  • 16 - creates row ordered matrix
Create 4x4 matrix.

Arity:

* 1 - fills matrix with given value
* 4 - creates diagonal matrix
* 16 - creates row ordered matrix
sourceraw docstring

mulmclj

(mulm A B)
(mulm A transposeA? B transposeB?)

Multiply two matrices, C=AxB.

Optionally you can request transposition of matrices.

Multiply two matrices, C=AxB.

Optionally you can request transposition of matrices.
sourceraw docstring

mulmtclj

(mulmt A B)

Multiply with transposed matrix, C=AxB^T

Multiply with transposed matrix, C=AxB^T
sourceraw docstring

mulsclj

(muls A s)

Multply matrix by a scalar, C=sA

Multply matrix by a scalar, C=sA
sourceraw docstring

mulvclj

(mulv A v)

Multply matrix by vector, x=Av

Multply matrix by vector, x=Av
sourceraw docstring

ncolclj

(ncol A)

Return number of rows

Return number of rows
sourceraw docstring

negateclj

(negate A)

Negate all matrix elements, C=-A

Negate all matrix elements, C=-A
sourceraw docstring

normclj

(norm A)
(norm A norm-type)

Calculate norm of the matrix for given type, default: 1 (maximum absolute column sum).

All norm types are:

  • 1 - maximum absolute column sum
  • :inf - maximum absolute row sum
  • 2 - spectral norm, maximum singular value
  • :max - maximum absolute value
  • :frobenius - Frobenius norm
  • [p,q] - generalized L_pq norm, [2,2] - Frobenius norm, [p,p] - entrywise p-norm
  • [p] - Shatten p-norm, [1] - nuclear/trace norm
Calculate norm of the matrix for given type, default: 1 (maximum absolute column sum).

All norm types are:
* 1 - maximum absolute column sum
* :inf -  maximum absolute row sum
* 2 - spectral norm, maximum singular value
* :max - maximum absolute value
* :frobenius - Frobenius norm
* [p,q] - generalized L_pq norm, [2,2] - Frobenius norm, [p,p] - entrywise p-norm
* [p] - Shatten p-norm, [1] - nuclear/trace norm
sourceraw docstring

normalizeclj

(normalize A)
(normalize A rows?)

Normalize columns (or rows)

Normalize columns (or rows)
sourceraw docstring

nrowclj

(nrow A)

Return number of rows

Return number of rows
sourceraw docstring

outerclj

(outer v1 v2)

Outer project for two vectors.

Outer project for two vectors.
sourceraw docstring

radiansclj

(radians vector)

Apply radians to matrix elements.

Apply radians to matrix elements.
sourceraw docstring

rintclj

(rint vector)

Apply rint to matrix elements.

Apply rint to matrix elements.
sourceraw docstring

rotation-matrix-2dclj

(rotation-matrix-2d theta)

Create rotation matrix for a plane

Create rotation matrix for a plane
sourceraw docstring

rotation-matrix-3dclj

(rotation-matrix-3d [x y z])
(rotation-matrix-3d x y z)

Create rotation matrix for a 3d space. Tait–Bryan angles z-y′-x″

Create rotation matrix for a 3d space. Tait–Bryan angles z-y′-x″
sourceraw docstring

rotation-matrix-3d-xclj

(rotation-matrix-3d-x a)

Create rotation matrix for a 3d space, x-axis, right hand rule.

Create rotation matrix for a 3d space, x-axis, right hand rule.
sourceraw docstring

rotation-matrix-3d-yclj

(rotation-matrix-3d-y a)

Create rotation matrix for a 3d space, y-axis, right hand rule.

Create rotation matrix for a 3d space, y-axis, right hand rule.
sourceraw docstring

rotation-matrix-3d-zclj

(rotation-matrix-3d-z a)

Create rotation matrix for a 3d space, z-axis, right hand rule.

Create rotation matrix for a 3d space, z-axis, right hand rule.
sourceraw docstring

rotation-matrix-axis-3dclj

(rotation-matrix-axis-3d angle axis)

Create 3d rotation matrix for axis ratation.

Create 3d rotation matrix for axis ratation.
sourceraw docstring

roundclj

(round vector)

Apply round to matrix elements.

Apply round to matrix elements.
sourceraw docstring

rowclj

(row A r)

Return row as a vector

Return row as a vector
sourceraw docstring

rowsclj

(rows A)

Return matrix rows

Return matrix rows
sourceraw docstring

rows->matclj

(rows->mat [a00 a01] [a10 a11])
(rows->mat [a00 a01 a02] [a10 a11 a12] [a20 a21 a22])
(rows->mat [a00 a01 a02 a03]
           [a10 a11 a12 a13]
           [a20 a21 a22 a23]
           [a30 a31 a32 a33])

Create nxn matrix from nd vectors (rows).

Create nxn matrix from nd vectors (rows).
sourceraw docstring

rows->mat2x2clj

(rows->mat2x2 [a00 a01] [a10 a11])

Create 2x2 matrix from 2d vectors (rows).

Create 2x2 matrix from 2d vectors (rows).
sourceraw docstring

rows->mat3x3clj

(rows->mat3x3 [a00 a01 a02] [a10 a11 a12] [a20 a21 a22])

Create 3x3 matrix from 3d vectors (rows).

Create 3x3 matrix from 3d vectors (rows).
sourceraw docstring

rows->mat4x4clj

(rows->mat4x4 [a00 a01 a02 a03]
              [a10 a11 a12 a13]
              [a20 a21 a22 a23]
              [a30 a31 a32 a33])

Create 4x4 matrix from 4d vectors (rows).

Create 4x4 matrix from 4d vectors (rows).
sourceraw docstring

rows->RealMatrixclj

(rows->RealMatrix rows)

Return Apache Commons Math Array2DRowMatrix from sequence of rows

Return Apache Commons Math Array2DRowMatrix from sequence of rows
sourceraw docstring

safe-sqrtclj

(safe-sqrt vector)

Apply safe-sqrt to matrix elements.

Apply safe-sqrt to matrix elements.
sourceraw docstring

secclj

(sec vector)

Apply sec to matrix elements.

Apply sec to matrix elements.
sourceraw docstring

sechclj

(sech vector)

Apply sech to matrix elements.

Apply sech to matrix elements.
sourceraw docstring

sfracclj

(sfrac vector)

Apply sfrac to matrix elements.

Apply sfrac to matrix elements.
sourceraw docstring

sgnclj

(sgn vector)

Apply sgn to matrix elements.

Apply sgn to matrix elements.
sourceraw docstring

sigmoidclj

(sigmoid vector)

Apply sigmoid to matrix elements.

Apply sigmoid to matrix elements.
sourceraw docstring

signumclj

(signum vector)

Apply signum to matrix elements.

Apply signum to matrix elements.
sourceraw docstring

sinclj

(sin vector)

Apply sin to matrix elements.

Apply sin to matrix elements.
sourceraw docstring

sincclj

(sinc vector)

Apply sinc to matrix elements.

Apply sinc to matrix elements.
sourceraw docstring

singular-valuesclj

(singular-values A)

Returun singular values of the matrix as sqrt of eigenvalues of A^T * A matrix.

Returun singular values of the matrix as sqrt of eigenvalues of A^T * A matrix.
sourceraw docstring

sinhclj

(sinh vector)

Apply sinh to matrix elements.

Apply sinh to matrix elements.
sourceraw docstring

solveclj

(solve A b)

Solve linear equation Ax=b

Solve linear equation Ax=b
sourceraw docstring

sqclj

(sq vector)

Apply sq to matrix elements.

Apply sq to matrix elements.
sourceraw docstring

sqrtclj

(sqrt vector)

Apply sqrt to matrix elements.

Apply sqrt to matrix elements.
sourceraw docstring

subclj

(sub A)
(sub A B)

Subract matrices, C=A-B.

Subract matrices, C=A-B.
sourceraw docstring

symmetric?clj

(symmetric? A)

Check if matrix is symmetric

Check if matrix is symmetric
sourceraw docstring

tanclj

(tan vector)

Apply tan to matrix elements.

Apply tan to matrix elements.
sourceraw docstring

tanhclj

(tanh vector)

Apply tanh to matrix elements.

Apply tanh to matrix elements.
sourceraw docstring

tmulmclj

(tmulm A B)

Transpose and multiply, C=A^TxB

Transpose and multiply, C=A^TxB
sourceraw docstring

tmulmtclj

(tmulmt A B)

Transpose both and multiply, C=A^TxB^T

Transpose both and multiply, C=A^TxB^T
sourceraw docstring

traceclj

(trace A)

Return trace of the matrix (sum of diagonal elements)

Return trace of the matrix (sum of diagonal elements)
sourceraw docstring

transposeclj

(transpose A)

Transpose matrix, C=A^T

Transpose matrix, C=A^T
sourceraw docstring

truncclj

(trunc vector)

Apply trunc to matrix elements.

Apply trunc to matrix elements.
sourceraw docstring

vtmulclj

(vtmul A v)

Multiply transposed vector by matrix, C=v^T A

Multiply transposed vector by matrix, C=v^T A
sourceraw docstring

xlogxclj

(xlogx vector)

Apply xlogx to matrix elements.

Apply xlogx to matrix elements.
sourceraw docstring

zeroclj

source

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

× close