SPEED
MATMUL_SPARSE.f90 File Reference

Go to the source code of this file.

Functions/Subroutines

subroutine matmul_sparse (as, nnz, jsp, isp, vet_out, n, vet_in,
 Matrix-vector multiplication for sparse matrices (RCS format).
 

Function/Subroutine Documentation

◆ matmul_sparse()

subroutine matmul_sparse ( real*8, dimension(nnz)  as,
integer*4  nnz,
integer*4, dimension(nnz)  jsp,
integer*4, dimension(0:n)  isp,
real*8, dimension(n)  vet_out,
integer*4  n,
real*8, dimension(m)  vet_in 
)

Matrix-vector multiplication for sparse matrices (RCS format).

Author
Ilario Mazzieri
Date
September, 2013
Version
1.0
Parameters
[in]nnznumber of nonzero elements
[in]Assparse matrix
[in]Jsppointer for sparsity pattern
[in]Isppointer for sparsity pattern
[in]nrow of the matrix
[in]mcolumn of the matrix
[in]vet_ininput vector for the multiplication As*vet_in
[in]errorcontrol parameter (dummy)
[out]vet_outresult of the multiplication As*vet_in

Definition at line 33 of file MATMUL_SPARSE.f90.

34
35
36 implicit none
37
38 integer*4 :: nnz, i, j, n, m, error
39 integer*4 :: Jsp(nnz), Isp(0:n)
40
41 real*8 :: as(nnz), vet_in(m), vet_out(n)
42
43 vet_out = 0.d0
44
45
46 do i = 1, n
47 do j = isp(i-1) + 1, isp(i)
48 vet_out(i) = vet_out(i) + as(j)*vet_in(jsp(j))
49 enddo
50 enddo
51
52
53 return

Referenced by compute_energy_error().

Here is the caller graph for this function: