Introduction
In this module, we implement some basic sparse matrix algebra. Now it supports both double precision real and complex numbers. The internal format of sparse matrix used in this module is CSR (compressed sparse row) format.
Type
module
Source
src/m_sparse.f90
Usage
(1) Import sparse module support.
use sparse
(2) Convert normal matrix to sparse matrix.
call sp_dns_to_csr(...)
(3) Convert sparse matrix to normal matrix.
call sp_csr_to_dns(...)
(4) Perform sparse matrix - vector multiplication.
call sp_csr_mv_vec(...)
(5) Perform sparse matrix - matrix multiplication.
call sp_csr_mm_csr(...)
Specifically, if one of the matrix is diagonal matrix, then you can use
call sp_dia_mm_csr(...)
or
call sp_csr_mm_dia(...)
to accelerate the execution.