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

  1.       subroutine rsgba(nm,n,a,b,w,matz,z,fv1,fv2,ierr)
  2. c
  3.       integer n,nm,ierr,matz
  4.       double precision a(nm,n),b(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     for the real symmetric generalized eigenproblem  bax = (lambda)x.
  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 matrices  a  and  b.
  18. c
  19. c        a  contains a real symmetric matrix.
  20. c
  21. c        b  contains a positive definite real symmetric matrix.
  22. c
  23. c        matz  is an integer variable set equal to zero if
  24. c        only eigenvalues are desired.  otherwise it is set to
  25. c        any non-zero integer for both eigenvalues and eigenvectors.
  26. c
  27. c     on output
  28. c
  29. c        w  contains the eigenvalues in ascending order.
  30. c
  31. c        z  contains the eigenvectors if matz is not zero.
  32. c
  33. c        ierr  is an integer output variable set equal to an error
  34. c           completion code described in the documentation for tqlrat
  35. c           and tql2.  the normal completion code is zero.
  36. c
  37. c        fv1  and  fv2  are temporary storage arrays.
  38. c
  39. c     questions and comments should be directed to burton s. garbow,
  40. c     mathematics and computer science div, argonne national laboratory
  41. c
  42. c     this version dated august 1983.
  43. c
  44. c     ------------------------------------------------------------------
  45. c
  46.       if (n .le. nm) go to 10
  47.       ierr = 10 * n
  48.       go to 50
  49. c
  50.    10 call  reduc2(nm,n,a,b,fv2,ierr)
  51.       if (ierr .ne. 0) go to 50
  52.       if (matz .ne. 0) go to 20
  53. c     .......... find eigenvalues only ..........
  54.       call  tred1(nm,n,a,w,fv1,fv2)
  55.       call  tqlrat(n,w,fv2,ierr)
  56.       go to 50
  57. c     .......... find both eigenvalues and eigenvectors ..........
  58.    20 call  tred2(nm,n,a,w,fv1,z)
  59.       call  tql2(nm,n,w,fv1,z,ierr)
  60.       if (ierr .ne. 0) go to 50
  61.       call  rebakb(nm,n,b,fv2,n,z)
  62.    50 return
  63.       end
  64.