nag_sparse_complex_herm_matvec (f11xs) computes the matrix-vector product
where
is an
by
complex Hermitian sparse matrix, of arbitrary sparsity pattern, stored in symmetric coordinate storage (SCS) format (see
Symmetric coordinate storage (SCS) format in the F11 Chapter Introduction). The array
a stores all the nonzero elements in the lower triangular part of
, while arrays
irow and
icol store the corresponding row and column indices respectively.
None.
The computed vector
satisfies the error bound
where
is a modest linear function of
, and
is the
machine precision.
The time taken for a call to
nag_sparse_complex_herm_matvec (f11xs) is proportional to
nz.
function f11xs_example
fprintf('f11xs example results\n\n');
a = [6 ...
-1 + 1i 6 + 0i ...
0 + 1i 5 + 0i ...
5 + 0i ...
2 - 2i 4 + 0i ...
1 + 1i 2 + 0i 6 + 0i ...
-4 + 3i 0 + 1i -1 + 0i 6 + 0i ...
-1 - 1i 0 - 1i 9 + 0i ...
1 + 3i 1 + 2i -1 + 0i 1 + 4i 9 + 0i];
irow = [int64(1) 2 2 3 3 4 5 5 6 6 6 7 7 7 7 8 8 8 9 9 9 9 9];
icol = [int64(1) 1 2 2 3 4 1 5 3 4 6 2 5 6 7 4 6 8 1 5 6 8 9];
x = [ 1 + 9i; 2 - 8i; 3 + 7i;
4 - 6i; 5 + 5i; 6 - 4i;
7 + 3i; 8 - 2i; 9 + 1i];
check = 'C';
[y, ifail] = f11xs( ...
a, irow, icol, check, x);
disp('Matrix-vector product');
disp(y);