4.3 Symmetric and Hermitian Linear Equations

sysv( A, B[, ipiv=None[, uplo='L']])
Solves

\begin{displaymath}
AX=B
\end{displaymath}

where A is a real or complex symmetric matrix of order n. On exit, B is replaced by the solution. The matrices A and B must have the same type ('d' or 'z'). The optional argument ipiv is an integer matrix of length at least equal to n. If ipiv is provided, sysv() solves the system and returns the factorization in A and ipiv. If ipiv is not specified, sysv() solves the system but does not return the factorization and does not modify A. Raises an ArithmeticError if the matrix is singular.

sytrf( A, ipiv[, uplo='L'])
LDL${}\mathrm{^T}$ factorization

\begin{displaymath}
PAP^T = LDL^T
\end{displaymath}

of a real or complex symmetric matrix $A$ of order n. ipiv is an 'i' matrix of length at least n. On exit, A and ipiv contain the factorization. Raises an ArithmeticError if the matrix is singular.

sytrs( A, ipiv, B[, uplo='L'])
Solves

\begin{displaymath}
AX=B
\end{displaymath}

given the LDL${}\mathrm{^T}$ factorization computed by sytrf() or sysv(). B must have the same type as A.

sytri( A, ipiv[, uplo='L'])
Computes the inverse of a real or complex symmetric matrix. On entry, A and ipiv contain the LDL${}\mathrm{^T}$ factorization computed by sytrf() or sysv(). On exit, A contains the inverse.

hesv( A, B[, ipiv=None[, uplo='L']])
Solves

\begin{displaymath}
AX=B
\end{displaymath}

where A is a real symmetric or complex Hermitian of order n. On exit, B is replaced by the solution. The matrices A and B must have the same type ('d' or 'z'). The optional argument ipiv is an integer matrix of length at least n. If ipiv is provided, then hesv() solves the system and returns the factorization in A and ipiv. If ipiv is not specified, then hesv() solves the system but does not return the factorization and does not modify A. Raises an ArithmeticError if the matrix is singular.

hetrf( A, ipiv[, uplo='L'])
LDL${}\mathrm{^H}$ factorization

\begin{displaymath}
PAP^T = LDL^H
\end{displaymath}

of a real symmetric or complex Hermitian matrix of order n. ipiv is an 'i' matrix of length at least n. On exit, A and ipiv contain the factorization. Raises an ArithmeticError if the matrix is singular.

hetrs( A, ipiv, B[, uplo='L'])
Solves

\begin{displaymath}
AX=B
\end{displaymath}

given the LDL${}\mathrm{^H}$ factorization computed by hetrf() or hesv().

hetri( A, ipiv[, uplo='L'])
Computes the inverse of a real symmetric or complex Hermitian matrix. On entry, A and ipiv contain the LDL${}\mathrm{^H}$ factorization computed by hetrf() or hesv(). On exit, A contains the inverse.

As an example we solve the KKT system (4.1).

>>> from cvxopt.lapack import sysv
>>> K = matrix(0.0, (m+n,m+n))
>>> K[: (m+n)*m : m+n+1] = -d**2
>>> K[:m, m:] = A
>>> x = matrix(0.0, (m+n,1))
>>> x[:m], x[m:] = b1, b2
>>> sysv(K, x, uplo='U')