--- 
:name: zgghrd
:md5sum: c4bd0bbb646c8b02ff96b0a6977d8d8c
:category: :subroutine
:arguments: 
- compq: 
    :type: char
    :intent: input
- compz: 
    :type: char
    :intent: input
- n: 
    :type: integer
    :intent: input
- ilo: 
    :type: integer
    :intent: input
- ihi: 
    :type: integer
    :intent: input
- a: 
    :type: doublecomplex
    :intent: input/output
    :dims: 
    - lda
    - n
- lda: 
    :type: integer
    :intent: input
- b: 
    :type: doublecomplex
    :intent: input/output
    :dims: 
    - ldb
    - n
- ldb: 
    :type: integer
    :intent: input
- q: 
    :type: doublecomplex
    :intent: input/output
    :dims: 
    - ldq
    - n
- ldq: 
    :type: integer
    :intent: input
- z: 
    :type: doublecomplex
    :intent: input/output
    :dims: 
    - ldz
    - n
- ldz: 
    :type: integer
    :intent: input
- info: 
    :type: integer
    :intent: output
:substitutions: {}

:fortran_help: "      SUBROUTINE ZGGHRD( COMPQ, COMPZ, N, ILO, IHI, A, LDA, B, LDB, Q, LDQ, Z, LDZ, INFO )\n\n\
  *  Purpose\n\
  *  =======\n\
  *\n\
  *  ZGGHRD reduces a pair of complex matrices (A,B) to generalized upper\n\
  *  Hessenberg form using unitary transformations, where A is a\n\
  *  general matrix and B is upper triangular.  The form of the\n\
  *  generalized eigenvalue problem is\n\
  *     A*x = lambda*B*x,\n\
  *  and B is typically made upper triangular by computing its QR\n\
  *  factorization and moving the unitary matrix Q to the left side\n\
  *  of the equation.\n\
  *\n\
  *  This subroutine simultaneously reduces A to a Hessenberg matrix H:\n\
  *     Q**H*A*Z = H\n\
  *  and transforms B to another upper triangular matrix T:\n\
  *     Q**H*B*Z = T\n\
  *  in order to reduce the problem to its standard form\n\
  *     H*y = lambda*T*y\n\
  *  where y = Z**H*x.\n\
  *\n\
  *  The unitary matrices Q and Z are determined as products of Givens\n\
  *  rotations.  They may either be formed explicitly, or they may be\n\
  *  postmultiplied into input matrices Q1 and Z1, so that\n\
  *       Q1 * A * Z1**H = (Q1*Q) * H * (Z1*Z)**H\n\
  *       Q1 * B * Z1**H = (Q1*Q) * T * (Z1*Z)**H\n\
  *  If Q1 is the unitary matrix from the QR factorization of B in the\n\
  *  original equation A*x = lambda*B*x, then ZGGHRD reduces the original\n\
  *  problem to generalized Hessenberg form.\n\
  *\n\n\
  *  Arguments\n\
  *  =========\n\
  *\n\
  *  COMPQ   (input) CHARACTER*1\n\
  *          = 'N': do not compute Q;\n\
  *          = 'I': Q is initialized to the unit matrix, and the\n\
  *                 unitary matrix Q is returned;\n\
  *          = 'V': Q must contain a unitary matrix Q1 on entry,\n\
  *                 and the product Q1*Q is returned.\n\
  *\n\
  *  COMPZ   (input) CHARACTER*1\n\
  *          = 'N': do not compute Q;\n\
  *          = 'I': Q is initialized to the unit matrix, and the\n\
  *                 unitary matrix Q is returned;\n\
  *          = 'V': Q must contain a unitary matrix Q1 on entry,\n\
  *                 and the product Q1*Q is returned.\n\
  *\n\
  *  N       (input) INTEGER\n\
  *          The order of the matrices A and B.  N >= 0.\n\
  *\n\
  *  ILO     (input) INTEGER\n\
  *  IHI     (input) INTEGER\n\
  *          ILO and IHI mark the rows and columns of A which are to be\n\
  *          reduced.  It is assumed that A is already upper triangular\n\
  *          in rows and columns 1:ILO-1 and IHI+1:N.  ILO and IHI are\n\
  *          normally set by a previous call to ZGGBAL; otherwise they\n\
  *          should be set to 1 and N respectively.\n\
  *          1 <= ILO <= IHI <= N, if N > 0; ILO=1 and IHI=0, if N=0.\n\
  *\n\
  *  A       (input/output) COMPLEX*16 array, dimension (LDA, N)\n\
  *          On entry, the N-by-N general matrix to be reduced.\n\
  *          On exit, the upper triangle and the first subdiagonal of A\n\
  *          are overwritten with the upper Hessenberg matrix H, and the\n\
  *          rest is set to zero.\n\
  *\n\
  *  LDA     (input) INTEGER\n\
  *          The leading dimension of the array A.  LDA >= max(1,N).\n\
  *\n\
  *  B       (input/output) COMPLEX*16 array, dimension (LDB, N)\n\
  *          On entry, the N-by-N upper triangular matrix B.\n\
  *          On exit, the upper triangular matrix T = Q**H B Z.  The\n\
  *          elements below the diagonal are set to zero.\n\
  *\n\
  *  LDB     (input) INTEGER\n\
  *          The leading dimension of the array B.  LDB >= max(1,N).\n\
  *\n\
  *  Q       (input/output) COMPLEX*16 array, dimension (LDQ, N)\n\
  *          On entry, if COMPQ = 'V', the unitary matrix Q1, typically\n\
  *          from the QR factorization of B.\n\
  *          On exit, if COMPQ='I', the unitary matrix Q, and if\n\
  *          COMPQ = 'V', the product Q1*Q.\n\
  *          Not referenced if COMPQ='N'.\n\
  *\n\
  *  LDQ     (input) INTEGER\n\
  *          The leading dimension of the array Q.\n\
  *          LDQ >= N if COMPQ='V' or 'I'; LDQ >= 1 otherwise.\n\
  *\n\
  *  Z       (input/output) COMPLEX*16 array, dimension (LDZ, N)\n\
  *          On entry, if COMPZ = 'V', the unitary matrix Z1.\n\
  *          On exit, if COMPZ='I', the unitary matrix Z, and if\n\
  *          COMPZ = 'V', the product Z1*Z.\n\
  *          Not referenced if COMPZ='N'.\n\
  *\n\
  *  LDZ     (input) INTEGER\n\
  *          The leading dimension of the array Z.\n\
  *          LDZ >= N if COMPZ='V' or 'I'; LDZ >= 1 otherwise.\n\
  *\n\
  *  INFO    (output) INTEGER\n\
  *          = 0:  successful exit.\n\
  *          < 0:  if INFO = -i, the i-th argument had an illegal value.\n\
  *\n\n\
  *  Further Details\n\
  *  ===============\n\
  *\n\
  *  This routine reduces A to Hessenberg and B to triangular form by\n\
  *  an unblocked reduction, as described in _Matrix_Computations_,\n\
  *  by Golub and van Loan (Johns Hopkins Press).\n\
  *\n\
  *  =====================================================================\n\
  *\n"
