Matrix Equations Utilities

MatrixEquations.utquFunction
X = utqu(Q,U)

Compute efficiently the symmetric/hermitian product X = U'QU, where Q is a symmetric/hermitian matrix.

source
MatrixEquations.utqu!Function
utqu!(Q,U) -> Q

Compute efficiently the symmetric/hermitian product U'QU -> Q, where Q is a symmetric/hermitian matrix and U is a square matrix. The resulting product overwrites Q.

source
MatrixEquations.qrupdate!Function
qrupdate!(R, Y) -> R

Update the upper triangular factor R by the upper triangular factor of the QR factorization of [ R; Y' ], where Y is a low-rank matrix Y (typically with one or two columns). The computation of R only uses O(n^2) operations (n is the size of R). The input matrix R is updated in place and the matrix Y is destroyed during the computation.

source
MatrixEquations.rqupdate!Function
rqupdate!(R, Y) -> R

Update the upper triangular factor R by the upper triangular factor of the RQ factorization of [ Y R], where Y is a low-rank matrix Y (typically with one or two columns). The computation of R only uses O(n^2) operations (n is the size of R). The input matrix R is updated in place and the matrix Y is destroyed during the computation.

source
MatrixEquations.isschurFunction
 isschur(A::AbstractMatrix) -> Bool

Test whether A is a square matrix in a real or complex Schur form. In the real case, it is only tested whether A is a quasi upper triangular matrix, which may have 2x2 diagonal blocks, which however must not correspond to complex conjugate eigenvalues. In the complex case, it is tested if A is upper triangular.

source
 isschur(A::AbstractMatrix, B::AbstractMatrix) -> Bool

Test whether (A,B) is a pair of square matrices in a real or complex generalized Schur form. In the real case, it is only tested whether B is upper triangular and A is a quasi upper triangular matrix, which may have 2x2 diagonal blocks, which however must not correspond to complex conjugate eigenvalues. In the complex case, it is tested if A and B are both upper triangular.

source
MatrixEquations.triu2vecFunction
x = triu2vec(Q; rowwise = false, her = false)

Reshape the upper triangular part of the nxn array Q as a one-dimensional column vector x with n(n+1)/2 elements. Q is assumed symmetric/hermitian if her = true. The elements of x correspond to stacking the elements of successive columns of the upper triangular part of Q, if rowwise = false, or stacking the elements of successive rows of the upper triangular part of Q, if rowwise = true.

source
MatrixEquations.vec2triuFunction
Q = vec2triu(x; rowwise = false, her = false)

Build from a one-dimensional column vector x with n(n+1)/2 elements an nxn upper triangular matrix Q if her = false or an nxn symmetric/hermitian array Q if her = true. The elements of x correspond to stacking the elements of successive columns of the upper triangular part of Q, if rowwise = false, or stacking the elements of successive rows of the upper triangular part of Q, if rowwise = true.

source