root / synthbench / euroben-dm / mod2as / spmxv.f @ 0:839f52ef7657
History | View | Annotate | Download (1.1 kB)
1 |
Subroutine spmxv( nrows, nelmts, indx, rowp, matvals, invec, |
---|---|
2 |
& outvec ) |
3 |
! ---------------------------------------------------------------------- |
4 |
! --- 'spmxv' does the actual matrix-vector multiply using the |
5 |
! matrix in CRS format (indx, rowp, matvals) and producing |
6 |
! vector 'outvec'. |
7 |
! ---------------------------------------------------------------------- |
8 |
Use numerics |
9 |
Use dist_module |
10 |
Implicit None |
11 |
|
12 |
Integer :: nrows, nelmts |
13 |
Integer :: rowp(nrows), indx(nelmts) |
14 |
Real(l_) :: matvals(nelmts), invec(*), outvec(nrows) |
15 |
|
16 |
Integer :: i, j |
17 |
! ---------------------------------------------------------------------- |
18 |
outvec = 0.0_l_ |
19 |
Do i = 1, nrows - 1 |
20 |
Do j = rowp(i), rowp(i+1) - 1 |
21 |
outvec(i) = outvec(i) + matvals(j)*invec(indx(j)) |
22 |
End Do |
23 |
End Do |
24 |
Do j = rowp(nrows), nelmts |
25 |
outvec(nrows) = outvec(nrows) + matvals(j)*invec(indx(j)) |
26 |
End Do |
27 |
! ---------------------------------------------------------------------- |
28 |
End Subroutine spmxv |