Liking cljdoc? Tell your friends :D

fastmath.matrix

Provides tools for working with various matrix types, including fixed-size (2x2, 3x3, 4x4), Java double[][] arrays, and Apache Commons Math RealMatrix.

It offers efficient mathematical operations for linear algebra, geometric transformations, and data manipulation, unifying different representations under a common protocol approach where appropriate.

Provides tools for working with various matrix types, including fixed-size (2x2, 3x3, 4x4), Java `double[][]` arrays, and Apache Commons Math `RealMatrix`.

It offers efficient mathematical operations for linear algebra, geometric transformations, and data manipulation, unifying different representations under a common protocol approach where appropriate.
raw docstring

acosclj

(acos vector)

Applies acos to matrix elements.

Applies acos to matrix elements.
sourceraw docstring

acoshclj

(acosh vector)

Applies acosh to matrix elements.

Applies acosh to matrix elements.
sourceraw docstring

acotclj

(acot vector)

Applies acot to matrix elements.

Applies acot to matrix elements.
sourceraw docstring

acothclj

(acoth vector)

Applies acoth to matrix elements.

Applies acoth to matrix elements.
sourceraw docstring

acscclj

(acsc vector)

Applies acsc to matrix elements.

Applies acsc to matrix elements.
sourceraw docstring

acschclj

(acsch vector)

Applies acsch to matrix elements.

Applies acsch to matrix elements.
sourceraw docstring

addclj

(add A)
(add A B)

Adds matrices, C=A+B.

Adds matrices, C=A+B.
sourceraw docstring

addsclj

(adds A s)

Adds scalar to all matrix elements

Adds scalar to all matrix elements
sourceraw docstring

array2d->mat2x2clj

(array2d->mat2x2 arrs)

Creates 2x2 matrix from 2d double array.

Creates 2x2 matrix from 2d double array.
sourceraw docstring

array2d->mat3x3clj

(array2d->mat3x3 arrs)

Creates 3x3 matrix from 2d double array.

Creates 3x3 matrix from 2d double array.
sourceraw docstring

array2d->mat4x4clj

(array2d->mat4x4 arrs)

Creates 4x4 matrix from 2d double array.

Creates 4x4 matrix from 2d double array.
sourceraw docstring

array2d->RealMatrixclj

(array2d->RealMatrix arrs)

Creates RealMatrix matrix from 2d double array.

Creates RealMatrix matrix from 2d double array.
sourceraw docstring

asecclj

(asec vector)

Applies asec to matrix elements.

Applies asec to matrix elements.
sourceraw docstring

asechclj

(asech vector)

Applies asech to matrix elements.

Applies asech to matrix elements.
sourceraw docstring

asinclj

(asin vector)

Applies asin to matrix elements.

Applies asin to matrix elements.
sourceraw docstring

asinhclj

(asinh vector)

Applies asinh to matrix elements.

Applies asinh to matrix elements.
sourceraw docstring

atanclj

(atan vector)

Applies atan to matrix elements.

Applies atan to matrix elements.
sourceraw docstring

atanhclj

(atanh vector)

Applies atanh to matrix elements.

Applies atanh to matrix elements.
sourceraw docstring

bind-colsclj

(bind-cols mats)
(bind-cols m & r)

Creates matrix from columns of given matrices.

Creates matrix from columns of given matrices.
sourceraw docstring

bind-rowsclj

(bind-rows mats)
(bind-rows m & r)

Creates matrix from rows of given matrices.

Creates matrix from rows of given matrices.
sourceraw docstring

block-diagonalclj

(block-diagonal mats)
(block-diagonal m & r)

Creates block diagonal matrix (RealMatrix) from a sequence of square matrices.

Creates block diagonal matrix (RealMatrix) from a sequence of square matrices.
sourceraw docstring

cbclj

(cb vector)

Applies cb to matrix elements.

Applies cb to matrix elements.
sourceraw docstring

cbrtclj

(cbrt vector)

Applies cbrt to matrix elements.

Applies cbrt to matrix elements.
sourceraw docstring

ceilclj

(ceil vector)

Applies ceil to matrix elements.

Applies ceil to matrix elements.
sourceraw docstring

choleskycljdeprecated

(cholesky A)
(cholesky A upper?)

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

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

Calculates 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

cholesky-decompositionclj

(cholesky-decomposition mat)
(cholesky-decomposition mat symmetry_threshold positivity_threshold)

Performs Cholesky decomposition.

Decomposition of real symmetric positive-definite matrix. A = L x LT

Solver minimizes using least squares method.

Components, access with decomposition-component function:

  • :L, :LT - matrices
  • :det - determinant.

Can be used as input for solve, inverse and singular? functions.

Performs Cholesky decomposition.

Decomposition of real symmetric positive-definite matrix. A = L x LT

Solver minimizes using least squares method.

Components, access with `decomposition-component` function:

* `:L`, `:LT` - matrices
* `:det` - determinant.

Can be used as input for `solve`, `inverse` and `singular?` functions.
sourceraw docstring

colclj

(col A c)

Returns column as a vector

Returns column as a vector
sourceraw docstring

colsclj

(cols A)

Returns matrix columns

Returns matrix columns
sourceraw docstring

cols->matclj

(cols->mat real-matrix-cols)
(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])

Creates nxn matrix from nd vectors (columns).

Creates 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])

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

Creates 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])

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

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

cols->RealMatrixclj

(cols->RealMatrix cols)

Returns Apache Commons Math Array2DRowMatrix from sequence of columns

Returns Apache Commons Math Array2DRowMatrix from sequence of 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)

Applies cos to matrix elements.

Applies cos to matrix elements.
sourceraw docstring

coshclj

(cosh vector)

Applies cosh to matrix elements.

Applies cosh to matrix elements.
sourceraw docstring

cotclj

(cot vector)

Applies cot to matrix elements.

Applies cot to matrix elements.
sourceraw docstring

cothclj

(coth vector)

Applies coth to matrix elements.

Applies coth to matrix elements.
sourceraw docstring

cscclj

(csc vector)

Applies csc to matrix elements.

Applies csc to matrix elements.
sourceraw docstring

cschclj

(csch vector)

Applies csch to matrix elements.

Applies csch to matrix elements.
sourceraw docstring

decomposition-componentclj

(decomposition-component decomposition-matrix component-name)

Returns value of the component of matrix decomposition

Returns value of the component of matrix decomposition
sourceraw docstring

degreesclj

(degrees vector)

Applies degrees to matrix elements.

Applies degrees to matrix elements.
sourceraw docstring

demeanclj

(demean A)
(demean A rows?)

Subracts mean from columns (or rows)

Subracts mean from columns (or rows)
sourceraw docstring

detclj

(det A)

Returns determinant of the matrix.

Returns determinant of the matrix.
sourceraw docstring

diagclj

(diag A)

Returns diagonal of the matrix as a vector.

Returns diagonal of the matrix as a vector.
sourceraw docstring

diag->mat2x2clj

(diag->mat2x2 d)
(diag->mat2x2 d1 d2)

Creates 2x2 diagonal matrix.

Creates 2x2 diagonal matrix.
sourceraw docstring

diag->mat3x3clj

(diag->mat3x3 d)
(diag->mat3x3 d1 d2 d3)

Creates 3x3 diagonal matrix.

Creates 3x3 diagonal matrix.
sourceraw docstring

diag->mat4x4clj

(diag->mat4x4 d)
(diag->mat4x4 d1 d2 d3 d4)

Creates 4x4 diagonal matrix.

Creates 4x4 diagonal matrix.
sourceraw docstring

diagonalclj

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

Creates diagonal matrix.

Creates diagonal matrix.
sourceraw docstring

differencesclj

(differences m)
(differences m diffs)
(differences m diffs lag)

Apply lagged differences on matrix columns, always returns RealMatrix.

Apply lagged differences on matrix columns, always returns RealMatrix.
sourceraw docstring

eigen-decompositionclj

(eigen-decomposition mat)

Performs Eigen decomposition.

A = V x D x VT, D contains eigenvalues (diagonal: real values, subdiagonal: imaginary), V - eigenvectors.

Solver is exact.

Components, access with decomposition-component function:

  • :D, :V, :VT, :sqrt - matrices.
  • :det - determinant
  • :real-eigenvalues, imag-eigenvalues - eigenvalues
  • :eigenvectors - sequence of eigenvectors
  • :complex? - are eigenvalues complex?

Can be used as input for solve, inverse and singular? functions.

Performs Eigen decomposition.

A = V x D x VT, D contains eigenvalues (diagonal: real values, subdiagonal: imaginary), V - eigenvectors.

Solver is exact.

Components, access with `decomposition-component` function:

* `:D`, `:V`, `:VT`, `:sqrt`  - matrices.
* `:det` - determinant
* `:real-eigenvalues`, `imag-eigenvalues` - eigenvalues
* `:eigenvectors` - sequence of eigenvectors
* `:complex?` - are eigenvalues complex?

Can be used as input for `solve`, `inverse` and `singular?` functions.
sourceraw docstring

eigenvaluesclj

(eigenvalues A)

Returns complex eigenvalues for given matrix as a sequence

Returns complex eigenvalues for given matrix as a sequence
sourceraw docstring

eigenvalues-matrixclj

(eigenvalues-matrix A)

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

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

eigenvectorsclj

(eigenvectors A)
(eigenvectors A normalize?)

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

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

emulmclj

(emulm A B)

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

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

entryclj

(entry A row col)

Returns entry at given row and column

Returns entry at given row and column
sourceraw docstring

expclj

(exp vector)

Applies exp to matrix elements.

Applies exp to matrix elements.
sourceraw docstring

expm1clj

(expm1 vector)

Applies expm1 to matrix elements.

Applies expm1 to matrix elements.
sourceraw docstring

eyeclj

(eye size)
(eye size real-matrix?)

Creates identity matrix for given size.

Creates identity matrix for given size.
sourceraw docstring

floorclj

(floor vector)

Applies floor to matrix elements.

Applies floor to matrix elements.
sourceraw docstring

fmapclj

(fmap A f)

Applies a function f to each matrix element.

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

fracclj

(frac vector)

Applies frac to matrix elements.

Applies 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

kroneckerclj

(kronecker mat1 mat2)

Returns Kronecker product of two matrices.

Returns Kronecker product of two matrices.
sourceraw docstring

lnclj

(ln vector)

Applies ln to matrix elements.

Applies ln to matrix elements.
sourceraw docstring

logclj

(log vector)

Applies log to matrix elements.

Applies log to matrix elements.
sourceraw docstring

log10clj

(log10 vector)

Applies log10 to matrix elements.

Applies log10 to matrix elements.
sourceraw docstring

log1mexpclj

(log1mexp vector)

Applies log1mexp to matrix elements.

Applies log1mexp to matrix elements.
sourceraw docstring

log1pclj

(log1p vector)

Applies log1p to matrix elements.

Applies log1p to matrix elements.
sourceraw docstring

log1pexpclj

(log1pexp vector)

Applies log1pexp to matrix elements.

Applies log1pexp to matrix elements.
sourceraw docstring

log1pmxclj

(log1pmx vector)

Applies log1pmx to matrix elements.

Applies log1pmx to matrix elements.
sourceraw docstring

log1psqclj

(log1psq vector)

Applies log1psq to matrix elements.

Applies log1psq to matrix elements.
sourceraw docstring

log2clj

(log2 vector)

Applies log2 to matrix elements.

Applies log2 to matrix elements.
sourceraw docstring

logexpm1clj

(logexpm1 vector)

Applies logexpm1 to matrix elements.

Applies logexpm1 to matrix elements.
sourceraw docstring

logitclj

(logit vector)

Applies logit to matrix elements.

Applies logit to matrix elements.
sourceraw docstring

logmxp1clj

(logmxp1 vector)

Applies logmxp1 to matrix elements.

Applies logmxp1 to matrix elements.
sourceraw docstring

lu-decompositionclj

(lu-decomposition mat)
(lu-decomposition mat threshold)

Performs QR decomposition.

A = inv(P) x L x U, L is lower triangular, U is upper triangular.

Solver is exact.

Components, access with decomposition-component function:

  • :L, :U, :P (permutation) - matrices.
  • :det - determinant
  • :pivot - pivot permutation vector

Can be used as input for solve, inverse and singular? functions.

Performs QR decomposition.

A = inv(P) x L x U, L is lower triangular, U is upper triangular.

Solver is exact.

Components, access with `decomposition-component` function:

* `:L`, `:U`, `:P` (permutation)  - matrices.
* `:det` - determinant
* `:pivot` - pivot permutation vector

Can be used as input for `solve`, `inverse` and `singular?` functions.
sourceraw docstring

map-colsclj

(map-cols f A)

Operate on columns, f should return a column

Operate on columns, f should return a column
sourceraw docstring

map-rowsclj

(map-rows f A)

Operate on rows, f should return a row

Operate on rows, f should return a row
sourceraw docstring

matclj

(mat real-matrix-rows)
(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)

Creates mat2x2, mat3x3 or mat4x4 or RealMatrix from rows

Creates mat2x2, mat3x3 or mat4x4 or RealMatrix from rows
sourceraw docstring

mat->arrayclj

(mat->array A)

Returns flat double array of entries (row order)

Returns flat double array of entries (row order)
sourceraw docstring

mat->array2dclj

(mat->array2d A)

Returns doubles of doubles

Returns doubles of doubles
sourceraw docstring

mat->float-arrayclj

(mat->float-array A)

Returns flat float array of entries (row order)

Returns flat float array of entries (row order)
sourceraw docstring

mat->float-array2dclj

(mat->float-array2d A)

Returns doubles of doubles

Returns doubles of doubles
sourceraw docstring

mat->RealMatrixclj

(mat->RealMatrix A)

Returns Apache Commons Math Array2DRowMatrix from a 2x2, 3x3 or 4x4 matrix

Returns Apache Commons Math Array2DRowMatrix from a 2x2, 3x3 or 4x4 matrix
sourceraw docstring

mat->seqclj

(mat->seq A)

Returns flat sequence of entries (row order)

Returns flat sequence of entries (row order)
sourceraw docstring

mat2x2clj

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

Creates 2x2 matrix.

Arity:

  • 1 - fills matrix with given value
  • 2 - creates diagonal matrix
  • 4 - creates row ordered matrix
Creates 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)

Creates 3x3 matrix.

Arity:

  • 1 - fills matrix with given value
  • 3 - creates diagonal matrix
  • 9 - creates row ordered matrix
Creates 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)

Creates 4x4 matrix.

Arity:

  • 1 - fills matrix with given value
  • 4 - creates diagonal matrix
  • 16 - creates row ordered matrix
Creates 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?)

Multiplies two matrices, C=AxB.

Optionally you can apply transposition of matrices.

Multiplies two matrices, C=AxB.

Optionally you can apply transposition of matrices.
sourceraw docstring

mulmtclj

(mulmt A B)

Multiplies with transposed matrix, C=AxB^T

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

mulsclj

(muls A s)

Multplies matrix by a scalar, C=sA

Multplies matrix by a scalar, C=sA
sourceraw docstring

mulvclj

(mulv A v)

Multplies matrix by a vector, x=Av

Multplies matrix by a vector, x=Av
sourceraw docstring

ncolclj

(ncol A)

Returns number of rows

Returns number of rows
sourceraw docstring

negateclj

(negate A)

Negates all matrix elements, C=-A

Negates all matrix elements, C=-A
sourceraw docstring

normclj

(norm A)
(norm A norm-type)

Calculates 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
Calculates 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?)

Normalizes columns (or rows)

Normalizes columns (or rows)
sourceraw docstring

nrowclj

(nrow A)

Returns number of rows

Returns number of rows
sourceraw docstring

outerclj

(outer v1 v2)

Outer project for two vectors.

Outer project for two vectors.
sourceraw docstring

powclj

(pow m exponent)

Applies power to a vector elements.

Applies power to a vector elements.
sourceraw docstring

pow10clj

(pow10 vector)

Applies pow10 to matrix elements.

Applies pow10 to matrix elements.
sourceraw docstring

qr-decompositionclj

(qr-decomposition mat)
(qr-decomposition mat threshold)

Performs QR decomposition.

A = Q x R, Q is orthogonal (QT x Q = I), R is upper triangular.

Solver minimizes using least squares method.

Components, access with decomposition-component function:

  • :H (Hauseholder reflecors), :Q, :QT, :R - matrices.

Can be used as input for solve, inverse and singular? functions.

Performs QR decomposition.

A = Q x R, Q is orthogonal (QT x Q = I), R is upper triangular.

Solver minimizes using least squares method.

Components, access with `decomposition-component` function:

* `:H` (Hauseholder reflecors), `:Q`, `:QT`, `:R`  - matrices.

Can be used as input for `solve`, `inverse` and `singular?` functions.
sourceraw docstring

radiansclj

(radians vector)

Applies radians to matrix elements.

Applies radians to matrix elements.
sourceraw docstring

real-matrixclj

(real-matrix rows)

Creates Apache Commons Math Array2DRowMatrix from sequence of rows

Creates Apache Commons Math Array2DRowMatrix from sequence of rows
sourceraw docstring

rintclj

(rint vector)

Applies rint to matrix elements.

Applies rint to matrix elements.
sourceraw docstring

rotation-matrix-2dclj

(rotation-matrix-2d theta)

Creates rotation matrix for a plane

Creates rotation matrix for a plane
sourceraw docstring

rotation-matrix-3dclj

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

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

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

rotation-matrix-3d-xclj

(rotation-matrix-3d-x a)

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

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

rotation-matrix-3d-yclj

(rotation-matrix-3d-y a)

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

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

rotation-matrix-3d-zclj

(rotation-matrix-3d-z a)

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

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

rotation-matrix-axis-3dclj

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

Creates 3d rotation matrix for axis ratation.

Creates 3d rotation matrix for axis ratation.
sourceraw docstring

roundclj

(round vector)

Applies round to matrix elements.

Applies round to matrix elements.
sourceraw docstring

rowclj

(row A r)

Returns row as a vector

Returns row as a vector
sourceraw docstring

rowsclj

(rows A)

Returns matrix rows

Returns matrix rows
sourceraw docstring

rows->matclj

(rows->mat real-matrix-rows)
(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])

Creates nxn matrix from nd vectors (rows).

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

rows->mat2x2clj

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

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

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

rows->mat3x3clj

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

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

Creates 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])

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

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

rows->RealMatrixclj

(rows->RealMatrix rows)

Returns Apache Commons Math Array2DRowMatrix from sequence of rows

Returns Apache Commons Math Array2DRowMatrix from sequence of rows
sourceraw docstring

rrqr-decompositionclj

(rrqr-decomposition mat)
(rrqr-decomposition mat threshold)

Performs Rank-Revealing QR decomposition.

A = Q x R x inv(P), Q is orthogonal (QT x Q = I), R is upper triangular.

Solver minimizes using least squares method.

Components, access with decomposition-component function:

  • :H (Hauseholder reflecors), :Q, :QT, :R, :P (permutation) - matrices
  • :rank-fn - calculates numerical matrix rank, accepts threshold for rank computation (default: 0.0).

Can be used as input for solve, inverse and singular? functions.

Performs Rank-Revealing QR decomposition.

A = Q x R x inv(P), Q is orthogonal (QT x Q = I), R is upper triangular.

Solver minimizes using least squares method.

Components, access with `decomposition-component` function:

* `:H` (Hauseholder reflecors), `:Q`, `:QT`, `:R`, `:P` (permutation)  - matrices
* `:rank-fn` - calculates numerical matrix rank, accepts threshold for rank computation (default: 0.0).

Can be used as input for `solve`, `inverse` and `singular?` functions.
sourceraw docstring

safe-sqrtclj

(safe-sqrt vector)

Applies safe-sqrt to matrix elements.

Applies safe-sqrt to matrix elements.
sourceraw docstring

scale-colsclj

(scale-cols A)
(scale-cols A scale)

Multiplies cols by a value (default: 1/(sqrt(sum(x^2)/(n-1)))) or a result of the function

Multiplies cols by a value (default: 1/(sqrt(sum(x^2)/(n-1)))) or a result of the function
sourceraw docstring

scale-rowsclj

(scale-rows A)
(scale-rows A scale)

Multiplies rows by a value (default: 1/(sqrt(sum(x^2)/(n-1)))) or a result of the function

Multiplies rows by a value (default: 1/(sqrt(sum(x^2)/(n-1)))) or a result of the function
sourceraw docstring

secclj

(sec vector)

Applies sec to matrix elements.

Applies sec to matrix elements.
sourceraw docstring

sechclj

(sech vector)

Applies sech to matrix elements.

Applies sech to matrix elements.
sourceraw docstring

sfracclj

(sfrac vector)

Applies sfrac to matrix elements.

Applies sfrac to matrix elements.
sourceraw docstring

sgnclj

(sgn vector)

Applies sgn to matrix elements.

Applies sgn to matrix elements.
sourceraw docstring

shapeclj

(shape A)

Returns [nrow, ncol] pair.

Returns [nrow, ncol] pair.
sourceraw docstring

shift-colsclj

(shift-cols A)
(shift-cols A shift)

Shifts columns by a value or a result of the function (negative of mean by default)

Shifts columns by a value or a result of the function (negative of  mean by default)
sourceraw docstring

shift-rowsclj

(shift-rows A)
(shift-rows A shift)

Shifts rows by a value or a result of the function (nagetive of mean by default)

Shifts rows by a value or a result of the function (nagetive of mean by default)
sourceraw docstring

sigmoidclj

(sigmoid vector)

Applies sigmoid to matrix elements.

Applies sigmoid to matrix elements.
sourceraw docstring

signumclj

(signum vector)

Applies signum to matrix elements.

Applies signum to matrix elements.
sourceraw docstring

sinclj

(sin vector)

Applies sin to matrix elements.

Applies sin to matrix elements.
sourceraw docstring

sincclj

(sinc vector)

Applies sinc to matrix elements.

Applies sinc to matrix elements.
sourceraw docstring

singular-valuesclj

(singular-values A)

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

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

singular?clj

(singular? mat)

Returns singularity of the matrix

Returns singularity of the matrix
sourceraw docstring

sinhclj

(sinh vector)

Applies sinh to matrix elements.

Applies sinh to matrix elements.
sourceraw docstring

solveclj

(solve A b)

Solve linear equation Ax=b, if decomposition is provided, decomposition is used.

Some decompositions solve using least squares method.

Solve linear equation Ax=b, if decomposition is provided, decomposition is used.

Some decompositions solve using least squares method.
sourceraw docstring

sqclj

(sq vector)

Applies sq to matrix elements.

Applies sq to matrix elements.
sourceraw docstring

sqrtclj

(sqrt vector)

Applies sqrt to matrix elements.

Applies sqrt to matrix elements.
sourceraw docstring

square?clj

(square? m)

Is matrix square?

Is matrix square?
sourceraw docstring

standardizeclj

(standardize A)
(standardize A rows?)

Normalizes columns (or rows) to have mean = 0 and stddev = 1

Normalizes columns (or rows) to have mean = 0 and stddev = 1
sourceraw docstring

subclj

(sub A)
(sub A B)

Subracts matrices, C=A-B.

Subracts matrices, C=A-B.
sourceraw docstring

sv-decompositionclj

(sv-decomposition mat)

Performs Singular Value Decomposition (SVD).

A = U x S x VT

Solver minimizes using least squares method.

Components, access with decomposition-component function:

  • :S, :U, :UT, :V :VT - matrices
  • :singular-values - vector of singular values
  • :info
    • :condition-number
    • :inv-condition-number
    • :norm - L2 norm
    • :rank - effective numerical rank
  • coviariance-fn - convariance function, returns covariance V x J x VT, where J is inverse of squares of singular values. When min-sv argument is provided, ignores singular values lower than its value.

Can be used as input for solve, inverse and singular? functions.

Performs Singular Value Decomposition (SVD).

A = U x S x VT

Solver minimizes using least squares method.

Components, access with `decomposition-component` function:

* `:S`, `:U`, `:UT`, `:V` `:VT` - matrices
* `:singular-values` - vector of singular values
* `:info`
    - `:condition-number`
    - `:inv-condition-number`
    - `:norm` - L2 norm
    - `:rank` - effective numerical rank
* `coviariance-fn` - convariance function, returns covariance V x J x VT, where J is inverse of squares of singular values. When `min-sv` argument is provided, ignores singular values lower than its value.

Can be used as input for `solve`, `inverse` and `singular?` functions.
sourceraw docstring

symmetric?clj

(symmetric? A)
(symmetric? A tolerance)

Checks if matrix is symmetric

Checks if matrix is symmetric
sourceraw docstring

tanclj

(tan vector)

Applies tan to matrix elements.

Applies tan to matrix elements.
sourceraw docstring

tanhclj

(tanh vector)

Applies tanh to matrix elements.

Applies tanh to matrix elements.
sourceraw docstring

tmulmclj

(tmulm A B)

Transposes and multiplies, C=A^TxB

Transposes and multiplies, C=A^TxB
sourceraw docstring

tmulmtclj

(tmulmt A B)

Transposes both and multiplies, C=A^TxB^T

Transposes both and multiplies, C=A^TxB^T
sourceraw docstring

traceclj

(trace A)

Returns trace of the matrix (sum of diagonal elements)

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

transposeclj

(transpose A)

Transposes matrix, C=A^T

Transposes matrix, C=A^T
sourceraw docstring

truncclj

(trunc vector)

Applies trunc to matrix elements.

Applies trunc to matrix elements.
sourceraw docstring

vtmulclj

(vtmul A v)

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

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

xlogxclj

(xlogx vector)

Applies xlogx to matrix elements.

Applies xlogx to matrix elements.
sourceraw docstring

zeroclj

(zero size)
(zero size real-matrix?)
(zero rows cols real-matrix?)

Creates zero matrix for given size.

Creates zero matrix for given size.
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close