Debian Codegraph @

Modules/ThirdParty/VNL/src/vxl/v3p/netlib/eispack/rs.f

raw
1 subroutine rs(nm,n,a,w,matz,z,fv1,fv2,ierr)
2 c
3 integer n,nm,ierr,matz
4 double precision a(nm,n),w(n),z(nm,n),fv1(n),fv2(n)
5 c
6 c this subroutine calls the recommended sequence of
7 c subroutines from the eigensystem subroutine package (eispack)
8 c to find the eigenvalues and eigenvectors (if desired)
9 c of a real symmetric matrix.
10 c
11 c on input
12 c
13 c nm must be set to the row dimension of the two-dimensional
14 c array parameters as declared in the calling program
15 c dimension statement.
16 c
17 c n is the order of the matrix a.
18 c
19 c a contains the real symmetric matrix.
20 c
21 c matz is an integer variable set equal to zero if
22 c only eigenvalues are desired. otherwise it is set to
23 c any non-zero integer for both eigenvalues and eigenvectors.
24 c
25 c on output
26 c
27 c w contains the eigenvalues in ascending order.
28 c
29 c z contains the eigenvectors if matz is not zero.
30 c
31 c ierr is an integer output variable set equal to an error
32 c completion code described in the documentation for tqlrat
33 c and tql2. the normal completion code is zero.
34 c
35 c fv1 and fv2 are temporary storage arrays.
36 c
37 c questions and comments should be directed to burton s. garbow,
38 c mathematics and computer science div, argonne national laboratory
39 c
40 c this version dated august 1983.
41 c
42 c ------------------------------------------------------------------
43 c
44 if (n .le. nm) go to 10
45 ierr = 10 * n
46 go to 50
47 c
48 10 if (matz .ne. 0) go to 20
49 c .......... find eigenvalues only ..........
50 call tred1(nm,n,a,w,fv1,fv2)
51 * tqlrat encounters catastrophic underflow on the Vax
52 * call tqlrat(n,w,fv2,ierr)
53 call tql1(n,w,fv1,ierr)
54 go to 50
55 c .......... find both eigenvalues and eigenvectors ..........
56 20 call tred2(nm,n,a,w,fv1,z)
57 call tql2(nm,n,w,fv1,z,ierr)
58 50 return
59 end