1
subroutine wmsum(flag,ar,ai,na,m,n,vr,vi,nv)
3
c computes the sum of the entries of a complexmatrix according to flag
5
c subroutine wmsum(flag,ar,ai,na,m,n,vr,vi,nv)
6
c double precision ar(na,n),ai(na,n),vr(*),vi(*)
10
c flag : indicates operation to perform
11
c 0 : returns in v(1) the sum of all entries of a
12
c 1 : returns in v(j) the sum of jth column of a
13
c 2 : returns in v(i) the sum of ith row of a
14
c a : array containing the a matrix
15
c na : a matrix leading dimension
16
c m : a matrix row dimension
17
c n : a matrix column dimension
18
c v : array containing the result, may be confused with a row or
19
c a column of the a matrix
20
c if flag==0 size(v)>=1
21
c if flag==1 size(v)>=n*nv
22
c if flag==1 size(v)>=m*nv
23
c nv : increment between to consecutive entries ov v
26
double precision ar(na,n),ai(na,n),vr(*),vi(*)
30
double precision t,dsum
35
c sum of all the entries
39
tr=tr+dsum(m,ar(1,j),1)
40
ti=ti+dsum(m,ai(1,j),1)
44
elseif(flag.eq.1) then
52
elseif(flag.eq.2) then