--- 
:name: sgsvj0
:md5sum: 3d2a3ab6cc4e65db034ed891716f6493
:category: :subroutine
:arguments: 
- jobv: 
    :type: char
    :intent: input
- m: 
    :type: integer
    :intent: input
- n: 
    :type: integer
    :intent: input
- a: 
    :type: real
    :intent: input/output
    :dims: 
    - lda
    - n
- lda: 
    :type: integer
    :intent: input
- d: 
    :type: real
    :intent: input/output
    :dims: 
    - n
- sva: 
    :type: real
    :intent: input/output
    :dims: 
    - n
- mv: 
    :type: integer
    :intent: input
- v: 
    :type: real
    :intent: input/output
    :dims: 
    - ldv
    - n
- ldv: 
    :type: integer
    :intent: input
- eps: 
    :type: integer
    :intent: input
- sfmin: 
    :type: integer
    :intent: input
- tol: 
    :type: real
    :intent: input
- nsweep: 
    :type: integer
    :intent: input
- work: 
    :type: real
    :intent: workspace
    :dims: 
    - lwork
- lwork: 
    :type: integer
    :intent: input
    :option: true
    :default: m
- info: 
    :type: integer
    :intent: output
:substitutions: 
  lwork: m
:fortran_help: "      SUBROUTINE SGSVJ0( JOBV, M, N, A, LDA, D, SVA, MV, V, LDV, EPS, SFMIN, TOL, NSWEEP, WORK, LWORK, INFO )\n\n\
  *  Purpose\n\
  *  =======\n\
  *\n\
  *  SGSVJ0 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 does not check convergence (stopping criterion). Few tuning\n\
  *  parameters (marked by [TP]) are available for the implementer.\n\
  *\n\
  *  Further Details\n\
  *  ~~~~~~~~~~~~~~~\n\
  *  SGSVJ0 is used just to enable SGESVJ to call a simplified version of\n\
  *  itself to work on a submatrix of the original matrix.\n\
  *\n\
  *  Contributors\n\
  *  ~~~~~~~~~~~~\n\
  *  Zlatko Drmac (Zagreb, Croatia) and Kresimir Veselic (Hagen, Germany)\n\
  *\n\
  *  Bugs, Examples and Comments\n\
  *  ~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\
  *  Please report all bugs and send interesting test examples and comments to\n\
  *  drmac@math.hr. Thank you.\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\
  *  A       (input/output) REAL 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 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) REAL 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 A, TOL and NSWEEP.)\n\
  *\n\
  *  SVA     (input/workspace/output) REAL 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) REAL 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) INTEGER\n\
  *          EPS = SLAMCH('Epsilon')\n\
  *\n\
  *  SFMIN   (input) INTEGER\n\
  *          SFMIN = SLAMCH('Safe Minimum')\n\
  *\n\
  *  TOL     (input) REAL\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 ABS(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) REAL 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      REAL               ZERO, HALF, ONE, TWO\n      PARAMETER          ( ZERO = 0.0E0, HALF = 0.5E0, ONE = 1.0E0,\n     +                   TWO = 2.0E0 )\n\
  *     ..\n\
  *     .. Local Scalars ..\n      REAL               AAPP, AAPP0, AAPQ, AAQQ, APOAQ, AQOAP, BIG,\n     +                   BIGTHETA, CS, MXAAPQ, MXSINJ, ROOTBIG, ROOTEPS,\n     +                   ROOTSFMIN, ROOTTOL, SMALL, SN, T, TEMP1, THETA,\n     +                   THSIGN\n      INTEGER            BLSKIP, EMPTSW, i, ibr, IERR, igl, IJBLSK, ir1,\n     +                   ISWROT, jbc, jgl, KBL, LKAHEAD, MVL, NBL,\n     +                   NOTROT, p, PSKIPPED, q, ROWSKIP, SWBAND\n      LOGICAL            APPLV, ROTOK, RSVEC\n\
  *     ..\n\
  *     .. Local Arrays ..\n      REAL               FASTR( 5 )\n\
  *     ..\n\
  *     .. Intrinsic Functions ..\n      INTRINSIC          ABS, AMAX1, AMIN1, FLOAT, MIN0, SIGN, SQRT\n\
  *     ..\n\
  *     .. External Functions ..\n      REAL               SDOT, SNRM2\n      INTEGER            ISAMAX\n      LOGICAL            LSAME\n      EXTERNAL           ISAMAX, LSAME, SDOT, SNRM2\n\
  *     ..\n\
  *     .. External Subroutines ..\n      EXTERNAL           SAXPY, SCOPY, SLASCL, SLASSQ, SROTM, SSWAP\n\
  *     ..\n"
