--- 
:name: slaqr5
:md5sum: 57ca99e1b1f617787f2fa2e386337500
:category: :subroutine
:arguments: 
- wantt: 
    :type: logical
    :intent: input
- wantz: 
    :type: logical
    :intent: input
- kacc22: 
    :type: integer
    :intent: input
- n: 
    :type: integer
    :intent: input
- ktop: 
    :type: integer
    :intent: input
- kbot: 
    :type: integer
    :intent: input
- nshfts: 
    :type: integer
    :intent: input
- sr: 
    :type: real
    :intent: input/output
    :dims: 
    - nshfts
- si: 
    :type: real
    :intent: input/output
    :dims: 
    - nshfts
- h: 
    :type: real
    :intent: input/output
    :dims: 
    - ldh
    - n
- ldh: 
    :type: integer
    :intent: input
- iloz: 
    :type: integer
    :intent: input
- ihiz: 
    :type: integer
    :intent: input
- z: 
    :type: real
    :intent: input/output
    :dims: 
    - "wantz ? ldz : 0"
    - "wantz ? ihiz : 0"
- ldz: 
    :type: integer
    :intent: input
- v: 
    :type: real
    :intent: workspace
    :dims: 
    - ldv
    - nshfts/2
- ldv: 
    :type: integer
    :intent: input
- u: 
    :type: real
    :intent: workspace
    :dims: 
    - ldu
    - 3*nshfts-3
- ldu: 
    :type: integer
    :intent: input
- nv: 
    :type: integer
    :intent: input
- wv: 
    :type: real
    :intent: workspace
    :dims: 
    - ldwv
    - 3*nshfts-3
- ldwv: 
    :type: integer
    :intent: input
- nh: 
    :type: integer
    :intent: input
- wh: 
    :type: real
    :intent: workspace
    :dims: 
    - ldwh
    - MAX(1,nh)
- ldwh: 
    :type: integer
    :intent: input
:substitutions: 
  ldwh: 3*nshfts-3
  ldz: n
  ldwv: nv
  ldu: 3*nshfts-3
  ldv: "3"
:fortran_help: "      SUBROUTINE SLAQR5( WANTT, WANTZ, KACC22, N, KTOP, KBOT, NSHFTS, SR, SI, H, LDH, ILOZ, IHIZ, Z, LDZ, V, LDV, U, LDU, NV, WV, LDWV, NH, WH, LDWH )\n\n\
  *     This auxiliary subroutine called by SLAQR0 performs a\n\
  *     single small-bulge multi-shift QR sweep.\n\
  *\n\n\
  *      WANTT  (input) logical scalar\n\
  *             WANTT = .true. if the quasi-triangular Schur factor\n\
  *             is being computed.  WANTT is set to .false. otherwise.\n\
  *\n\
  *      WANTZ  (input) logical scalar\n\
  *             WANTZ = .true. if the orthogonal Schur factor is being\n\
  *             computed.  WANTZ is set to .false. otherwise.\n\
  *\n\
  *      KACC22 (input) integer with value 0, 1, or 2.\n\
  *             Specifies the computation mode of far-from-diagonal\n\
  *             orthogonal updates.\n\
  *        = 0: SLAQR5 does not accumulate reflections and does not\n\
  *             use matrix-matrix multiply to update far-from-diagonal\n\
  *             matrix entries.\n\
  *        = 1: SLAQR5 accumulates reflections and uses matrix-matrix\n\
  *             multiply to update the far-from-diagonal matrix entries.\n\
  *        = 2: SLAQR5 accumulates reflections, uses matrix-matrix\n\
  *             multiply to update the far-from-diagonal matrix entries,\n\
  *             and takes advantage of 2-by-2 block structure during\n\
  *             matrix multiplies.\n\
  *\n\
  *      N      (input) integer scalar\n\
  *             N is the order of the Hessenberg matrix H upon which this\n\
  *             subroutine operates.\n\
  *\n\
  *      KTOP   (input) integer scalar\n\
  *      KBOT   (input) integer scalar\n\
  *             These are the first and last rows and columns of an\n\
  *             isolated diagonal block upon which the QR sweep is to be\n\
  *             applied. It is assumed without a check that\n\
  *                       either KTOP = 1  or   H(KTOP,KTOP-1) = 0\n\
  *             and\n\
  *                       either KBOT = N  or   H(KBOT+1,KBOT) = 0.\n\
  *\n\
  *      NSHFTS (input) integer scalar\n\
  *             NSHFTS gives the number of simultaneous shifts.  NSHFTS\n\
  *             must be positive and even.\n\
  *\n\
  *      SR     (input/output) REAL array of size (NSHFTS)\n\
  *      SI     (input/output) REAL array of size (NSHFTS)\n\
  *             SR contains the real parts and SI contains the imaginary\n\
  *             parts of the NSHFTS shifts of origin that define the\n\
  *             multi-shift QR sweep.  On output SR and SI may be\n\
  *             reordered.\n\
  *\n\
  *      H      (input/output) REAL array of size (LDH,N)\n\
  *             On input H contains a Hessenberg matrix.  On output a\n\
  *             multi-shift QR sweep with shifts SR(J)+i*SI(J) is applied\n\
  *             to the isolated diagonal block in rows and columns KTOP\n\
  *             through KBOT.\n\
  *\n\
  *      LDH    (input) integer scalar\n\
  *             LDH is the leading dimension of H just as declared in the\n\
  *             calling procedure.  LDH.GE.MAX(1,N).\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.. 1 .LE. ILOZ .LE. IHIZ .LE. N\n\
  *\n\
  *      Z      (input/output) REAL array of size (LDZ,IHI)\n\
  *             If WANTZ = .TRUE., then the QR Sweep orthogonal\n\
  *             similarity transformation is accumulated into\n\
  *             Z(ILOZ:IHIZ,ILO:IHI) from the right.\n\
  *             If WANTZ = .FALSE., then Z is unreferenced.\n\
  *\n\
  *      LDZ    (input) integer scalar\n\
  *             LDA is the leading dimension of Z just as declared in\n\
  *             the calling procedure. LDZ.GE.N.\n\
  *\n\
  *      V      (workspace) REAL array of size (LDV,NSHFTS/2)\n\
  *\n\
  *      LDV    (input) integer scalar\n\
  *             LDV is the leading dimension of V as declared in the\n\
  *             calling procedure.  LDV.GE.3.\n\
  *\n\
  *      U      (workspace) REAL array of size\n\
  *             (LDU,3*NSHFTS-3)\n\
  *\n\
  *      LDU    (input) integer scalar\n\
  *             LDU is the leading dimension of U just as declared in the\n\
  *             in the calling subroutine.  LDU.GE.3*NSHFTS-3.\n\
  *\n\
  *      NH     (input) integer scalar\n\
  *             NH is the number of columns in array WH available for\n\
  *             workspace. NH.GE.1.\n\
  *\n\
  *      WH     (workspace) REAL array of size (LDWH,NH)\n\
  *\n\
  *      LDWH   (input) integer scalar\n\
  *             Leading dimension of WH just as declared in the\n\
  *             calling procedure.  LDWH.GE.3*NSHFTS-3.\n\
  *\n\
  *      NV     (input) integer scalar\n\
  *             NV is the number of rows in WV agailable for workspace.\n\
  *             NV.GE.1.\n\
  *\n\
  *      WV     (workspace) REAL array of size\n\
  *             (LDWV,3*NSHFTS-3)\n\
  *\n\
  *      LDWV   (input) integer scalar\n\
  *             LDWV is the leading dimension of WV as declared in the\n\
  *             in the calling subroutine.  LDWV.GE.NV.\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\
  *     Reference:\n\
  *\n\
  *     K. Braman, R. Byers and R. Mathias, The Multi-Shift QR\n\
  *     Algorithm Part I: Maintaining Well Focused Shifts, and\n\
  *     Level 3 Performance, SIAM Journal of Matrix Analysis,\n\
  *     volume 23, pages 929--947, 2002.\n\
  *\n\
  *     ================================================================\n"
