1%Example of
using MUMPS in matlab to compute diagonal of inverse of A
6% initialization of a matlab
MUMPS structure
21%
JOB = 4 means analysis+factorization
29% Set
the right hand side structure to requested entries of A-1
32%call
MUMPS solution phase to compute diagonal entries of A-1
33id.
ICNTL(30)=1; % Ask
for A-1 entries
43% diagonal values have been computed in
44%
the (sparse) matrix
id.SOL, which has
45%
the same structure as
id.RHS
47% Compare diagonal of inverse computed by Mumps and by matlab
49disp(
'Computing 2-norm of error on diagonal of inverse:');
52% destroy mumps instance
!This file is part of MUMPS
end diagonal values have been computed in the(sparse) matrix id.SOL
size(mat, 1), size(mat, 1) speye()
norm(diag(diag(diag(inv(mat))) -id.SOL), 2) % destroy mumps instance id.JOB
end[inform, rinform, sol, inst, schur, redrhs, pivnul_list, sym_perm, uns_perm, icntl, cntl, colsca_out, rowsca_out, keep_out, dkeep_out]
we set the rigth hand side id RHS
if(norm(mat *id.SOL - id.RHS, 'inf') > sqrt(eps)) disp('WARNING els disp)('SOLUTION OK')
****************************************This help menu gives details about the use of dmumps