S3L_matvec_sparse computes the product of a global general sparse matrix with a global dense vector. The sparse matrix is described by the S3L array handle A. The global dense vector is described by the S3L array handle x. The result is stored in the global dense vector described by the S3L array handle y.
The array handle A is produced by a prior call to one of the following routines:
S3L_declare_sparse
S3L_read_sparse
S3L_rand_sparse
The C and Fortran syntax for S3L_matvec_sparse are shown below.
#include <s3l/s3l-c.h> #include <s3l/s3l_errno-c.h> int S3L_matvec_sparse(y, A, x) S3L_array_t y S3L_array_t A S3L_array_t x |
include `s3l/s3l-f.h' include `s3l/s3l_errno-f.h' subroutine S3L_matvec_sparse(y, A, x, ier) integer*8 y integer*8 A integer*4 x integer*4 ier |
A - S3L array handle for the global general sparse matrix
x - Global array of rank 1, with the same data type and precision as A and y and with a length equal to the number of columns in the sparse matrix.
These functions use the following arguments for output:
y - Global array of rank 1, with the same data type and precision as A and x and with a length equal to the number of rows in the sparse matrix. Upon completion, y contains the product of the sparse matrix A and x.
ier (Fortran only) - When called from a Fortran program, this function returns error status in ier.
On success, S3L_matvec_sparse returns S3L_SUCCESS.
The S3L_matvec_sparse routines perform generic checking of the validity of the arrays they accept as arguments. If an array argument contains an invalid or corrupted value, the function terminates and an error code indicating which value of the array handle was invalid is returned. See Appendix A of this manual for a detailed list of these error codes.
In addition, the following conditions will cause this function to terminate and return the associated error code:
S3L_ERR_ARG_NULL - Invalid array x or y or sparse matrix A. x and y must be preallocated S3L arrays and A must be a preallocated sparse matrix.
S3L_ERR_ARG_RANK - Invalid rank for arrays x and y. They must be rank 1 arrays.
S3L_ERR_MATCH_RANK - The ranks of x and y do not match.
S3L_ERR_MATCH_DTYPE - Arrays x, y, and A do not have the same data type.
S3L_ERR_MATCH_EXTENTS - The lengths of x and y are mismatched with the size of sparse matrix A. The length of x must be equal to the number of columns in A and the length of y must be equal to the number of rows in A.
../examples/s3l/sparse/ex_sparse.c ../examples/s3l/sparse-f/ex_sparse.f ../examples/s3l/iter/ex_iter.c ../examples/s3l/iter-f/ex_iter.f
S3L_declare_sparse(3) S3L_read_sparse(3) S3L_rand_sparse(3)