1
subroutine wspms(nra,nca,ncb,ar,ai,nela,inda,br,bi,mrb,cr,ci,
4
c**********************************************************
5
c multiply sparse matrix stored in a,inda on right by full
6
c matrix stored in b. put result in c.
8
c nra actual row dimension of a and c matrix
9
c nca actual column dimension of a and row dimension of b matrix
10
c ncb actual column dimension of a and c matrices
11
c ar,ai a one-dimensional array containing the non-zero elements
12
c of the first matrix,arranged row-wise, but not
13
c necessarily in order within rows.
14
c nela number of non-zero elements in a
15
c inda(i) 1<=i<=nra number of non-zero elements in row i of a.
16
c inda(nra+i) 1<=i<nela column index of i'th non-zero element of a.
17
c br,bi a two-dimensional array containing all the
18
c elements of the second matrix.
19
c mrb row-dimension of b in calling routine.
20
c mrc row-dimension of c in calling routine.
21
c ita real/complex a matrix type
22
c set ita=0 if a is real
23
c itb real/complex b matrix type
24
c set itb=0 if b is real
26
c cr,ci a two-dimensional array containing all the
27
c elements of the product matrix.
29
double precision ar(nela),ai(nela), br(mrb,ncb),bi(mrb,ncb)
30
double precision cr(mrc,ncb),ci(mrc,ncb)
32
double precision tr,ti
34
c nrc,ncc are number of rows,columns in c.
44
c n2 will be pointer to end of row i of a.
46
c i will be row-index for a.
48
c pick out number of non-zero elements in row i.
50
c if no non-zeroes skip processing of row i of a.
51
if (nir.eq.0) go to 60
52
c n1 points to start of row i in a,n2 to end.
55
c process row i of a, i.e. form all products of non-zero a(i,l) with
56
c b(l,j); put into c(i,j).
57
c k points to non-zero elements in row i of a.
68
cr(i,j) = cr(i,j) + tr*br(l,j)
69
ci(i,j) = ci(i,j) + ti*br(l,j)
73
cr(i,j) = cr(i,j) + tr*br(l,j)-ti*bi(l,j)
74
ci(i,j) = ci(i,j) + tr*bi(l,j)+ti*br(l,j)