/home/abui...RC/dlag2.f(3)
πΈ DLAG2 β bestie, let me introduce you to the 2Γ2 generalized eigenvalue girlie πΈ
okay so this page is from the <pink>LAPACK</pink> library manual (that's /home/abui...RC/dlag2.f(3) for the file-paths girlies), and it's literally just one function β one iconic little subroutine that does so much. no cap. let's get into it π
β¨ SYNOPSIS β¨
π«Ά Functions/Subroutines
subroutine DLAG2 (a, lda, b, ldb, safmin, scale1, scale2, wr1, wr2, wi)β DLAG2 computes the eigenvalues of a 2-by-2 generalized eigenvalue problem, with scaling as necessary to avoid over-/underflow.
π Function/Subroutine Documentation π
subroutine DLAG2 (double precision, dimension( lda, * ) a, integer lda, double precision, dimension( ldb, * ) b, integer ldb, double precision safmin, double precision scale1, double precision scale2, double precision wr1, double precision wr2, double precision wi)
so this is the whole vibe: DLAG2 computes the eigenvalues of a 2-by-2 generalized eigenvalue problem, with scaling as necessary to avoid over-/underflow. that's the one-liner. slay π
β Purpose β
okay so here's the actual purpose, quoted-adjacent but make it cute:
!>
!> DLAG2 computes the eigenvalues of a 2 x 2 generalized eigenvalue
!> problem A - w B, with scaling as necessary to avoid over-/underflow.
!>
!> The scaling factor results in a modified eigenvalue equation
!>
!> s A - w B
!>
!> where s is a non-negative scaling factor chosen so that w, w B,
!> and s A do not overflow and, if possible, do not underflow, either.
!>
the way that s is a non-negative scaling factor and it's chosen so w, w B, and s A don't overflow β and, if possible, don't underflow either. like she's out here doing vibe checks on your exponents. π
πΈ Parameters πΈ (the whole cast, no one gets cut)
A
!> A is DOUBLE PRECISION array, dimension (LDA, 2)
!> On entry, the 2 x 2 matrix A. It is assumed that its 1-norm
!> is less than 1/SAFMIN. Entries less than
!> sqrt(SAFMIN)*norm(A) are subject to being treated as zero.
!>
so A is a DOUBLE PRECISION array, dimension (LDA, 2). on entry it's the 2 x 2 matrix A. it's assumed that its 1-norm is less than 1/SAFMIN. and bestie, heads up β entries less than sqrt(SAFMIN)*norm(A) are subject to being treated as zero. π
LDA
!> LDA is INTEGER
!> The leading dimension of the array A. LDA >= 2.
!>
LDA is INTEGER, it's the leading dimension of the array A, and LDA >= 2. that's it. periodt. π
B
!> B is DOUBLE PRECISION array, dimension (LDB, 2)
!> On entry, the 2 x 2 upper triangular matrix B. It is
!> assumed that the one-norm of B is less than 1/SAFMIN. The
!> diagonals should be at least sqrt(SAFMIN) times the largest
!> element of B (in absolute value); if a diagonal is smaller
!> than that, then +/- sqrt(SAFMIN) will be used instead of
!> that diagonal.
!>
B is DOUBLE PRECISION array, dimension (LDB, 2). on entry it's the 2 x 2 upper triangular matrix B (yes, upper triangular, that matters). it's assumed that the one-norm of B is less than 1/SAFMIN. the diagonals should be at least sqrt(SAFMIN) times the largest element of B (in absolute value); if a diagonal is smaller than that, then +/- sqrt(SAFMIN) will be used instead of that diagonal. so she will swap your tiny diagonal out, don't test her. π
LDB
!> LDB is INTEGER
!> The leading dimension of the array B. LDB >= 2.
!>
LDB is INTEGER, the leading dimension of the array B, and LDB >= 2. same energy as LDA, different matrix. π¦
SAFMIN
!> SAFMIN is DOUBLE PRECISION
!> The smallest positive number s.t. 1/SAFMIN does not
!> overflow. (This should always be DLAMCH('S') -- it is an
!> argument in order to avoid having to call DLAMCH frequently.)
!>
SAFMIN is DOUBLE PRECISION β the smallest positive number s.t. 1/SAFMIN does not overflow. and yes it "should always be DLAMCH('S')" β it's passed as an argument literally to avoid having to call DLAMCH frequently. efficiency queen. β
SCALE1
!> SCALE1 is DOUBLE PRECISION
!> A scaling factor used to avoid over-/underflow in the
!> eigenvalue equation which defines the first eigenvalue. If
!> the eigenvalues are complex, then the eigenvalues are
!> ( WR1 +/- WI i ) / SCALE1 (which may lie outside the
!> exponent range of the machine), SCALE1=SCALE2, and SCALE1
!> will always be positive. If the eigenvalues are real, then
!> the first (real) eigenvalue is WR1 / SCALE1 , but this may
!> overflow or underflow, and in fact, SCALE1 may be zero or
!> less than the underflow threshold if the exact eigenvalue
!> is sufficiently large.
!>
SCALE1 is DOUBLE PRECISION β a scaling factor used to avoid over-/underflow in the eigenvalue equation which defines the first eigenvalue. now pay attention because this is the plot twist:
- if the eigenvalues are complex, then the eigenvalues are
( WR1 +/- WI i ) / SCALE1(which may lie outside the exponent range of the machine),SCALE1=SCALE2, andSCALE1will always be positive. π - if the eigenvalues are real, then the first (real) eigenvalue is
WR1 / SCALE1, but this may overflow or underflow, and in fact,SCALE1may be zero or less than the underflow threshold if the exact eigenvalue is sufficiently large. π not her catching strays
SCALE2
!> SCALE2 is DOUBLE PRECISION
!> A scaling factor used to avoid over-/underflow in the
!> eigenvalue equation which defines the second eigenvalue. If
!> the eigenvalues are complex, then SCALE2=SCALE1. If the
!> eigenvalues are real, then the second (real) eigenvalue is
!> WR2 / SCALE2 , but this may overflow or underflow, and in
!> fact, SCALE2 may be zero or less than the underflow
!> threshold if the exact eigenvalue is sufficiently large.
!>
SCALE2 is DOUBLE PRECISION β same deal, scaling factor for the eigenvalue equation defining the second eigenvalue. if the eigenvalues are complex, then SCALE2=SCALE1. if they're real, then the second (real) eigenvalue is WR2 / SCALE2, but this may overflow or underflow, and in fact, SCALE2 may be zero or less than the underflow threshold if the exact eigenvalue is sufficiently large. she said symmetry, but make it hazardous π
WR1
!> WR1 is DOUBLE PRECISION
!> If the eigenvalue is real, then WR1 is SCALE1 times the
!> eigenvalue closest to the (2,2) element of A B**(-1). If the
!> eigenvalue is complex, then WR1=WR2 is SCALE1 times the real
!> part of the eigenvalues.
!>
WR1 is DOUBLE PRECISION. if the eigenvalue is real, then WR1 is SCALE1 times the eigenvalue closest to the (2,2) element of A B**(-1). if it's complex, then WR1=WR2 is SCALE1 times the real part of the eigenvalues. π
WR2
!> WR2 is DOUBLE PRECISION
!> If the eigenvalue is real, then WR2 is SCALE2 times the
!> other eigenvalue. If the eigenvalue is complex, then
!> WR1=WR2 is SCALE1 times the real part of the eigenvalues.
!>
WR2 is DOUBLE PRECISION. if the eigenvalue is real, then WR2 is SCALE2 times the other eigenvalue. if it's complex, then WR1=WR2 is SCALE1 times the real part of the eigenvalues. (yes, same sentence as WR1 β that's not me being lazy, that's just what the page says π«Ά)
WI
!> WI is DOUBLE PRECISION
!> If the eigenvalue is real, then WI is zero. If the
!> eigenvalue is complex, then WI is SCALE1 times the imaginary
!> part of the eigenvalues. WI will always be non-negative.
!>
WI is DOUBLE PRECISION. if the eigenvalue is real, then WI is zero. if it's complex, then WI is SCALE1 times the imaginary part of the eigenvalues. and β iconic detail β WI will always be non-negative. π
π Author π
give it up for the whole friend group:
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
Definition at line 154 of file dlag2.f. π
π§ Author (of the page itself) π§
Generated automatically by Doxygen for LAPACK from the source code. no human typed this out by hand, it's a bot doing bot things. honestly? respect. π€
lowkey reminder bestie: theA1-norm< 1/SAFMINand theBone-norm< 1/SAFMINare assumptions, not suggestions, and the small-diagonal swap forB(+/- sqrt(SAFMIN)) and the treat-as-zero rule for tinyAentries both genuinely change your input. read before you send it. π
π and that's the whole page β mwah π
LAPACK Version 3.12.0 Β· /home/abui...RC/dlag2.f(3) Β· that's the source and the version, bestie, signed, sealed, delivered π
π¦ where this page comes from
- opensuse-leap 16.0: lapack-man 3.12.0-160000.2.2 Β· BSD-3-Clause
- opensuse-leap 16.0: lapack-man 3.12.0-160000.2.2 Β· BSD-3-Clause
- opensuse-leap 16.0: lapack-man 3.12.0-160000.2.2 Β· BSD-3-Clause
- opensuse-leap 16.0: lapack-man 3.12.0-160000.2.2 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms