--- 
:name: slaqr4
:md5sum: 9408e2dd3693791efc87fae05ebec6b6
:category: :subroutine
:arguments: 
- wantt: 
    :type: logical
    :intent: input
- wantz: 
    :type: logical
    :intent: input
- n: 
    :type: integer
    :intent: input
- ilo: 
    :type: integer
    :intent: input
- ihi: 
    :type: integer
    :intent: input
- h: 
    :type: real
    :intent: input/output
    :dims: 
    - ldh
    - n
- ldh: 
    :type: integer
    :intent: input
- wr: 
    :type: real
    :intent: output
    :dims: 
    - ihi
- wi: 
    :type: real
    :intent: output
    :dims: 
    - ihi
- iloz: 
    :type: integer
    :intent: input
- ihiz: 
    :type: integer
    :intent: input
- z: 
    :type: real
    :intent: input/output
    :dims: 
    - ldz
    - ihi
- ldz: 
    :type: integer
    :intent: input
- work: 
    :type: real
    :intent: output
    :dims: 
    - MAX(1,lwork)
- lwork: 
    :type: integer
    :intent: input
    :option: true
    :default: n
- info: 
    :type: integer
    :intent: output
:substitutions: {}

:fortran_help: "      SUBROUTINE SLAQR4( WANTT, WANTZ, N, ILO, IHI, H, LDH, WR, WI, ILOZ, IHIZ, Z, LDZ, WORK, LWORK, INFO )\n\n\
  *     Purpose\n\
  *     =======\n\
  *\n\
  *     SLAQR4 computes the eigenvalues of a Hessenberg matrix H\n\
  *     and, optionally, the matrices T and Z from the Schur decomposition\n\
  *     H = Z T Z**T, where T is an upper quasi-triangular matrix (the\n\
  *     Schur form), and Z is the orthogonal matrix of Schur vectors.\n\
  *\n\
  *     Optionally Z may be postmultiplied into an input orthogonal\n\
  *     matrix Q so that this routine can give the Schur factorization\n\
  *     of a matrix A which has been reduced to the Hessenberg form H\n\
  *     by the orthogonal matrix Q:  A = Q*H*Q**T = (QZ)*T*(QZ)**T.\n\
  *\n\n\
  *     Arguments\n\
  *     =========\n\
  *\n\
  *     WANTT   (input) LOGICAL\n\
  *          = .TRUE. : the full Schur form T is required;\n\
  *          = .FALSE.: only eigenvalues are required.\n\
  *\n\
  *     WANTZ   (input) LOGICAL\n\
  *          = .TRUE. : the matrix of Schur vectors Z is required;\n\
  *          = .FALSE.: Schur vectors are not required.\n\
  *\n\
  *     N     (input) INTEGER\n\
  *           The order of the matrix H.  N .GE. 0.\n\
  *\n\
  *     ILO   (input) INTEGER\n\
  *     IHI   (input) INTEGER\n\
  *           It is assumed that H is already upper triangular in rows\n\
  *           and columns 1:ILO-1 and IHI+1:N and, if ILO.GT.1,\n\
  *           H(ILO,ILO-1) is zero. ILO and IHI are normally set by a\n\
  *           previous call to SGEBAL, and then passed to SGEHRD when the\n\
  *           matrix output by SGEBAL is reduced to Hessenberg form.\n\
  *           Otherwise, ILO and IHI should be set to 1 and N,\n\
  *           respectively.  If N.GT.0, then 1.LE.ILO.LE.IHI.LE.N.\n\
  *           If N = 0, then ILO = 1 and IHI = 0.\n\
  *\n\
  *     H     (input/output) REAL array, dimension (LDH,N)\n\
  *           On entry, the upper Hessenberg matrix H.\n\
  *           On exit, if INFO = 0 and WANTT is .TRUE., then H contains\n\
  *           the upper quasi-triangular matrix T from the Schur\n\
  *           decomposition (the Schur form); 2-by-2 diagonal blocks\n\
  *           (corresponding to complex conjugate pairs of eigenvalues)\n\
  *           are returned in standard form, with H(i,i) = H(i+1,i+1)\n\
  *           and H(i+1,i)*H(i,i+1).LT.0. If INFO = 0 and WANTT is\n\
  *           .FALSE., then the contents of H are unspecified on exit.\n\
  *           (The output value of H when INFO.GT.0 is given under the\n\
  *           description of INFO below.)\n\
  *\n\
  *           This subroutine may explicitly set H(i,j) = 0 for i.GT.j and\n\
  *           j = 1, 2, ... ILO-1 or j = IHI+1, IHI+2, ... N.\n\
  *\n\
  *     LDH   (input) INTEGER\n\
  *           The leading dimension of the array H. LDH .GE. max(1,N).\n\
  *\n\
  *     WR    (output) REAL array, dimension (IHI)\n\
  *     WI    (output) REAL array, dimension (IHI)\n\
  *           The real and imaginary parts, respectively, of the computed\n\
  *           eigenvalues of H(ILO:IHI,ILO:IHI) are stored in WR(ILO:IHI)\n\
  *           and WI(ILO:IHI). If two eigenvalues are computed as a\n\
  *           complex conjugate pair, they are stored in consecutive\n\
  *           elements of WR and WI, say the i-th and (i+1)th, with\n\
  *           WI(i) .GT. 0 and WI(i+1) .LT. 0. If WANTT is .TRUE., then\n\
  *           the eigenvalues are stored in the same order as on the\n\
  *           diagonal of the Schur form returned in H, with\n\
  *           WR(i) = H(i,i) and, if H(i:i+1,i:i+1) is a 2-by-2 diagonal\n\
  *           block, WI(i) = sqrt(-H(i+1,i)*H(i,i+1)) and\n\
  *           WI(i+1) = -WI(i).\n\
  *\n\
  *     ILOZ     (input) INTEGER\n\
  *     IHIZ     (input) INTEGER\n\
  *           Specify the rows of Z to which transformations must be\n\
  *           applied if WANTZ is .TRUE..\n\
  *           1 .LE. ILOZ .LE. ILO; IHI .LE. IHIZ .LE. N.\n\
  *\n\
  *     Z     (input/output) REAL array, dimension (LDZ,IHI)\n\
  *           If WANTZ is .FALSE., then Z is not referenced.\n\
  *           If WANTZ is .TRUE., then Z(ILO:IHI,ILOZ:IHIZ) is\n\
  *           replaced by Z(ILO:IHI,ILOZ:IHIZ)*U where U is the\n\
  *           orthogonal Schur factor of H(ILO:IHI,ILO:IHI).\n\
  *           (The output value of Z when INFO.GT.0 is given under\n\
  *           the description of INFO below.)\n\
  *\n\
  *     LDZ   (input) INTEGER\n\
  *           The leading dimension of the array Z.  if WANTZ is .TRUE.\n\
  *           then LDZ.GE.MAX(1,IHIZ).  Otherwize, LDZ.GE.1.\n\
  *\n\
  *     WORK  (workspace/output) REAL array, dimension LWORK\n\
  *           On exit, if LWORK = -1, WORK(1) returns an estimate of\n\
  *           the optimal value for LWORK.\n\
  *\n\
  *     LWORK (input) INTEGER\n\
  *           The dimension of the array WORK.  LWORK .GE. max(1,N)\n\
  *           is sufficient, but LWORK typically as large as 6*N may\n\
  *           be required for optimal performance.  A workspace query\n\
  *           to determine the optimal workspace size is recommended.\n\
  *\n\
  *           If LWORK = -1, then SLAQR4 does a workspace query.\n\
  *           In this case, SLAQR4 checks the input parameters and\n\
  *           estimates the optimal workspace size for the given\n\
  *           values of N, ILO and IHI.  The estimate is returned\n\
  *           in WORK(1).  No error message related to LWORK is\n\
  *           issued by XERBLA.  Neither H nor Z are accessed.\n\
  *\n\
  *\n\
  *     INFO  (output) INTEGER\n\
  *             =  0:  successful exit\n\
  *           .GT. 0:  if INFO = i, SLAQR4 failed to compute all of\n\
  *                the eigenvalues.  Elements 1:ilo-1 and i+1:n of WR\n\
  *                and WI contain those eigenvalues which have been\n\
  *                successfully computed.  (Failures are rare.)\n\
  *\n\
  *                If INFO .GT. 0 and WANT is .FALSE., then on exit,\n\
  *                the remaining unconverged eigenvalues are the eigen-\n\
  *                values of the upper Hessenberg matrix rows and\n\
  *                columns ILO through INFO of the final, output\n\
  *                value of H.\n\
  *\n\
  *                If INFO .GT. 0 and WANTT is .TRUE., then on exit\n\
  *\n\
  *           (*)  (initial value of H)*U  = U*(final value of H)\n\
  *\n\
  *                where U is an orthogonal matrix.  The final\n\
  *                value of H is upper Hessenberg and quasi-triangular\n\
  *                in rows and columns INFO+1 through IHI.\n\
  *\n\
  *                If INFO .GT. 0 and WANTZ is .TRUE., then on exit\n\
  *\n\
  *                  (final value of Z(ILO:IHI,ILOZ:IHIZ)\n\
  *                   =  (initial value of Z(ILO:IHI,ILOZ:IHIZ)*U\n\
  *\n\
  *                where U is the orthogonal matrix in (*) (regard-\n\
  *                less of the value of WANTT.)\n\
  *\n\
  *                If INFO .GT. 0 and WANTZ is .FALSE., then Z is not\n\
  *                accessed.\n\
  *\n\n\
  *     ================================================================\n\
  *     Based on contributions by\n\
  *        Karen Braman and Ralph Byers, Department of Mathematics,\n\
  *        University of Kansas, USA\n\
  *\n\
  *     ================================================================\n\
  *     References:\n\
  *       K. Braman, R. Byers and R. Mathias, The Multi-Shift QR\n\
  *       Algorithm Part I: Maintaining Well Focused Shifts, and Level 3\n\
  *       Performance, SIAM Journal of Matrix Analysis, volume 23, pages\n\
  *       929--947, 2002.\n\
  *\n\
  *       K. Braman, R. Byers and R. Mathias, The Multi-Shift QR\n\
  *       Algorithm Part II: Aggressive Early Deflation, SIAM Journal\n\
  *       of Matrix Analysis, volume 23, pages 948--973, 2002.\n\
  *\n\
  *     ================================================================\n"
