A, B[, uplo='L']) |
'd'
or
'z'
).
Raises an ArithmeticError
if the matrix is not positive definite.
A[, uplo='L']) |
'L'
) or the upper triangular part
(if uplo is 'U'
) is overwritten with the Cholesky factor
or its (conjugate) transpose.
Raises an ArithmeticError
if the matrix is not positive definite.
A, B[, uplo='L']) |
A[, uplo='L']) |
As an example, we use posv() to solve the linear system
>>> from cvxopt.base import matrix, div >>> from cvxopt.random import normal, uniform >>> from cvxopt.blas import syrk, gemv >>> from cvxopt.lapack import posv >>> m, n = 100, 50 >>> A = normal(m,n) >>> b1, b2 = normal(m), normal(n) >>> d = uniform(m)
>>> Asc = div(A, d[:, n*[0]]) # Asc := diag(d)^{-1}*A >>> B = matrix(0.0, (n,n)) >>> syrk(Asc, B, trans='T') # B := Asc^T * Asc = A^T * diag(d)^{-2} * A >>> x1 = div(b1, d) # x1 := diag(d)^{-1}*b1 >>> x2 = +b2 >>> gemv(Asc, x1, x2, trans='T', beta=1.0) # x2 := x2 + Asc^T*x1 = b2 + A^T*diag(d)^{-2}*b1 >>> posv(B, x2) # x2 := B^{-1}*x2 = B^{-1}*(b2 + A^T*diag(d)^{-2}*b1) >>> gemv(Asc, x2, x1, beta=-1.0) # x1 := Asc*x2 - x1 = diag(d)^{-1} * (A*x2 - b1) >>> x1 = div(x1, d) # x1 := diag(d)^{-1}*x1 = diag(d)^{-2} * (A*x2 - b1)
There are separate routines for equations with positive definite band matrices.
A, B[, uplo='L']) |
'd'
or 'z'
).
Raises an ArithmeticError
if the matrix is not positive definite.
A[, uplo='L']) |
ArithmeticError
if the matrix is not positive definite.
A, B[, uplo='L']) |
The following functions are useful for tridiagonal systems.
d, e, B) |
'd'
matrix of
length n) and subdiagonal e (a 'd'
or 'z'
matrix of length
n-1).
The arguments e and B must have the same type.
On exit d contains the diagonal elements of D in
the LDLArithmeticError
if the matrix is singular.
d, e) |
'd'
matrix with the diagonal elements
of A. The argument e is 'd'
or 'z'
matrix with
the subdiagonal elements of A.
On exit d contains the diagonal elements of D, and e
contains the subdiagonal elements of the unit lower bidiagonal matrix
L. Raises an ArithmeticError
if the matrix is singular.
d, e, B[, uplo='L']) |
'L'
, then e contains the subdiagonal
elements of the unit bidiagonal matrix L.
If uplo is 'U'
, then e contains the complex
conjugates of the elements of the unit bidiagonal matrix L.
On exit, B is overwritten with the solution X.
B must have the same type as e.