--- 
:name: dlaln2
:md5sum: 029cdd6fe89ae0077f078ad1c1d1da86
:category: :subroutine
:arguments: 
- ltrans: 
    :type: logical
    :intent: input
- na: 
    :type: integer
    :intent: input
- nw: 
    :type: integer
    :intent: input
- smin: 
    :type: doublereal
    :intent: input
- ca: 
    :type: doublereal
    :intent: input
- a: 
    :type: doublereal
    :intent: input
    :dims: 
    - lda
    - na
- lda: 
    :type: integer
    :intent: input
- d1: 
    :type: doublereal
    :intent: input
- d2: 
    :type: doublereal
    :intent: input
- b: 
    :type: doublereal
    :intent: input
    :dims: 
    - ldb
    - nw
- ldb: 
    :type: integer
    :intent: input
- wr: 
    :type: doublereal
    :intent: input
- wi: 
    :type: doublereal
    :intent: input
- x: 
    :type: doublereal
    :intent: output
    :dims: 
    - ldx
    - nw
- ldx: 
    :type: integer
    :intent: input
- scale: 
    :type: doublereal
    :intent: output
- xnorm: 
    :type: doublereal
    :intent: output
- info: 
    :type: integer
    :intent: output
:substitutions: 
  ldx: na
:fortran_help: "      SUBROUTINE DLALN2( LTRANS, NA, NW, SMIN, CA, A, LDA, D1, D2, B, LDB, WR, WI, X, LDX, SCALE, XNORM, INFO )\n\n\
  *  Purpose\n\
  *  =======\n\
  *\n\
  *  DLALN2 solves a system of the form  (ca A - w D ) X = s B\n\
  *  or (ca A' - w D) X = s B   with possible scaling (\"s\") and\n\
  *  perturbation of A.  (A' means A-transpose.)\n\
  *\n\
  *  A is an NA x NA real matrix, ca is a real scalar, D is an NA x NA\n\
  *  real diagonal matrix, w is a real or complex value, and X and B are\n\
  *  NA x 1 matrices -- real if w is real, complex if w is complex.  NA\n\
  *  may be 1 or 2.\n\
  *\n\
  *  If w is complex, X and B are represented as NA x 2 matrices,\n\
  *  the first column of each being the real part and the second\n\
  *  being the imaginary part.\n\
  *\n\
  *  \"s\" is a scaling factor (.LE. 1), computed by DLALN2, which is\n\
  *  so chosen that X can be computed without overflow.  X is further\n\
  *  scaled if necessary to assure that norm(ca A - w D)*norm(X) is less\n\
  *  than overflow.\n\
  *\n\
  *  If both singular values of (ca A - w D) are less than SMIN,\n\
  *  SMIN*identity will be used instead of (ca A - w D).  If only one\n\
  *  singular value is less than SMIN, one element of (ca A - w D) will be\n\
  *  perturbed enough to make the smallest singular value roughly SMIN.\n\
  *  If both singular values are at least SMIN, (ca A - w D) will not be\n\
  *  perturbed.  In any case, the perturbation will be at most some small\n\
  *  multiple of max( SMIN, ulp*norm(ca A - w D) ).  The singular values\n\
  *  are computed by infinity-norm approximations, and thus will only be\n\
  *  correct to a factor of 2 or so.\n\
  *\n\
  *  Note: all input quantities are assumed to be smaller than overflow\n\
  *  by a reasonable factor.  (See BIGNUM.)\n\
  *\n\n\
  *  Arguments\n\
  *  ==========\n\
  *\n\
  *  LTRANS  (input) LOGICAL\n\
  *          =.TRUE.:  A-transpose will be used.\n\
  *          =.FALSE.: A will be used (not transposed.)\n\
  *\n\
  *  NA      (input) INTEGER\n\
  *          The size of the matrix A.  It may (only) be 1 or 2.\n\
  *\n\
  *  NW      (input) INTEGER\n\
  *          1 if \"w\" is real, 2 if \"w\" is complex.  It may only be 1\n\
  *          or 2.\n\
  *\n\
  *  SMIN    (input) DOUBLE PRECISION\n\
  *          The desired lower bound on the singular values of A.  This\n\
  *          should be a safe distance away from underflow or overflow,\n\
  *          say, between (underflow/machine precision) and  (machine\n\
  *          precision * overflow ).  (See BIGNUM and ULP.)\n\
  *\n\
  *  CA      (input) DOUBLE PRECISION\n\
  *          The coefficient c, which A is multiplied by.\n\
  *\n\
  *  A       (input) DOUBLE PRECISION array, dimension (LDA,NA)\n\
  *          The NA x NA matrix A.\n\
  *\n\
  *  LDA     (input) INTEGER\n\
  *          The leading dimension of A.  It must be at least NA.\n\
  *\n\
  *  D1      (input) DOUBLE PRECISION\n\
  *          The 1,1 element in the diagonal matrix D.\n\
  *\n\
  *  D2      (input) DOUBLE PRECISION\n\
  *          The 2,2 element in the diagonal matrix D.  Not used if NW=1.\n\
  *\n\
  *  B       (input) DOUBLE PRECISION array, dimension (LDB,NW)\n\
  *          The NA x NW matrix B (right-hand side).  If NW=2 (\"w\" is\n\
  *          complex), column 1 contains the real part of B and column 2\n\
  *          contains the imaginary part.\n\
  *\n\
  *  LDB     (input) INTEGER\n\
  *          The leading dimension of B.  It must be at least NA.\n\
  *\n\
  *  WR      (input) DOUBLE PRECISION\n\
  *          The real part of the scalar \"w\".\n\
  *\n\
  *  WI      (input) DOUBLE PRECISION\n\
  *          The imaginary part of the scalar \"w\".  Not used if NW=1.\n\
  *\n\
  *  X       (output) DOUBLE PRECISION array, dimension (LDX,NW)\n\
  *          The NA x NW matrix X (unknowns), as computed by DLALN2.\n\
  *          If NW=2 (\"w\" is complex), on exit, column 1 will contain\n\
  *          the real part of X and column 2 will contain the imaginary\n\
  *          part.\n\
  *\n\
  *  LDX     (input) INTEGER\n\
  *          The leading dimension of X.  It must be at least NA.\n\
  *\n\
  *  SCALE   (output) DOUBLE PRECISION\n\
  *          The scale factor that B must be multiplied by to insure\n\
  *          that overflow does not occur when computing X.  Thus,\n\
  *          (ca A - w D) X  will be SCALE*B, not B (ignoring\n\
  *          perturbations of A.)  It will be at most 1.\n\
  *\n\
  *  XNORM   (output) DOUBLE PRECISION\n\
  *          The infinity-norm of X, when X is regarded as an NA x NW\n\
  *          real matrix.\n\
  *\n\
  *  INFO    (output) INTEGER\n\
  *          An error flag.  It will be set to zero if no error occurs,\n\
  *          a negative number if an argument is in error, or a positive\n\
  *          number if  ca A - w D  had to be perturbed.\n\
  *          The possible values are:\n\
  *          = 0: No error occurred, and (ca A - w D) did not have to be\n\
  *                 perturbed.\n\
  *          = 1: (ca A - w D) had to be perturbed to make its smallest\n\
  *               (or only) singular value greater than SMIN.\n\
  *          NOTE: In the interests of speed, this routine does not\n\
  *                check the inputs for errors.\n\
  *\n\n\
  * =====================================================================\n\
  *\n"
