--- 
:name: dgsvj1
:md5sum: 5a0a9a6d9b6517aee627cb9db7764663
:category: :subroutine
:arguments: 
- jobv: 
    :type: char
    :intent: input
- m: 
    :type: integer
    :intent: input
- n: 
    :type: integer
    :intent: input
- n1: 
    :type: integer
    :intent: input
- a: 
    :type: doublereal
    :intent: input/output
    :dims: 
    - lda
    - n
- lda: 
    :type: integer
    :intent: input
- d: 
    :type: doublereal
    :intent: input/output
    :dims: 
    - n
- sva: 
    :type: doublereal
    :intent: input/output
    :dims: 
    - n
- mv: 
    :type: integer
    :intent: input
- v: 
    :type: doublereal
    :intent: input/output
    :dims: 
    - ldv
    - n
- ldv: 
    :type: integer
    :intent: input
- eps: 
    :type: doublereal
    :intent: input
- sfmin: 
    :type: doublereal
    :intent: input
- tol: 
    :type: doublereal
    :intent: input
- nsweep: 
    :type: integer
    :intent: input
- work: 
    :type: doublereal
    :intent: workspace
    :dims: 
    - lwork
- lwork: 
    :type: integer
    :intent: input
    :option: true
    :default: m
- info: 
    :type: integer
    :intent: output
:substitutions: 
  lwork: m
:fortran_help: "      SUBROUTINE DGSVJ1( JOBV, M, N, N1, A, LDA, D, SVA, MV, V, LDV, EPS, SFMIN, TOL, NSWEEP, WORK, LWORK, INFO )\n\n\
  *  Purpose\n\
  *  =======\n\
  *\n\
  *  DGSVJ1 is called from SGESVJ as a pre-processor and that is its main\n\
  *  purpose. It applies Jacobi rotations in the same way as SGESVJ does, but\n\
  *  it targets only particular pivots and it does not check convergence\n\
  *  (stopping criterion). Few tunning parameters (marked by [TP]) are\n\
  *  available for the implementer.\n\
  *\n\
  *  Further Details\n\
  *  ~~~~~~~~~~~~~~~\n\
  *  DGSVJ1 applies few sweeps of Jacobi rotations in the column space of\n\
  *  the input M-by-N matrix A. The pivot pairs are taken from the (1,2)\n\
  *  off-diagonal block in the corresponding N-by-N Gram matrix A^T * A. The\n\
  *  block-entries (tiles) of the (1,2) off-diagonal block are marked by the\n\
  *  [x]'s in the following scheme:\n\
  *\n\
  *     | *   *   * [x] [x] [x]|\n\
  *     | *   *   * [x] [x] [x]|    Row-cycling in the nblr-by-nblc [x] blocks.\n\
  *     | *   *   * [x] [x] [x]|    Row-cyclic pivoting inside each [x] block.\n\
  *     |[x] [x] [x] *   *   * |\n\
  *     |[x] [x] [x] *   *   * |\n\
  *     |[x] [x] [x] *   *   * |\n\
  *\n\
  *  In terms of the columns of A, the first N1 columns are rotated 'against'\n\
  *  the remaining N-N1 columns, trying to increase the angle between the\n\
  *  corresponding subspaces. The off-diagonal block is N1-by(N-N1) and it is\n\
  *  tiled using quadratic tiles of side KBL. Here, KBL is a tunning parmeter.\n\
  *  The number of sweeps is given in NSWEEP and the orthogonality threshold\n\
  *  is given in TOL.\n\
  *\n\
  *  Contributors\n\
  *  ~~~~~~~~~~~~\n\
  *  Zlatko Drmac (Zagreb, Croatia) and Kresimir Veselic (Hagen, Germany)\n\
  *\n\n\
  *  Arguments\n\
  *  =========\n\
  *\n\
  *  JOBV    (input) CHARACTER*1\n\
  *          Specifies whether the output from this procedure is used\n\
  *          to compute the matrix V:\n\
  *          = 'V': the product of the Jacobi rotations is accumulated\n\
  *                 by postmulyiplying the N-by-N array V.\n\
  *                (See the description of V.)\n\
  *          = 'A': the product of the Jacobi rotations is accumulated\n\
  *                 by postmulyiplying the MV-by-N array V.\n\
  *                (See the descriptions of MV and V.)\n\
  *          = 'N': the Jacobi rotations are not accumulated.\n\
  *\n\
  *  M       (input) INTEGER\n\
  *          The number of rows of the input matrix A.  M >= 0.\n\
  *\n\
  *  N       (input) INTEGER\n\
  *          The number of columns of the input matrix A.\n\
  *          M >= N >= 0.\n\
  *\n\
  *  N1      (input) INTEGER\n\
  *          N1 specifies the 2 x 2 block partition, the first N1 columns are\n\
  *          rotated 'against' the remaining N-N1 columns of A.\n\
  *\n\
  *  A       (input/output) DOUBLE PRECISION array, dimension (LDA,N)\n\
  *          On entry, M-by-N matrix A, such that A*diag(D) represents\n\
  *          the input matrix.\n\
  *          On exit,\n\
  *          A_onexit * D_onexit represents the input matrix A*diag(D)\n\
  *          post-multiplied by a sequence of Jacobi rotations, where the\n\
  *          rotation threshold and the total number of sweeps are given in\n\
  *          TOL and NSWEEP, respectively.\n\
  *          (See the descriptions of N1, D, TOL and NSWEEP.)\n\
  *\n\
  *  LDA     (input) INTEGER\n\
  *          The leading dimension of the array A.  LDA >= max(1,M).\n\
  *\n\
  *  D       (input/workspace/output) DOUBLE PRECISION array, dimension (N)\n\
  *          The array D accumulates the scaling factors from the fast scaled\n\
  *          Jacobi rotations.\n\
  *          On entry, A*diag(D) represents the input matrix.\n\
  *          On exit, A_onexit*diag(D_onexit) represents the input matrix\n\
  *          post-multiplied by a sequence of Jacobi rotations, where the\n\
  *          rotation threshold and the total number of sweeps are given in\n\
  *          TOL and NSWEEP, respectively.\n\
  *          (See the descriptions of N1, A, TOL and NSWEEP.)\n\
  *\n\
  *  SVA     (input/workspace/output) DOUBLE PRECISION array, dimension (N)\n\
  *          On entry, SVA contains the Euclidean norms of the columns of\n\
  *          the matrix A*diag(D).\n\
  *          On exit, SVA contains the Euclidean norms of the columns of\n\
  *          the matrix onexit*diag(D_onexit).\n\
  *\n\
  *  MV      (input) INTEGER\n\
  *          If JOBV .EQ. 'A', then MV rows of V are post-multipled by a\n\
  *                           sequence of Jacobi rotations.\n\
  *          If JOBV = 'N',   then MV is not referenced.\n\
  *\n\
  *  V       (input/output) DOUBLE PRECISION array, dimension (LDV,N)\n\
  *          If JOBV .EQ. 'V' then N rows of V are post-multipled by a\n\
  *                           sequence of Jacobi rotations.\n\
  *          If JOBV .EQ. 'A' then MV rows of V are post-multipled by a\n\
  *                           sequence of Jacobi rotations.\n\
  *          If JOBV = 'N',   then V is not referenced.\n\
  *\n\
  *  LDV     (input) INTEGER\n\
  *          The leading dimension of the array V,  LDV >= 1.\n\
  *          If JOBV = 'V', LDV .GE. N.\n\
  *          If JOBV = 'A', LDV .GE. MV.\n\
  *\n\
  *  EPS     (input) DOUBLE PRECISION\n\
  *          EPS = DLAMCH('Epsilon')\n\
  *\n\
  *  SFMIN   (input) DOUBLE PRECISION\n\
  *          SFMIN = DLAMCH('Safe Minimum')\n\
  *\n\
  *  TOL     (input) DOUBLE PRECISION\n\
  *          TOL is the threshold for Jacobi rotations. For a pair\n\
  *          A(:,p), A(:,q) of pivot columns, the Jacobi rotation is\n\
  *          applied only if DABS(COS(angle(A(:,p),A(:,q)))) .GT. TOL.\n\
  *\n\
  *  NSWEEP  (input) INTEGER\n\
  *          NSWEEP is the number of sweeps of Jacobi rotations to be\n\
  *          performed.\n\
  *\n\
  *  WORK    (workspace) DOUBLE PRECISION array, dimension (LWORK)\n\
  *\n\
  *  LWORK   (input) INTEGER\n\
  *          LWORK is the dimension of WORK. LWORK .GE. M.\n\
  *\n\
  *  INFO    (output) INTEGER\n\
  *          = 0 : successful exit.\n\
  *          < 0 : if INFO = -i, then the i-th argument had an illegal value\n\
  *\n\n\
  *  =====================================================================\n\
  *\n\
  *     .. Local Parameters ..\n      DOUBLE PRECISION   ZERO, HALF, ONE, TWO\n      PARAMETER          ( ZERO = 0.0D0, HALF = 0.5D0, ONE = 1.0D0,\n     +                   TWO = 2.0D0 )\n\
  *     ..\n\
  *     .. Local Scalars ..\n      DOUBLE PRECISION   AAPP, AAPP0, AAPQ, AAQQ, APOAQ, AQOAP, BIG,\n     +                   BIGTHETA, CS, LARGE, MXAAPQ, MXSINJ, ROOTBIG,\n     +                   ROOTEPS, ROOTSFMIN, ROOTTOL, SMALL, SN, T,\n     +                   TEMP1, THETA, THSIGN\n      INTEGER            BLSKIP, EMPTSW, i, ibr, igl, IERR, IJBLSK,\n     +                   ISWROT, jbc, jgl, KBL, MVL, NOTROT, nblc, nblr,\n     +                   p, PSKIPPED, q, ROWSKIP, SWBAND\n      LOGICAL            APPLV, ROTOK, RSVEC\n\
  *     ..\n\
  *     .. Local Arrays ..\n      DOUBLE PRECISION   FASTR( 5 )\n\
  *     ..\n\
  *     .. Intrinsic Functions ..\n      INTRINSIC          DABS, DMAX1, DBLE, MIN0, DSIGN, DSQRT\n\
  *     ..\n\
  *     .. External Functions ..\n      DOUBLE PRECISION   DDOT, DNRM2\n      INTEGER            IDAMAX\n      LOGICAL            LSAME\n      EXTERNAL           IDAMAX, LSAME, DDOT, DNRM2\n\
  *     ..\n\
  *     .. External Subroutines ..\n      EXTERNAL           DAXPY, DCOPY, DLASCL, DLASSQ, DROTM, DSWAP\n\
  *     ..\n"
