home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Geek Gadgets 1
/
ADE-1.bin
/
ade-dist
/
eispack-1.0-src.tgz
/
tar.out
/
contrib
/
eispack
/
tests
/
rsg.bak1
< prev
next >
Wrap
Text File
|
1996-09-28
|
2KB
|
71 lines
C
C THIS INPUT SUBROUTINE READS A REAL MATRIX FROM SYSIN OF
C ORDER N.
C TO GENERATE THE MATRIX A INITIALLY, INITIL IS TO BE 0.
C TO REGENERATE THE MATRIX A FOR THE PURPOSE OF THE RESIDUAL
C CALCULATION, INITIL IS TO BE 1.
C
C THIS ROUTINE IS CATALOGUED AS EISPDRV4(RGREADI).
C
DOUBLE PRECISION A(20,20),b(20,20)
INTEGER IA( 20),ib(20)
DATA ireadb/2/,IREADA/1/,IWRITE/6/
C
open(unit=ireadb,file='FILE47')
open(unit=ireada,file='FILE35')
rewind ireada
rewind ireadb
write(6,*)' what matrix do you want?'
read(5,*)nn
1 continue
READ(IREADA,5,end=99)N, M
5 FORMAT(I6,6X,I6)
IF( N .EQ. 0 ) GO TO 99
IF (M .NE. 1) GO TO 16
DO 10 I = 1,N
READ(IREADA,17) (IA(J), J=I,N)
DO 9 J = I,N
A(I,J) = DFLOAT(IA(J))
9 A(J,I) = A(I,J)
10 CONTINUE
11 CONTINUE
READ(IREADB,5) N,M
IF( M .NE. 1 ) GO TO 28
DO 15 I = 1,N
READ(IREADB,17) (IB(J), J=I,N)
DO 14 J = I,N
B(I,J)=DFLOAT(IB(J))
14 B(J,I)=B(I,J)
15 CONTINUE
GO TO 22
16 CONTINUE
DO 18 I = 1,N
READ(IREADA,17) (IA(J), J=1,N)
17 FORMAT(6I12)
DO 18 J = 1,N
18 A(I,J) = DFLOAT(IA(J))
GO TO 11
28 CONTINUE
DO 25 I = 1,N
READ(IREADB,17) (IB(J),J=1,N)
DO 25 J = 1,N
25 B(I,J) = DFLOAT(IB(J))
22 CONTINUE
19 continue
if( nn .ne. n ) go to 1
write(6,*)'a=<'
do 20 i = 1,n
write(6,29)(a(i,j),j=1,n)
29 format(10f8.0)
20 continue
write(6,*)'>'
write(6,*)'b=<'
do 200 i = 1,n
write(6,29)(b(i,j),j=1,n)
200 continue
write(6,*)'>'
go to 1
99 continue
STOP
END