See Also:
T. A. Davis, Algorithm 832: UMFPACK - an unsymmetric-pattern multifrontal method with a column pre-ordering strategy, ACM Transactions on Mathematical Software, 30(2), 196-199, 2004.
A, B[, trans='N']) |
'd'
or 'z'
) as A. On exit B contains
the solution.
Raises an ArithmeticError
exception if the coefficient matrix
is singular.
>>> from cvxopt.base import spmatrix, matrix >>> from cvxopt import umfpack >>> V = [2,3, 3,-1,4, 4,-3,1,2, 2, 6,1] >>> I = [0,1, 0, 2,4, 1, 2,3,4, 2, 1,4] >>> J = [0,0, 1, 1,1, 2, 2,2,2, 3, 4,4] >>> A = spmatrix(V,I,J) >>> B = matrix(1.0, (5,1)) >>> umfpack.linsolve(A,B) >>> print B 5.7895e-01 -5.2632e-02 1.0000e+00 1.9737e+00 -7.8947e-01
A) |
A, F) |
ArithmeticError
if the matrix is singular.
A, F, B[, trans='N']) |
As an example, suppose A is the matrix (7.1) and
>>> from cvxopt.base import spmatrix, matrix >>> from cvxopt import umfpack >>> VA = [2,3, 3,-1,4, 4,-3,1,2, 2, 6,1] >>> VB = [4,3, 3,-1,4, 4,-3,1,2, 2, 6,2] >>> I = [0,1, 0, 2,4, 1, 2,3,4, 2, 1,4] >>> J = [0,0, 1, 1,1, 2, 2,2,2, 3, 4,4] >>> A = spmatrix(VA, I, J) >>> B = spmatrix(VB, I, J) >>> x = matrix(1.0, (5,1)) >>> Fs = umfpack.symbolic(A) >>> FA = umfpack.numeric(A, Fs) >>> FB = umfpack.numeric(B, Fs) >>> umfpack.solve(A, FA, x) >>> umfpack.solve(B, FB, x) >>> umfpack.solve(A, FA, x, trans='T') >>> print x 5.8065e-01 -2.3660e-01 1.6280e+00 8.0656e+00 -1.3075e-01