fastmath.matrix
Fixed size (2x2, 3x3, 4x4) matrix types.
Categories
Other vars: ->Mat2x2 ->Mat3x3 ->Mat4x4 acos acosh acot acoth acsc acsch add adds asec asech asin asinh atan atanh cb cbrt ceil cholesky col cols cols->mat cols->mat2x2 cols->mat3x3 cols->mat4x4 condition cos cosh cot coth csc csch degrees det diag diagonal eigenvalues eigenvalues-matrix eigenvectors emulm exp expm1 eye floor fmap frac inverse jinc ln log log10 log1mexp log1p log1pexp log1pmx log1psq log2 logexpm1 logit logmxp1 mat mat->RealMatrix mat->array mat->array2d mat->float-array mat->float-array2d mat2x2 mat3x3 mat4x4 mulm mulmt muls mulv ncol negate norm normalize nrow outer radians rint rotation-matrix-2d rotation-matrix-3d rotation-matrix-3d-x rotation-matrix-3d-y rotation-matrix-3d-z rotation-matrix-axis-3d round row rows rows->RealMatrix rows->mat rows->mat2x2 rows->mat3x3 rows->mat4x4 safe-sqrt sec sech sfrac sgn sigmoid signum sin sinc singular-values sinh solve sq sqrt sub symmetric? tan tanh tmulm tmulmt trace transpose trunc vtmul xlogx zero
cholesky
(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.
cols->mat
(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).
cols->mat2x2
(cols->mat2x2 [a00 a10] [a01 a11])
Create 2x2 matrix from 2d vectors (columns).
cols->mat3x3
(cols->mat3x3 [a00 a10 a20] [a01 a11 a21] [a02 a12 a22])
Create 3x3 matrix from 3d vectors (columns).
cols->mat4x4
(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).
condition
(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))
diagonal
(diagonal v)
(diagonal a11 a22)
(diagonal a11 a22 a33)
(diagonal a11 a22 a33 a44)
Create diagonal matrix
eigenvalues-matrix
(eigenvalues-matrix A)
Return eigenvalues for given matrix as a diagonal or block diagonal matrix
eigenvectors
(eigenvectors A)
(eigenvectors A normalize?)
Return eigenvectors as a matrix (columns). Vectors can be normalized.
mat
(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
mat->RealMatrix
(mat->RealMatrix A)
Return Apache Commons Math Array2DRowMatrix from a matrix
mat2x2
(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
mat3x3
(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
mat4x4
(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
mulm
(mulm A B)
(mulm A transposeA? B transposeB?)
Multiply two matrices, C=AxB.
Optionally you can request transposition of matrices.
norm
(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
rotation-matrix-3d
(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″
rotation-matrix-3d-x
(rotation-matrix-3d-x a)
Create rotation matrix for a 3d space, x-axis, right hand rule.
rotation-matrix-3d-y
(rotation-matrix-3d-y a)
Create rotation matrix for a 3d space, y-axis, right hand rule.
rotation-matrix-3d-z
(rotation-matrix-3d-z a)
Create rotation matrix for a 3d space, z-axis, right hand rule.
rotation-matrix-axis-3d
(rotation-matrix-axis-3d angle axis)
Create 3d rotation matrix for axis ratation.
rows->mat
(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).
rows->mat3x3
(rows->mat3x3 [a00 a01 a02] [a10 a11 a12] [a20 a21 a22])
Create 3x3 matrix from 3d vectors (rows).
rows->mat4x4
(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).
rows->RealMatrix
(rows->RealMatrix rows)
Return Apache Commons Math Array2DRowMatrix from sequence of rows
singular-values
(singular-values A)
Returun singular values of the matrix as sqrt of eigenvalues of A^T * A matrix.