real_gen_matvec computes a matrix-vector or transposed matrix-vector product involving a real sparse nonsymmetric matrix stored in coordinate storage format.
2Specification
#include "f11/nagcpp_f11xa.hpp"
template <typename A, typename IROW, typename ICOL, typename X, typename Y>
void function real_gen_matvec(const string trans, const A &a, const IROW &irow, const ICOL &icol, const X &x, Y &&y, OptionalF11XAopt)
template <typename A, typename IROW, typename ICOL, typename X, typename Y>
void function real_gen_matvec(const string trans, const A &a, const IROW &irow, const ICOL &icol, const X &x, Y &&y)
3Description
real_gen_matvec computes either the matrix-vector product , or the transposed matrix-vector product , according to the value of the argument trans, where is an by sparse nonsymmetric matrix, of arbitrary sparsity pattern. The matrix is stored in coordinate storage (CS) format (see Section 2.1.1 in the F11 Chapter Introduction). The array a stores all nonzero elements of , while arrays irow and icol store the corresponding row and column indices respectively.
It is envisaged that a common use of real_gen_matvec will be to compute the matrix-vector product required in the application of f11bef (no CPP interface) to sparse linear systems. An illustration of this usage appears in Section 10 in real_gen_precon_ssor_solve (no CPP interface in the current release).
4References
None.
5Arguments
1: – stringInput
On entry: specifies whether or not the matrix is transposed.
is computed.
is computed.
Constraint:
or .
2: – double arrayInput
On entry: the nonzero elements in the matrix , ordered by increasing row index, and by increasing column index within each row. Multiple entries for the same row and column indices are not permitted. The function rtnrefs1 (no CPP interface) may be used to order the elements in this way.
All errors and warnings have an associated numeric error code field, errorid, stored either as a member of the thrown exception object (see errorid), or as a member of
opt.ifail, depending on how errors
and warnings are being handled (see Error Handling for more details).
It is expected that a common use of real_gen_matvec will be to compute the matrix-vector product required in the application of f11bef (no CPP interface) to sparse linear systems. In this situation real_gen_matvec 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.
10Example
Examples of the use of this method may be found in the examples for: real_nmf_rcomm.