Advertisement
Guest User

Untitled

a guest
Jan 16th, 2019
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.       subroutine cg(nm,n,ar,ai,wr,wi,matz,zr,zi,fv1,fv2,fv3,ierr)
  2. c
  3.       integer n,nm,is1,is2,ierr,matz
  4.       double precision ar(nm,n),ai(nm,n),wr(n),wi(n),zr(nm,n),zi(nm,n),
  5.      x       fv1(n),fv2(n),fv3(n)
  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 complex general 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=(ar,ai).
  19. c
  20. c        ar  and  ai  contain the real and imaginary parts,
  21. c        respectively, of the complex general 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        wr  and  wi  contain the real and imaginary parts,
  30. c        respectively, of the eigenvalues.
  31. c
  32. c        zr  and  zi  contain the real and imaginary parts,
  33. c        respectively, of the eigenvectors if matz is not zero.
  34. c
  35. c        ierr  is an integer output variable set equal to an error
  36. c           completion code described in the documentation for comqr
  37. c           and comqr2.  the normal completion code is zero.
  38. c
  39. c        fv1, fv2, and  fv3  are temporary storage arrays.
  40. c
  41. c     questions and comments should be directed to burton s. garbow,
  42. c     mathematics and computer science div, argonne national laboratory
  43. c
  44. c     this version dated august 1983.
  45. c
  46. c     ------------------------------------------------------------------
  47. c
  48.       if (n .le. nm) go to 10
  49.       ierr = 10 * n
  50.       go to 50
  51. c
  52.    10 call  cbal(nm,n,ar,ai,is1,is2,fv1)
  53.       call  corth(nm,n,is1,is2,ar,ai,fv2,fv3)
  54.       if (matz .ne. 0) go to 20
  55. c     .......... find eigenvalues only ..........
  56.       call  comqr(nm,n,is1,is2,ar,ai,wr,wi,ierr)
  57.       go to 50
  58. c     .......... find both eigenvalues and eigenvectors ..........
  59.    20 call  comqr2(nm,n,is1,is2,fv2,fv3,ar,ai,wr,wi,zr,zi,ierr)
  60.       if (ierr .ne. 0) go to 50
  61.       call  cbabk2(nm,n,is1,is2,fv1,n,zr,zi)
  62.    50 return
  63.       end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement