--- 
:name: zggsvp
:md5sum: fac9d59192d94c42c95f56a73f97a717
:category: :subroutine
:arguments: 
- jobu: 
    :type: char
    :intent: input
- jobv: 
    :type: char
    :intent: input
- jobq: 
    :type: char
    :intent: input
- m: 
    :type: integer
    :intent: input
- p: 
    :type: integer
    :intent: input
- n: 
    :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
- tola: 
    :type: doublereal
    :intent: input
- tolb: 
    :type: doublereal
    :intent: input
- k: 
    :type: integer
    :intent: output
- l: 
    :type: integer
    :intent: output
- u: 
    :type: doublecomplex
    :intent: output
    :dims: 
    - ldu
    - m
- ldu: 
    :type: integer
    :intent: input
- v: 
    :type: doublecomplex
    :intent: output
    :dims: 
    - ldv
    - p
- ldv: 
    :type: integer
    :intent: input
- q: 
    :type: doublecomplex
    :intent: output
    :dims: 
    - ldq
    - n
- ldq: 
    :type: integer
    :intent: input
- iwork: 
    :type: integer
    :intent: workspace
    :dims: 
    - n
- rwork: 
    :type: doublereal
    :intent: workspace
    :dims: 
    - 2*n
- tau: 
    :type: doublecomplex
    :intent: workspace
    :dims: 
    - n
- work: 
    :type: doublecomplex
    :intent: workspace
    :dims: 
    - MAX(3*n,m
    - p)
- info: 
    :type: integer
    :intent: output
:substitutions: 
  m: lda
  p: ldb
  ldq: "lsame_(&jobq,\"Q\") ? MAX(1,n) : 1"
  ldu: "lsame_(&jobu,\"U\") ? MAX(1,m) : 1"
  ldv: "lsame_(&jobv,\"V\") ? MAX(1,p) : 1"
:fortran_help: "      SUBROUTINE ZGGSVP( JOBU, JOBV, JOBQ, M, P, N, A, LDA, B, LDB, TOLA, TOLB, K, L, U, LDU, V, LDV, Q, LDQ, IWORK, RWORK, TAU, WORK, INFO )\n\n\
  *  Purpose\n\
  *  =======\n\
  *\n\
  *  ZGGSVP computes unitary matrices U, V and Q such that\n\
  *\n\
  *                   N-K-L  K    L\n\
  *   U'*A*Q =     K ( 0    A12  A13 )  if M-K-L >= 0;\n\
  *                L ( 0     0   A23 )\n\
  *            M-K-L ( 0     0    0  )\n\
  *\n\
  *                   N-K-L  K    L\n\
  *          =     K ( 0    A12  A13 )  if M-K-L < 0;\n\
  *              M-K ( 0     0   A23 )\n\
  *\n\
  *                 N-K-L  K    L\n\
  *   V'*B*Q =   L ( 0     0   B13 )\n\
  *            P-L ( 0     0    0  )\n\
  *\n\
  *  where the K-by-K matrix A12 and L-by-L matrix B13 are nonsingular\n\
  *  upper triangular; A23 is L-by-L upper triangular if M-K-L >= 0,\n\
  *  otherwise A23 is (M-K)-by-L upper trapezoidal.  K+L = the effective\n\
  *  numerical rank of the (M+P)-by-N matrix (A',B')'.  Z' denotes the\n\
  *  conjugate transpose of Z.\n\
  *\n\
  *  This decomposition is the preprocessing step for computing the\n\
  *  Generalized Singular Value Decomposition (GSVD), see subroutine\n\
  *  ZGGSVD.\n\
  *\n\n\
  *  Arguments\n\
  *  =========\n\
  *\n\
  *  JOBU    (input) CHARACTER*1\n\
  *          = 'U':  Unitary matrix U is computed;\n\
  *          = 'N':  U is not computed.\n\
  *\n\
  *  JOBV    (input) CHARACTER*1\n\
  *          = 'V':  Unitary matrix V is computed;\n\
  *          = 'N':  V is not computed.\n\
  *\n\
  *  JOBQ    (input) CHARACTER*1\n\
  *          = 'Q':  Unitary matrix Q is computed;\n\
  *          = 'N':  Q is not computed.\n\
  *\n\
  *  M       (input) INTEGER\n\
  *          The number of rows of the matrix A.  M >= 0.\n\
  *\n\
  *  P       (input) INTEGER\n\
  *          The number of rows of the matrix B.  P >= 0.\n\
  *\n\
  *  N       (input) INTEGER\n\
  *          The number of columns of the matrices A and B.  N >= 0.\n\
  *\n\
  *  A       (input/output) COMPLEX*16 array, dimension (LDA,N)\n\
  *          On entry, the M-by-N matrix A.\n\
  *          On exit, A contains the triangular (or trapezoidal) matrix\n\
  *          described in the Purpose section.\n\
  *\n\
  *  LDA     (input) INTEGER\n\
  *          The leading dimension of the array A. LDA >= max(1,M).\n\
  *\n\
  *  B       (input/output) COMPLEX*16 array, dimension (LDB,N)\n\
  *          On entry, the P-by-N matrix B.\n\
  *          On exit, B contains the triangular matrix described in\n\
  *          the Purpose section.\n\
  *\n\
  *  LDB     (input) INTEGER\n\
  *          The leading dimension of the array B. LDB >= max(1,P).\n\
  *\n\
  *  TOLA    (input) DOUBLE PRECISION\n\
  *  TOLB    (input) DOUBLE PRECISION\n\
  *          TOLA and TOLB are the thresholds to determine the effective\n\
  *          numerical rank of matrix B and a subblock of A. Generally,\n\
  *          they are set to\n\
  *             TOLA = MAX(M,N)*norm(A)*MAZHEPS,\n\
  *             TOLB = MAX(P,N)*norm(B)*MAZHEPS.\n\
  *          The size of TOLA and TOLB may affect the size of backward\n\
  *          errors of the decomposition.\n\
  *\n\
  *  K       (output) INTEGER\n\
  *  L       (output) INTEGER\n\
  *          On exit, K and L specify the dimension of the subblocks\n\
  *          described in Purpose section.\n\
  *          K + L = effective numerical rank of (A',B')'.\n\
  *\n\
  *  U       (output) COMPLEX*16 array, dimension (LDU,M)\n\
  *          If JOBU = 'U', U contains the unitary matrix U.\n\
  *          If JOBU = 'N', U is not referenced.\n\
  *\n\
  *  LDU     (input) INTEGER\n\
  *          The leading dimension of the array U. LDU >= max(1,M) if\n\
  *          JOBU = 'U'; LDU >= 1 otherwise.\n\
  *\n\
  *  V       (output) COMPLEX*16 array, dimension (LDV,P)\n\
  *          If JOBV = 'V', V contains the unitary matrix V.\n\
  *          If JOBV = 'N', V is not referenced.\n\
  *\n\
  *  LDV     (input) INTEGER\n\
  *          The leading dimension of the array V. LDV >= max(1,P) if\n\
  *          JOBV = 'V'; LDV >= 1 otherwise.\n\
  *\n\
  *  Q       (output) COMPLEX*16 array, dimension (LDQ,N)\n\
  *          If JOBQ = 'Q', Q contains the unitary matrix Q.\n\
  *          If JOBQ = 'N', Q is not referenced.\n\
  *\n\
  *  LDQ     (input) INTEGER\n\
  *          The leading dimension of the array Q. LDQ >= max(1,N) if\n\
  *          JOBQ = 'Q'; LDQ >= 1 otherwise.\n\
  *\n\
  *  IWORK   (workspace) INTEGER array, dimension (N)\n\
  *\n\
  *  RWORK   (workspace) DOUBLE PRECISION array, dimension (2*N)\n\
  *\n\
  *  TAU     (workspace) COMPLEX*16 array, dimension (N)\n\
  *\n\
  *  WORK    (workspace) COMPLEX*16 array, dimension (max(3*N,M,P))\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\
  *  The subroutine uses LAPACK subroutine ZGEQPF for the QR factorization\n\
  *  with column pivoting to detect the effective numerical rank of the\n\
  *  a matrix. It may be replaced by a better rank determination strategy.\n\
  *\n\
  *  =====================================================================\n\
  *\n"
