--- 
:name: sgghrd
:md5sum: d0503df67d201eb3464bb900dd79f061
: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: real
    :intent: input/output
    :dims: 
    - lda
    - n
- lda: 
    :type: integer
    :intent: input
- b: 
    :type: real
    :intent: input/output
    :dims: 
    - ldb
    - n
- ldb: 
    :type: integer
    :intent: input
- q: 
    :type: real
    :intent: input/output
    :dims: 
    - ldq
    - n
- ldq: 
    :type: integer
    :intent: input
- z: 
    :type: real
    :intent: input/output
    :dims: 
    - ldz
    - n
- ldz: 
    :type: integer
    :intent: input
- info: 
    :type: integer
    :intent: output
:substitutions: {}

:fortran_help: "      SUBROUTINE SGGHRD( COMPQ, COMPZ, N, ILO, IHI, A, LDA, B, LDB, Q, LDQ, Z, LDZ, INFO )\n\n\
  *  Purpose\n\
  *  =======\n\
  *\n\
  *  SGGHRD reduces a pair of real matrices (A,B) to generalized upper\n\
  *  Hessenberg form using orthogonal 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 orthogonal matrix Q to the left side\n\
  *  of the equation.\n\
  *\n\
  *  This subroutine simultaneously reduces A to a Hessenberg matrix H:\n\
  *     Q**T*A*Z = H\n\
  *  and transforms B to another upper triangular matrix T:\n\
  *     Q**T*B*Z = T\n\
  *  in order to reduce the problem to its standard form\n\
  *     H*y = lambda*T*y\n\
  *  where y = Z**T*x.\n\
  *\n\
  *  The orthogonal 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\
  *\n\
  *       Q1 * A * Z1**T = (Q1*Q) * H * (Z1*Z)**T\n\
  *\n\
  *       Q1 * B * Z1**T = (Q1*Q) * T * (Z1*Z)**T\n\
  *\n\
  *  If Q1 is the orthogonal matrix from the QR factorization of B in the\n\
  *  original equation A*x = lambda*B*x, then SGGHRD 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\
  *                 orthogonal matrix Q is returned;\n\
  *          = 'V': Q must contain an orthogonal matrix Q1 on entry,\n\
  *                 and the product Q1*Q is returned.\n\
  *\n\
  *  COMPZ   (input) CHARACTER*1\n\
  *          = 'N': do not compute Z;\n\
  *          = 'I': Z is initialized to the unit matrix, and the\n\
  *                 orthogonal matrix Z is returned;\n\
  *          = 'V': Z must contain an orthogonal matrix Z1 on entry,\n\
  *                 and the product Z1*Z 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 SGGBAL; 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) REAL 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) REAL array, dimension (LDB, N)\n\
  *          On entry, the N-by-N upper triangular matrix B.\n\
  *          On exit, the upper triangular matrix T = Q**T 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) REAL array, dimension (LDQ, N)\n\
  *          On entry, if COMPQ = 'V', the orthogonal matrix Q1,\n\
  *          typically from the QR factorization of B.\n\
  *          On exit, if COMPQ='I', the orthogonal 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) REAL array, dimension (LDZ, N)\n\
  *          On entry, if COMPZ = 'V', the orthogonal matrix Z1.\n\
  *          On exit, if COMPZ='I', the orthogonal 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"
