module LA
Included Modules
Defined in:
linalg.crlinalg/banded.cr
linalg/cholesky.cr
linalg/eig.cr
linalg/expm.cr
linalg/lapack_helper.cr
linalg/linalg.cr
linalg/lu.cr
linalg/matfun.cr
linalg/mult.cr
linalg/qr.cr
linalg/rq_lq_ql.cr
linalg/schur.cr
matrix/banded_matrix.cr
matrix/flag_checks.cr
matrix/flags.cr
matrix/general_matrix.cr
matrix/iteration.cr
matrix/matrix.cr
matrix/special_matrix.cr
matrix/submatrix.cr
Class Method Summary
- .cho_solve(a, b, *, overwrite_b = false)
-
.coshm(mat)
See
Matrix#coshm -
.cosm(mat)
See
Matrix#cosm -
.eigs(a, b, *, need_left : Bool, need_right : Bool, overwrite_a = false, overwrite_b = false)
See
GeneralMatrix#eigss(*, b : GeneralMatrix(T), need_left : Bool, need_right : Bool, overwrite_a = false, overwrite_b = false). -
.expm(mat)
See
Matrix#expm -
.inv(matrix, *, overwrite_a = false)
Calculate matrix inversion.
-
.lapack_version
Returns the LAPACK version as a tuple {major, minor, patch}.
-
.lstsq(a, b, method : LSMethod = LSMethod::Auto, *, overwrite_a = false, overwrite_b = false, cond = -1)
Solves the linear least squares problem min ||A*X - B||.
-
.qz(a, b, *, overwrite_a = false, overwrite_b = false)
See
GeneralMatrix#qz -
.sinhm(mat)
See
Matrix#sinhm -
.sinm(mat)
See
Matrix#sinm -
.solve(a, b, *, overwrite_a = false, overwrite_b = false)
Solves the linear system A * X = B.
-
.solvels(a, b, *, overwrite_a = false, overwrite_b = false, cond = -1)
Solves the linear least squares problem using QR factorization.
-
.svd(matrix, *, overwrite_a = false)
Computes the singular value decomposition (SVD) of a matrix.
-
.tanhm(mat)
See
Matrix#tanhm -
.tanm(mat)
See
Matrix#tanm
Instance Method Summary
-
#coshm(mat)
See
Matrix#coshm -
#cosm(mat)
See
Matrix#cosm -
#expm(mat)
See
Matrix#expm -
#sinhm(mat)
See
Matrix#sinhm -
#sinm(mat)
See
Matrix#sinm -
#tanhm(mat)
See
Matrix#tanhm -
#tanm(mat)
See
Matrix#tanm
Class Method Detail
See GeneralMatrix#eigss(*, b : GeneralMatrix(T), need_left : Bool, need_right : Bool, overwrite_a = false, overwrite_b = false).
Calculate matrix inversion.
Arguments:
- matrix (Matrix(T)) : The matrix to invert.
- overwrite_a (Bool) : If
true, allows overwriting the input matrix. Default:false.
Returns:
- GeneralMatrix(T) : The inverted matrix.
See GeneralMatrix#inv! for details of algorithm.
Returns the LAPACK version as a tuple {major, minor, patch}.
LAPACK Routine:
- Uses
ilaver(LAPACK version query).
Solves the linear least squares problem min ||A*X - B||.
Arguments:
- a (Matrix(T)) : Coefficient matrix.
- b (Matrix(T)) : Right-hand side matrix.
- method (LSMethod) : Algorithm to use. Default:
LSMethod::Auto. - overwrite_a (Bool) : If
true, allows overwritinga. Default:false. - overwrite_b (Bool) : If
true, allows overwritingb. Default:false. - cond (Number) : Cutoff for rank determination. Default: -1 (machine precision).
Returns:
- Tuple(GeneralMatrix(T), Int32, Array(T)) : Solution X, effective rank, singular values (if applicable).
See Matrix#lstsq for details.
Solves the linear system A * X = B.
Arguments:
- a (Matrix(T)) : Coefficient matrix.
- b (Matrix(T)) : Right-hand side matrix.
- overwrite_a (Bool) : If
true, allows overwritinga. Default:false. - overwrite_b (Bool) : If
true, allows overwritingb. Default:false.
Returns:
- GeneralMatrix(T) : Solution matrix X.
See Matrix#solve for details.
Solves the linear least squares problem using QR factorization.
Arguments:
- a (Matrix(T)) : Coefficient matrix.
- b (Matrix(T)) : Right-hand side matrix.
- overwrite_a (Bool) : If
true, allows overwritinga. Default:false. - overwrite_b (Bool) : If
true, allows overwritingb. Default:false. - cond (Number) : Cutoff for rank determination. Default: -1 (machine precision).
Returns:
- GeneralMatrix(T) : Solution matrix X.
See Matrix#solvels for details.
Computes the singular value decomposition (SVD) of a matrix.
Arguments:
- matrix (Matrix(T)) : Input matrix.
- overwrite_a (Bool) : If
true, allows overwritingmatrix. Default:false.
Returns:
- Tuple(GeneralMatrix(T), Array(T), GeneralMatrix(T)) : U, singular values, V^T.
See Matrix#svd for details.