1
subroutine dsposp(op,ma,na,a,nela,inda,mb,nb,b,nelb,indb,
5
c compare the elements of two sparse matrices.
7
c op : integer flag which specifies the comparison to perform
8
c see routine dcompa for more precision
9
c ma,na: row and column dimension of the a matrix
10
c mb,nb: row and column dimension of the b matrix
12
c Contain non zero elements of first,second sparse matrices.
13
c nela :integer: number of non zero elements of a
14
c nelb :integer: number of non zero elements of b
16
c on entry maximum number of non zero elements of c
17
c on return number of non zero elements of c
18
c inda : a matrix control data:
19
c inda(i) 1<=i<=nr contains the number of ith row non zero elements
21
c inda(m+i) 1<=i<=nela column index of each non zero element
22
c indb : b matrix control data:
23
c indb(i) 1<=i<=nr contains the number of ith row non zero elements
25
c indb(m+i) 1<=i<=nelb column index of each non zero element
27
c indc : on return contains c matrix control data:
28
c indc(i) 1<=i<=nr contains the number of ith row non zero elements
30
c indc(m+i) 1<=i<=nelb column index of each non zero element
31
c ierr : if non zero initial value of nelc is to small
33
double precision a(*),b(*),t
34
integer op,nela,inda(*),nelb,indb(*),nelc,indc(*),ierr
36
integer jc,ka,kb,jb,i,ja,j1,j2
46
c jc counts elements of c.
48
c ka,kb are numbers in first i rows of a,b.
52
c jb counts elements of b.
54
c i counts rows of a,b,c.
55
if(ma*na.eq.1.and.mb*nb.gt.1) then
56
c compare all element of b with scalar a
58
if(inda(1).eq.1) t=a(1)
68
if(jc+1.gt.nelmx) goto 99
77
if (dcompa(t,b(jb),op)) then
78
if(jc+1.gt.nelmx) goto 99
82
if(jb-kb+1.lt.nirb) jb=jb+1
86
if(jc+1.gt.nelmx) goto 99
98
elseif(ma*na.gt.1.and.mb*nb.eq.1) then
99
c compare all elements of a with scalar b
101
if(indb(1).eq.1) t=b(1)
110
if(kc+nc.gt.nelmx) goto 99
121
if (dcompa(a(ja),t,op)) then
122
if(jc+1.gt.nelmx) goto 99
126
if(ja-ka+1.lt.nira) ja=ja+1
129
if(jc+1.gt.nelmx) goto 99
140
z=dcompa(0.0d0,0.0d0,op)
151
if(kc+nc.gt.nelmx) goto 99
162
if (dcompa(0.0d0,b(jb),op)) then
163
if(jc+1.gt.nelmx) goto 99
167
if(jb-kb+1.lt.nirb) jb=jb+1
170
if(jc+1.gt.nelmx) goto 99
181
if (dcompa(a(ja),0.0d0,op)) then
182
if(jc+1.gt.nelmx) goto 99
186
if(ja-ka+1.lt.nira) ja=ja+1
189
if(jc+1.gt.nelmx) goto 99
200
if (dcompa(a(ja),b(jb),op)) then
201
if(jc+1.gt.nelmx) goto 99
205
if(ja-ka+1.lt.nira) ja=ja+1
206
if(jb-kb+1.lt.nirb) jb=jb+1
210
if (dcompa(a(ja),0.0d0,op)) then
211
if(jc+1.gt.nelmx) goto 99
215
if(ja-ka+1.lt.nira) ja=ja+1
220
if (dcompa(0.0d0,b(jb),op)) then
221
if(jc+1.gt.nelmx) goto 99
225
if(jb-kb+1.lt.nirb) jb=jb+1
228
if(jc+1.gt.nelmx) goto 99
246
c no more place for c