--- 
:name: cgegs
:md5sum: 0d915b089b60c924c71d32fe45a153c2
:category: :subroutine
:arguments: 
- jobvsl: 
    :type: char
    :intent: input
- jobvsr: 
    :type: char
    :intent: input
- n: 
    :type: integer
    :intent: input
- a: 
    :type: complex
    :intent: input/output
    :dims: 
    - lda
    - n
- lda: 
    :type: integer
    :intent: input
- b: 
    :type: complex
    :intent: input/output
    :dims: 
    - ldb
    - n
- ldb: 
    :type: integer
    :intent: input
- alpha: 
    :type: complex
    :intent: output
    :dims: 
    - n
- beta: 
    :type: complex
    :intent: output
    :dims: 
    - n
- vsl: 
    :type: complex
    :intent: output
    :dims: 
    - ldvsl
    - n
- ldvsl: 
    :type: integer
    :intent: input
- vsr: 
    :type: complex
    :intent: output
    :dims: 
    - ldvsr
    - n
- ldvsr: 
    :type: integer
    :intent: input
- work: 
    :type: complex
    :intent: output
    :dims: 
    - MAX(1,lwork)
- lwork: 
    :type: integer
    :intent: input
    :option: true
    :default: 2*n
- rwork: 
    :type: real
    :intent: workspace
    :dims: 
    - 3*n
- info: 
    :type: integer
    :intent: output
:substitutions: 
  ldvsl: "lsame_(&jobvsl,\"V\") ? n : 1"
  ldvsr: "lsame_(&jobvsr,\"V\") ? n : 1"
:fortran_help: "      SUBROUTINE CGEGS( JOBVSL, JOBVSR, N, A, LDA, B, LDB, ALPHA, BETA, VSL, LDVSL, VSR, LDVSR, WORK, LWORK, RWORK, INFO )\n\n\
  *  Purpose\n\
  *  =======\n\
  *\n\
  *  This routine is deprecated and has been replaced by routine CGGES.\n\
  *\n\
  *  CGEGS computes the eigenvalues, Schur form, and, optionally, the\n\
  *  left and or/right Schur vectors of a complex matrix pair (A,B).\n\
  *  Given two square matrices A and B, the generalized Schur\n\
  *  factorization has the form\n\
  *  \n\
  *     A = Q*S*Z**H,  B = Q*T*Z**H\n\
  *  \n\
  *  where Q and Z are unitary matrices and S and T are upper triangular.\n\
  *  The columns of Q are the left Schur vectors\n\
  *  and the columns of Z are the right Schur vectors.\n\
  *  \n\
  *  If only the eigenvalues of (A,B) are needed, the driver routine\n\
  *  CGEGV should be used instead.  See CGEGV for a description of the\n\
  *  eigenvalues of the generalized nonsymmetric eigenvalue problem\n\
  *  (GNEP).\n\
  *\n\n\
  *  Arguments\n\
  *  =========\n\
  *\n\
  *  JOBVSL   (input) CHARACTER*1\n\
  *          = 'N':  do not compute the left Schur vectors;\n\
  *          = 'V':  compute the left Schur vectors (returned in VSL).\n\
  *\n\
  *  JOBVSR   (input) CHARACTER*1\n\
  *          = 'N':  do not compute the right Schur vectors;\n\
  *          = 'V':  compute the right Schur vectors (returned in VSR).\n\
  *\n\
  *  N       (input) INTEGER\n\
  *          The order of the matrices A, B, VSL, and VSR.  N >= 0.\n\
  *\n\
  *  A       (input/output) COMPLEX array, dimension (LDA, N)\n\
  *          On entry, the matrix A.\n\
  *          On exit, the upper triangular matrix S from the generalized\n\
  *          Schur factorization.\n\
  *\n\
  *  LDA     (input) INTEGER\n\
  *          The leading dimension of A.  LDA >= max(1,N).\n\
  *\n\
  *  B       (input/output) COMPLEX array, dimension (LDB, N)\n\
  *          On entry, the matrix B.\n\
  *          On exit, the upper triangular matrix T from the generalized\n\
  *          Schur factorization.\n\
  *\n\
  *  LDB     (input) INTEGER\n\
  *          The leading dimension of B.  LDB >= max(1,N).\n\
  *\n\
  *  ALPHA   (output) COMPLEX array, dimension (N)\n\
  *          The complex scalars alpha that define the eigenvalues of\n\
  *          GNEP.  ALPHA(j) = S(j,j), the diagonal element of the Schur\n\
  *          form of A.\n\
  *\n\
  *  BETA    (output) COMPLEX array, dimension (N)\n\
  *          The non-negative real scalars beta that define the\n\
  *          eigenvalues of GNEP.  BETA(j) = T(j,j), the diagonal element\n\
  *          of the triangular factor T.\n\
  *\n\
  *          Together, the quantities alpha = ALPHA(j) and beta = BETA(j)\n\
  *          represent the j-th eigenvalue of the matrix pair (A,B), in\n\
  *          one of the forms lambda = alpha/beta or mu = beta/alpha.\n\
  *          Since either lambda or mu may overflow, they should not,\n\
  *          in general, be computed.\n\
  *\n\
  *  VSL     (output) COMPLEX array, dimension (LDVSL,N)\n\
  *          If JOBVSL = 'V', the matrix of left Schur vectors Q.\n\
  *          Not referenced if JOBVSL = 'N'.\n\
  *\n\
  *  LDVSL   (input) INTEGER\n\
  *          The leading dimension of the matrix VSL. LDVSL >= 1, and\n\
  *          if JOBVSL = 'V', LDVSL >= N.\n\
  *\n\
  *  VSR     (output) COMPLEX array, dimension (LDVSR,N)\n\
  *          If JOBVSR = 'V', the matrix of right Schur vectors Z.\n\
  *          Not referenced if JOBVSR = 'N'.\n\
  *\n\
  *  LDVSR   (input) INTEGER\n\
  *          The leading dimension of the matrix VSR. LDVSR >= 1, and\n\
  *          if JOBVSR = 'V', LDVSR >= N.\n\
  *\n\
  *  WORK    (workspace/output) COMPLEX array, dimension (MAX(1,LWORK))\n\
  *          On exit, if INFO = 0, WORK(1) returns the optimal LWORK.\n\
  *\n\
  *  LWORK   (input) INTEGER\n\
  *          The dimension of the array WORK.  LWORK >= max(1,2*N).\n\
  *          For good performance, LWORK must generally be larger.\n\
  *          To compute the optimal value of LWORK, call ILAENV to get\n\
  *          blocksizes (for CGEQRF, CUNMQR, and CUNGQR.)  Then compute:\n\
  *          NB  -- MAX of the blocksizes for CGEQRF, CUNMQR, and CUNGQR;\n\
  *          the optimal LWORK is N*(NB+1).\n\
  *\n\
  *          If LWORK = -1, then a workspace query is assumed; the routine\n\
  *          only calculates the optimal size of the WORK array, returns\n\
  *          this value as the first entry of the WORK array, and no error\n\
  *          message related to LWORK is issued by XERBLA.\n\
  *\n\
  *  RWORK   (workspace) REAL array, dimension (3*N)\n\
  *\n\
  *  INFO    (output) INTEGER\n\
  *          = 0:  successful exit\n\
  *          < 0:  if INFO = -i, the i-th argument had an illegal value.\n\
  *          =1,...,N:\n\
  *                The QZ iteration failed.  (A,B) are not in Schur\n\
  *                form, but ALPHA(j) and BETA(j) should be correct for\n\
  *                j=INFO+1,...,N.\n\
  *          > N:  errors that usually indicate LAPACK problems:\n\
  *                =N+1: error return from CGGBAL\n\
  *                =N+2: error return from CGEQRF\n\
  *                =N+3: error return from CUNMQR\n\
  *                =N+4: error return from CUNGQR\n\
  *                =N+5: error return from CGGHRD\n\
  *                =N+6: error return from CHGEQZ (other than failed\n\
  *                                               iteration)\n\
  *                =N+7: error return from CGGBAK (computing VSL)\n\
  *                =N+8: error return from CGGBAK (computing VSR)\n\
  *                =N+9: error return from CLASCL (various places)\n\
  *\n\n\
  *  =====================================================================\n\
  *\n"
