nag_sparse_real_symm_matvec (f11xe) computes the matrix-vector product
where
is an
by
symmetric 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 nonzero elements in the lower triangular part of
, while arrays
irow and
icol store the corresponding row and column indices respectively.
It is envisaged that a common use of
nag_sparse_real_symm_matvec (f11xe) will be to compute the matrix-vector product required in the application of
nag_sparse_real_symm_basic_solver (f11ge) to sparse symmetric linear systems. An illustration of this usage appears in
nag_sparse_real_symm_precon_ssor_solve (f11jd).
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_real_symm_matvec (f11xe) is proportional to
nz.
It is expected that a common use of
nag_sparse_real_symm_matvec (f11xe) will be to compute the matrix-vector product required in the application of
nag_sparse_real_symm_basic_solver (f11ge) to sparse symmetric linear systems. In this situation
nag_sparse_real_symm_matvec (f11xe) is likely to be called many times with the same matrix
. In the interests of both reliability and efficiency you are recommended to set
for the first of such calls, and to set
for all subsequent calls.
function f11xe_example
fprintf('f11xe example results\n\n');
a = [ 4 -1 6 1 2 3 2 4 1 2 6 -4 1 -1 6 -1 -1 3 1 1 -1 1 4];
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 = [0.70 0.16 0.52 0.77 0.28 0.21 0.93 0.20 0.90];
check = 'C';
[y, ifail] = f11xe( ...
a, irow, icol, check, x);
disp('Matrix-vector product');
disp(y);