SRC/dlaln2.f(3)
πΈ NAME πΈ
SRC/dlaln2.f β yes bestie, that's the name, and this page is from the Library Functions Manual. It's giving "niche LAPACK routine but make it iconic" energy. π
β¨ SYNOPSIS β¨
Functions/Subroutines
subroutine dlaln2 (ltrans, na, nw, smin, ca, a, lda, d1, d2, b, ldb, wr,
wi, x, ldx, scale, xnorm, info)
DLALN2 solves a 1-by-1 or 2-by-2 linear system of equations of the specified form.
π«Ά Function/Subroutine Documentation π«Ά
Okay, here's the full signature, character for character, because she is long and she is serving:
subroutine dlaln2 (logical ltrans, integer na, integer nw, double precision
smin, double precision ca, double precision, dimension( lda, * ) a,
integer lda, double precision d1, double precision d2, double precision,
dimension( ldb, * ) b, integer ldb, double precision wr, double
precision wi, double precision, dimension( ldx, * ) x, integer ldx,
double precision scale, double precision xnorm, integer info)
DLALN2 solves a 1-by-1 or 2-by-2 linear system of equations of the specified form. No cap. π¦
Purpose π
DLALN2 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 () and perturbation of A. (A**T means A-transpose.) Periodt. β¨
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. Very "two columns, one vibe." π
There's a scaling factor (<= 1), computed by DLALN2, which is 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. She's approximate but she's doing her best. π
β Note: all input quantities are assumed to be smaller than overflow by a reasonable factor. (See BIGNUM.)
Parameters π
LTRANSβLTRANSisLOGICAL.=.TRUE.: A-transpose will be used.=.FALSE.:Awill be used (not transposed). Pick your fighter. πNAβNAisINTEGER. The size of the matrixA. It may (only) be1or2.NWβNWisINTEGER.1if the scalar is real,2if the scalar is complex. It may only be1or2.SMINβSMINisDOUBLE PRECISION. The desired lower bound on the singular values ofA. This should be a safe distance away from underflow or overflow, say, between(underflow/machine precision)and(machine precision * overflow ). (SeeBIGNUMandULP.)CAβCAisDOUBLE PRECISION. The coefficientc, whichAis multiplied by.AβAisDOUBLE PRECISION array, dimension (LDA,NA). TheNA x NAmatrixA.LDAβLDAisINTEGER. The leading dimension ofA. It must be at leastNA.D1βD1isDOUBLE PRECISION. The1,1element in the diagonal matrixD.D2βD2isDOUBLE PRECISION. The2,2element in the diagonal matrixD. Not used ifNA=1.BβBisDOUBLE PRECISION array, dimension (LDB,NW). TheNA x NWmatrixB(right-hand side). IfNW=2(the scalar is complex), column 1 contains the real part ofBand column 2 contains the imaginary part.LDBβLDBisINTEGER. The leading dimension ofB. It must be at leastNA.WRβWRisDOUBLE PRECISION. The real part of the scalarw.WIβWIisDOUBLE PRECISION. The imaginary part of the scalarw. Not used ifNW=1.XβXisDOUBLE PRECISION array, dimension (LDX,NW). TheNA x NWmatrixX(unknowns), as computed byDLALN2. IfNW=2(the scalar is complex), on exit, column 1 will contain the real part ofXand column 2 will contain the imaginary part.LDXβLDXisINTEGER. The leading dimension ofX. It must be at leastNA.SCALEβSCALEisDOUBLE PRECISION. The scale factor thatBmust 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.XNORMβXNORMisDOUBLE PRECISION. The infinity-norm ofX, whenXis regarded as anNA x NWreal matrix.INFOβINFOisINTEGER. 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 ifca 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.
β οΈ NOTE: In the interests of speed, this routine does not check the inputs for errors. Bestie, that is the whole warning. It said what it said. π
Author π«Ά
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
Definition at line 216 of file dlaln2.f.
π Author π
Generated automatically by Doxygen for LAPACK from the source code.
Signed off with LAPACK Version 3.12.0 and SRC/dlaln2.f(3), periodt. π
β¨
π¦ 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