SRC/slaln2.f(3)
π NAME π
SRC/slaln2.f
Okay so this page is SRC/slaln2.f(3) from the Library Functions Manual, and itβs the whole cute-but-serious scoop on slaln2. π
β¨ SYNOPSIS β¨
Functions/Subroutines
subroutine slaln2 (ltrans, na, nw, smin, ca, a, lda, d1, d2, b, ldb, wr,
wi, x, ldx, scale, xnorm, info)
SLALN2 solves a 1-by-1 or 2-by-2 linear system of equations of the specified form. periodt. π
π§ Function/Subroutine Documentation π§
π¦ subroutine slaln2 π¦
subroutine slaln2 (logical ltrans, integer na, integer nw, real smin, real
ca, real, dimension( lda, * ) a, integer lda, real d1, real d2, real,
dimension( ldb, * ) b, integer ldb, real wr, real wi, real, dimension(
ldx, * ) x, integer ldx, real scale, real xnorm, integer info)
SLALN2 solves a 1-by-1 or 2-by-2 linear system of equations of the specified form. no cap, thatβs the whole main-character job. π
π Purpose π
Bestie, SLALN2 solves a system of the form
(ca A - w D ) X = s B
or
(ca A**T - w D) X = s B
with possible scaling (thatβs the s in the equation) and perturbation of A. (A**T means A-transpose.) π¦
A is an NA x NA real matrix, ca is a real scalar, D is an NA x NA real diagonal matrix, w is a real or complex value, and X and B are NA x 1 matrices β real if w is real, complex if w is complex. NA may be 1 or 2.
If w is complex, X and B are represented as NA x 2 matrices, the first column of each being the real part and the second being the imaginary part. π
The scaling factor is <= 1, computed by SLALN2, and so chosen that X can be computed without overflow. X is further scaled if necessary to assure that norm(ca A - w D)*norm(X) is less than overflow.
If both singular values of (ca A - w D) are less than SMIN, SMIN*identity will be used instead of (ca A - w D). If only one singular value is less than SMIN, one element of (ca A - w D) will be perturbed enough to make the smallest singular value roughly SMIN. If both singular values are at least SMIN, (ca A - w D) will not be perturbed. In any case, the perturbation will be at most some small multiple of max( SMIN, ulp*norm(ca A - w D) ). The singular values are computed by infinity-norm approximations, and thus will only be correct to a factor of 2 or so. π
Note: all input quantities are assumed to be smaller than overflow by a reasonable factor. (See BIGNUM.) β
πΈ Parameters πΈ
LTRANSβLTRANS is LOGICAL.TRUE.: A-transpose will be used..FALSE.: A will be used (not transposed.)
NAβNA is INTEGER- The size of the matrix
A. It may (only) be1or2.
- The size of the matrix
NWβNW is INTEGER1ifwis real,2ifwis complex. It may only be1or2.
SMINβSMIN is REAL- The desired lower bound on the singular values of
A. This should be a safe distance away from underflow or overflow, say, between(underflow/machine precision)and(machine precision * overflow ). (SeeBIGNUMandULP.)
- The desired lower bound on the singular values of
CAβCA is REAL- The coefficient
c, whichAis multiplied by.
- The coefficient
AβA is REAL array, dimension (LDA,NA)- The
NA x NAmatrixA.
- The
LDAβLDA is INTEGER- The leading dimension of
A. It must be at leastNA.
- The leading dimension of
D1βD1 is REAL- The
1,1element in the diagonal matrixD.
- The
D2βD2 is REAL- The
2,2element in the diagonal matrixD. Not used ifNA=1.
- The
BβB is REAL array, dimension (LDB,NW)- The
NA x NWmatrixB(right-hand side). IfNW=2(wis complex), column1contains the real part ofBand column2contains the imaginary part.
- The
LDBβLDB is INTEGER- The leading dimension of
B. It must be at leastNA.
- The leading dimension of
WRβWR is REAL- The real part of the scalar
w.
- The real part of the scalar
WIβWI is REAL- The imaginary part of the scalar
w. Not used ifNW=1.
- The imaginary part of the scalar
XβX is REAL array, dimension (LDX,NW)- The
NA x NWmatrixX(unknowns), as computed bySLALN2. IfNW=2(wis complex), on exit, column1will contain the real part ofXand column2will contain the imaginary part.
- The
LDXβLDX is INTEGER- The leading dimension of
X. It must be at leastNA.
- The leading dimension of
SCALEβSCALE is REAL- The scale factor that
Bmust be multiplied by to insure that overflow does not occur when computingX. Thus,(ca A - w D) Xwill beSCALE*B, notB(ignoring perturbations ofA.) It will be at most1.
- The scale factor that
XNORMβXNORM is REAL- The infinity-norm of
X, whenXis regarded as anNA x NWreal matrix.
- The infinity-norm of
INFOβINFO is INTEGER- An error flag. It will be set to zero if no error occurs, a negative number if an argument is in error, or a positive number if
ca A - w Dhad to be perturbed. The possible values are:= 0: No error occurred, and(ca A - w D)did not have to be perturbed.= 1:(ca A - w D)had to be perturbed to make its smallest (or only) singular value greater thanSMIN.
- An error flag. It will be set to zero if no error occurs, a negative number if an argument is in error, or a positive number if
β οΈ NOTE: In the interests of speed, this routine does not check the inputs for errors. π
π«Ά Author π«Ά
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Definition at line 216 of file slaln2.f. π
π Author π
Generated automatically by Doxygen for LAPACK from the source code.
Thatβs the whole page, bestie π«Ά. Footer vibes: LAPACK Version 3.12.0, page SRC/slaln2.f(3). Mwah πβ¨
π¦ where this page comes from
- arch rolling: lapack-doc 3.12.1-2 Β· custom
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms