1 c Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
4 c This file must be used under the terms of the CeCILL.
5 c This source file is licensed as described in the file COPYING, which
6 c you should have received as part of this distribution. The terms
7 c are also available at
8 c http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
9 subroutine dspdsp(ne,ind,x,m,n,maxc,mode,ll,lunit,cw)
11 c dspdsp visualise une matrice creuse
14 c subroutine dspdsp(ne,ind,x,m,n,maxc,mode,ll,lunit,cw)
16 c double precision x(*)
18 c integer nx,m,n,maxc,mode,ll,lunit
21 c c : nombre d'elements nons nuls de la matrice
22 c ind : indices specifiant la position des elements non nuls
23 c x : tableau contenant les elements non nuls
24 c m : nombre de ligne de la matrice
25 c n : nombre de colonnes de la matrice
26 c maxc : nombre de caracteres maximum autorise pour
27 c representer un nombre
28 c mode : si mode=1 representation variable
29 c si mode=0 representation d(maxc).(maxc-7)
30 c ll : longueur de ligne maximum admissible
31 c lunit : etiquette logique du support d'edition
32 c cw : chaine de caracteres de travail de longueur au moins ll
34 double precision x(*),a,a1,a2,fact,eps,dlamch
35 integer maxc,mode,fl,typ
37 character cw*(*),sgn*1,dl*1
41 write(cw,'(''('',i5,'','',i5,'') zero sparse matrix'')') m,n
42 call basout(io,lunit,cw(1:32))
43 call basout(io,lunit,' ')
46 write(cw,'(''('',i5,'','',i5,'') sparse matrix'')') m,n
47 call basout(io,lunit,cw(1:27))
48 call basout(io,lunit,' ')
56 write(form(1),130) maxc,maxc-7
69 if(a.eq.0.0d+0.or.a.gt.dlamch('o')) goto 05
75 if(a1.gt.0.0d+0) imax=int(log10(a1))
76 if(a2.gt.0.0d+0) imin=int(log10(a2))
77 if(imax*imin.le.0) goto 10
79 if(abs(imax).ge.maxc-2) fact=10.0d+0**(-imax)
83 if(fact.ne.1.0d+0) then
84 write(cw(1:12),'(1x,1pd9.1,'' *'')') 1.0d+0/fact
85 call basout(io,lunit,cw(1:12))
86 call basout(io,lunit,' ')
95 if(i0-i1.gt.ind(l)) then
102 write(cw,'(''('',i5,'','',i5,'')'')') i,j
105 c if(abs(a).lt.eps.and.mode.ne.0) a=0.0d+0
107 if(a.lt.0.0d+0) sgn='-'
110 c determination du format devant representer a
115 if(mode.eq.1) call fmt(a,maxc,typ,n1,n2)
116 if(typ.eq.2) typ=n2+32*n1
117 call formatnumber(a,typ,maxc,cw(l1:),fl)
119 call basout(io,lunit,cw(1:l1) )
120 if (io.eq.-1) goto 99
125 120 format('(f',i2,'.',i2,')')
126 130 format('(1pd',i2,'.',i2,')')