Linear algebra

Matrix factorizations

Matrix factorizations (a.k.a. matrix decompositions) compute the factorization of a matrix into a product of matrices, and are one of the central concepts in linear algebra.

The following table summarizes the types of matrix factorizations that have been implemented in Julia. Details of their associated methods can be found in the Linear Algebra section of the standard library documentation.

CholeskyCholesky factorization
CholeskyPivotedPivoted Cholesky factorization
LULU factorization
LUTridiagonalLU factorization for Tridiagonal matrices
UmfpackLULU factorization for sparse matrices (computed by UMFPack)
QRQR factorization
QRCompactWYCompact WY form of the QR factorization
QRPivotedPivoted QR factorization
HessenbergHessenberg decomposition
EigenSpectral decomposition
SVDSingular value decomposition
GeneralizedSVDGeneralized SVD

Special matrices

Matrices with special symmetries and structures arise often in linear algebra and are frequently associated with various matrix factorizations. Julia features a rich collection of special matrix types, which allow for fast computation with specialized routines that are specially developed for particular matrix types.

The following tables summarize the types of special matrices that have been implemented in Julia, as well as whether hooks to various optimized methods for them in LAPACK are available.

HermitianHermitian matrix
UpperTriangularUpper triangular matrix
LowerTriangularLower triangular matrix
TridiagonalTridiagonal matrix
SymTridiagonalSymmetric tridiagonal matrix
BidiagonalUpper/lower bidiagonal matrix
DiagonalDiagonal matrix
UniformScalingUniform scaling operator

Elementary operations

Matrix type+-*\Other functions with optimized methods
Hermitian   MVinv(), sqrtm(), expm()
UpperTriangular  MVMVinv(), det()
LowerTriangular  MVMVinv(), det()
SymTridiagonalMMMSMVeigmax(), eigmin()
TridiagonalMMMSMV 
BidiagonalMMMSMV 
DiagonalMMMVMVinv(), det(), logdet(), /()
UniformScalingMMMVSMVS/()

Legend:

M (matrix)An optimized method for matrix-matrix operations is available
V (vector)An optimized method for matrix-vector operations is available
S (scalar)An optimized method for matrix-scalar operations is available

Matrix factorizations

Matrix typeLAPACKeig()eigvals()eigvecs()svd()svdvals()
HermitianHE ARI   
UpperTriangularTRAAA  
LowerTriangularTRAAA  
SymTridiagonalSTAARIAV  
TridiagonalGT     
BidiagonalBD   AA
DiagonalDI A   

Legend:

A (all)An optimized method to find all the characteristic values and/or vectors is availablee.g. eigvals(M)
R (range)An optimized method to find the ilth through the ihth characteristic values are availableeigvals(M,il,ih)
I (interval)An optimized method to find the characteristic values in the interval [vl, vh] is availableeigvals(M,vl,vh)
V (vectors)An optimized method to find the characteristic vectors corresponding to the characteristic values x=[x1,x2,...] is availableeigvecs(M,x)

The uniform scaling operator

A UniformScaling operator represents a scalar times the identity operator, λ*I. The identity operator I is defined as a constant and is an instance of UniformScaling. The size of these operators are generic and match the other matrix in the binary operations +, -, * and \. For A+I and A-I this means that A must be square. Multiplication with the identity operator I is a noop (except for checking that the scaling factor is one) and therefore almost without overhead.