File: dspmat.f

package info (click to toggle)
scilab 2.2-4
  • links: PTS
  • area: non-free
  • in suites: hamm
  • size: 31,472 kB
  • ctags: 21,963
  • sloc: fortran: 110,983; ansic: 89,717; makefile: 3,016; sh: 1,892; csh: 150; cpp: 101
file content (25 lines) | stat: -rw-r--r-- 654 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
      subroutine dspmat(ma,na,a,nela,inda,mr,indr,iw)
c     dspmat reshape a sparse matrix
      integer inda(*),indr(*),iw(*)
      integer ma,na,nela
      double precision a(*)
c
      nr=(ma*na)/mr
      ja=0
      ki=1
      kj=nela+1
      do 20 i=1,ma
         nira=inda(i)
         if(nira.ne.0) then
            do 10 j=1,nira
               ija=i-1+(inda(ma+ja+j)-1)*ma
               iw(kj)=int(ija/mr)+1
               iw(ki)=ija-mr*(iw(kj)-1)+1
               ki=ki+1
               kj=kj+1
 10         continue
            ja=ja+nira
         endif
 20   continue
      call dij2sp(mr,nr,nela,iw,a,indr,mr+nela,iw(2*nela+1),ierr)
      end