compute_eigenvalues_and_eigenvectors Subroutine

public subroutine compute_eigenvalues_and_eigenvectors(n, a, w, z, ierr)

Uses

  • proc~~compute_eigenvalues_and_eigenvectors~~UsesGraph proc~compute_eigenvalues_and_eigenvectors eispack_module::compute_eigenvalues_and_eigenvectors module~numbers_module numbers_module proc~compute_eigenvalues_and_eigenvectors->module~numbers_module module~kind_module kind_module module~numbers_module->module~kind_module iso_fortran_env iso_fortran_env module~kind_module->iso_fortran_env

Compute the eigenvalues and, optionally, the eigenvectors of a real general matrix.

See also

  • See rg for more details. This routine is just a wrapper to that one.

Author

  • Jacob Williams, 3/25/2018

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: n

the order of the matrix a

real(kind=wp), intent(in), dimension(n,n) :: a

contains the real general matrix

real(kind=wp), intent(out), dimension(n,2) :: w

real and imaginary parts of the eigenvalues

real(kind=wp), intent(out), dimension(n,n) :: z

real and imaginary parts of the eigenvectors

integer, intent(out) :: ierr

output flag from rg


Calls

proc~~compute_eigenvalues_and_eigenvectors~~CallsGraph proc~compute_eigenvalues_and_eigenvectors eispack_module::compute_eigenvalues_and_eigenvectors proc~rg eispack_module::rg proc~compute_eigenvalues_and_eigenvectors->proc~rg proc~balanc eispack_module::balanc proc~rg->proc~balanc proc~balbak eispack_module::balbak proc~rg->proc~balbak proc~elmhes eispack_module::elmhes proc~rg->proc~elmhes proc~eltran eispack_module::eltran proc~rg->proc~eltran proc~hqr eispack_module::hqr proc~rg->proc~hqr proc~hqr2 eispack_module::hqr2 proc~rg->proc~hqr2 proc~cdiv eispack_module::cdiv proc~hqr2->proc~cdiv

Called by

proc~~compute_eigenvalues_and_eigenvectors~~CalledByGraph proc~compute_eigenvalues_and_eigenvectors eispack_module::compute_eigenvalues_and_eigenvectors proc~compute_real_eigenvalues_and_normalized_eigenvectors eispack_module::compute_real_eigenvalues_and_normalized_eigenvectors proc~compute_real_eigenvalues_and_normalized_eigenvectors->proc~compute_eigenvalues_and_eigenvectors proc~eispack_test eispack_module::eispack_test proc~eispack_test->proc~compute_eigenvalues_and_eigenvectors

Source Code

    subroutine compute_eigenvalues_and_eigenvectors(n, a, w, z, ierr)

    use numbers_module

    implicit none

    integer,intent(in)                  :: n    !! the order of the matrix `a`
    real(wp),dimension(n,n),intent(in)  :: a    !! contains the real general matrix
    real(wp),dimension(n,2),intent(out) :: w    !! real and imaginary parts of the eigenvalues
    real(wp),dimension(n,n),intent(out) :: z    !! real and imaginary parts of the eigenvectors
    integer,intent(out)                 :: ierr !! output flag from [[rg]]

    integer,parameter :: matz = 1 !! tells [[rg]] to compute eigenvalues and eigenvectors

    integer                 :: i     !! counter
    real(wp),dimension(n,n) :: a_tmp !! copy of [[a]] matrix
    real(wp),dimension(n)   :: fv1   !! work array for [[rg]]
    integer,dimension(n)    :: iv1   !! work array for [[rg]]
    real(wp),dimension(n)   :: wr    !! real part of the eigenvalues
    real(wp),dimension(n)   :: wi    !! imaginary part of the eigenvalues

    ! temp arrays:
    a_tmp = a
    wr = zero
    wi = zero

    ! call the general routine:
    call rg(n, n, a_tmp, wr, wi, matz, z, iv1, fv1, ierr)

    ! pack outputs:
    do i=1,n
        w(i,1) = wr(i)
        w(i,2) = wi(i)
    end do

    end subroutine compute_eigenvalues_and_eigenvectors