Linear Algebra
Using
using DoubleFloats, LinearAlgebraVectors and Matrices
using DoubleFloats, LinearAlgebra
n = 25
vector = rand(Double64, n)
matrix = reshape(rand(Double64,n*n),n,n)Matrix Predicates
iszero,isone,isdiagissquare,issymmetric,ishermitianisposdef,isposdef!istril,istriu
Matrix Operations
+,-,*,/rank,cond,norm,opnormdiagind,diagtranspose,adjointinv,pinv
Matrix Functions
det,logdet,logabsdet,treigvals,eigvals!,eigvecs,eigensvdvals,svdvals!,svd
Matrix Factorizations
- general:
lu,lu!,qr,qr!,lq - square:
schur,schur!,hessenberg,hessenberg! - square+symmetric, Hermitian:
cholesky,cholesky!,bunchkaufman
eigen for DoubleFloat matrices follows the LAPACK-route conventions: symmetric/Hermitian input yields real eigenvalues and orthonormal vectors, a real matrix with an all-real spectrum yields a real factorization, and eigenvalues are sorted by (real, imag).
Matrix Equations
sylvester(A, B, C)– solvesAX + XB + C = 0lyap(A, C)– solvesAX + XA' + C = 0
Functions of Matrices (any square matrix)
These use dense Schur-based and scaling-and-squaring algorithms, so they are correct for defective (non-diagonalizable) matrices too, and real matrices give real results whenever the mathematical result is real:
exp,expm1,log,log1p,log2,log10,sqrtmatrix^powersin,cos,sincos,tan,csc,sec,cotsinh,cosh,tanh,csch,sech,coth
Functions of Matrices (diagonalizable & square only)
These use eigen-diagonalization via matrixfunction(function, matrix):
cbrt,sinpi,cospiasin,acos,atan,acsc,asec,acotasinh,acosh,atanh,acsch,asech,acoth