1
subroutine dspt(r,s,a,nela,inda,ia, at,iat,indat)
2
c transpose a sparse matrix using a distribution count sort.
4
c r,s number of rows,columns in a.
5
c a a one-dimensional array containing the non-zero
6
c elements of matrix a,arranged row-wise,but in
7
c general not ordered within rows.
9
c ia ia(i) is address in a of first element of row i of a.
10
c ia(number of rows + 1) is number of elements in a,+1.
12
c at a one-dimensional array containing non-zero elements
13
c of matrix a transposed,arranged row-wise,and in
15
c mat contains control information and column indices for at,
16
c in same format as ma...see msmgus.
18
c iat iat(i) is address in at of first element in row i of at.
19
c iat(s+1) contains number of elements in at,plus 1.
21
double precision a(*), at(nela)
22
integer inda(*), ia(*), indat(*), iat(*)
25
c determine column counts of matrix a(i.e row counts of at)
32
c computes number of elements for each column
38
c calculate row pointers of at from column counts obtained above.
39
c pointer for row i stored in location i+1.
47
iat(i+1) = iat(i) + itemp1
52
c calculate column indices(in array indat) and numerical values (in array
53
c at) of matrix a-transposed using the list pointers iat(i+1) which
54
c always point to the next element to be entered in row i of at.
58
if (j1.gt.j2) go to 60
68
c now all row pointers iat for at have correct values except position 1.
71
c extract needed control information in indat.
73
indat(i) = iat(i+1) - iat(i)