home *** CD-ROM | disk | FTP | other *** search
/ Geek Gadgets 1 / ADE-1.bin / ade-dist / eispack-1.0-src.tgz / tar.out / contrib / eispack / rsb.f < prev    next >
Text File  |  1996-09-28  |  3KB  |  79 lines

  1.       subroutine rsb(nm,n,mb,a,w,matz,z,fv1,fv2,ierr)
  2. c
  3.       integer n,mb,nm,ierr,matz
  4.       double precision a(nm,mb),w(n),z(nm,n),fv1(n),fv2(n)
  5.       logical tf
  6. c
  7. c     this subroutine calls the recommended sequence of
  8. c     subroutines from the eigensystem subroutine package (eispack)
  9. c     to find the eigenvalues and eigenvectors (if desired)
  10. c     of a real symmetric band matrix.
  11. c
  12. c     on input
  13. c
  14. c        nm  must be set to the row dimension of the two-dimensional
  15. c        array parameters as declared in the calling program
  16. c        dimension statement.
  17. c
  18. c        n  is the order of the matrix  a.
  19. c
  20. c        mb  is the half band width of the matrix, defined as the
  21. c        number of adjacent diagonals, including the principal
  22. c        diagonal, required to specify the non-zero portion of the
  23. c        lower triangle of the matrix.
  24. c
  25. c        a  contains the lower triangle of the real symmetric
  26. c        band matrix.  its lowest subdiagonal is stored in the
  27. c        last  n+1-mb  positions of the first column, its next
  28. c        subdiagonal in the last  n+2-mb  positions of the
  29. c        second column, further subdiagonals similarly, and
  30. c        finally its principal diagonal in the  n  positions
  31. c        of the last column.  contents of storages not part
  32. c        of the matrix are arbitrary.
  33. c
  34. c        matz  is an integer variable set equal to zero if
  35. c        only eigenvalues are desired.  otherwise it is set to
  36. c        any non-zero integer for both eigenvalues and eigenvectors.
  37. c
  38. c     on output
  39. c
  40. c        w  contains the eigenvalues in ascending order.
  41. c
  42. c        z  contains the eigenvectors if matz is not zero.
  43. c
  44. c        ierr  is an integer output variable set equal to an error
  45. c           completion code described in the documentation for tqlrat
  46. c           and tql2.  the normal completion code is zero.
  47. c
  48. c        fv1  and  fv2  are temporary storage arrays.
  49. c
  50. c     questions and comments should be directed to burton s. garbow,
  51. c     mathematics and computer science div, argonne national laboratory
  52. c
  53. c     this version dated august 1983.
  54. c
  55. c     ------------------------------------------------------------------
  56. c
  57.       if (n .le. nm) go to 5
  58.       ierr = 10 * n
  59.       go to 50
  60.     5 if (mb .gt. 0) go to 10
  61.       ierr = 12 * n
  62.       go to 50
  63.    10 if (mb .le. n) go to 15
  64.       ierr = 12 * n
  65.       go to 50
  66. c
  67.    15 if (matz .ne. 0) go to 20
  68. c     .......... find eigenvalues only ..........
  69.       tf = .false.
  70.       call  bandr(nm,n,mb,a,w,fv1,fv2,tf,z)
  71.       call  tqlrat(n,w,fv2,ierr)
  72.       go to 50
  73. c     .......... find both eigenvalues and eigenvectors ..........
  74.    20 tf = .true.
  75.       call  bandr(nm,n,mb,a,w,fv1,fv1,tf,z)
  76.       call  tql2(nm,n,w,fv1,z,ierr)
  77.    50 return
  78.       end
  79.