1
subroutine dspos(op,ma,na,a,nela,inda,mb,nb,b,
5
c compare the elements of a sparse matrix A and a full matrix B.
8
c Contain non zero elements of the A matrix
9
c ma,na: row and column dimension of the a matrix
10
c mb,nb: row and column dimension of the b matrix
11
c nela :integer: number of non zero elements of a
13
c on entry maximum number of non zero elements of c
14
c on return number of non zero elements of c
15
c inda : a matrix control data:
16
c inda(i) 1<=i<=ma contains the number of ith row non zero elements
18
c inda(ma+i) 1<=i<=nela column index of each non zero element
19
c indc : on return contains c matrix control data:
20
c indc(i) 1<=i<=mr contains the number of ith row non zero elements
22
c indc(mr+i) 1<=i<=nelb column index of each non zero element
24
c ierr : if non zero initial value of nelc is to small
26
double precision a(*),b(mb,nb)
27
integer op,nr,nc,nela,inda(*),nelc,indc(*),ierr
29
integer jc,ka,kb,jb,i,ja,j1
40
c jc counts elements of c.
42
c ka,kb are numbers in first i rows of a,b.
46
c jb counts elements of b.
48
c i counts rows of a,b,c.
49
if(ma*na.eq.1.and.mb*nb.gt.1) then
50
c compare all element of b with scalar a
52
if(inda(1).eq.1) t=a(1)
58
if (dcompa(t,b(i,j),op)) then
59
if(jc+1.gt.nelmx) goto 99
68
elseif(ma*na.gt.1.and.mb*nb.eq.1) then
69
c compare all elements of a with scalar b
79
if(kc+nc.gt.nelmx) goto 99
90
if (dcompa(a(ja),t,op)) then
91
if(jc+1.gt.nelmx) goto 99
95
if(ja-ka+1.lt.nira) ja=ja+1
98
if(jc+1.gt.nelmx) goto 99
109
z=dcompa(0.0d0,0.0d0,op)
117
if (dcompa(0.0d0,b(i,j),op)) then
118
if(jc+1.gt.nelmx) goto 99
127
if (dcompa(a(ja),b(i,j),op)) then
128
if(jc+1.gt.nelmx) goto 99
132
if(ja-ka+1.lt.nira) ja=ja+1
135
if (dcompa(0.0d0,b(i,j),op)) then
136
if(jc+1.gt.nelmx) goto 99
152
c no more place for c