lag2(3)
π lag2 β ok bestie, this is the 2x2 eig situation
so like. the name of this whole page is lag2 (short for "2x2 eig", which is honestly the most iconique abbreviation ever), and it lives in section 3 of the Library Functions Manual. it's a LAPACK thing. buckle up, we're doing linear algebra π
β¨ SYNOPSIS β¨
π«Ά Functions
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. (double precision version, she's the β¨ premium β¨ one)subroutine slag2 (a, lda, b, ldb, safmin, scale1, scale2, wr1, wr2, wi)β SLAG2 computes the eigenvalues of a 2-by-2 generalized eigenvalue problem, with scaling as necessary to avoid over-/underflow. (single precision twin sister, same energy πΈ)
π¦ Detailed Description
okay so this is the part where the docs just introduce the two subroutines and then go off on each one in full detail. it's giving very much main character energy. scroll down, we got you π
π Function 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)
DLAG2 computes the eigenvalues of a 2-by-2 generalized eigenvalue problem, with scaling as necessary to avoid over-/underflow.
β Purpose:
!>
!> 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.
!>
like. the whole point is she computes eigenvalues, but the extra part is she scales everything first so nothing overflows or underflows on her watch. literally the group project member who does the work π
π Parameters
- A β !>
AisDOUBLE PRECISIONarray, dimension(LDA, 2). On entry, the 2 x 2 matrix A. It is assumed that its 1-norm is less than1/SAFMIN. Entries less thansqrt(SAFMIN)*norm(A)are subject to being treated as zero. - LDA β !>
LDAisINTEGER. The leading dimension of the array A.LDA >= 2. - B β !>
BisDOUBLE PRECISIONarray, dimension(LDB, 2). On entry, the 2 x 2 upper triangular matrix B. It is assumed that the one-norm of B is less than1/SAFMIN. The diagonals should be at leastsqrt(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. - LDB β !>
LDBisINTEGER. The leading dimension of the array B.LDB >= 2. - SAFMIN β !>
SAFMINisDOUBLE PRECISION. The smallest positive number s.t.1/SAFMINdoes not overflow. (This should always beDLAMCH('S')-- it is an argument in order to avoid having to call DLAMCH frequently.) - SCALE1 β !>
SCALE1isDOUBLE 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, andSCALE1will always be positive. If the eigenvalues are real, then the first (real) eigenvalue isWR1 / 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. - SCALE2 β !>
SCALE2isDOUBLE PRECISION. A scaling factor used to avoid over-/underflow in the eigenvalue equation which defines the second eigenvalue. If the eigenvalues are complex, thenSCALE2=SCALE1. If the eigenvalues are real, then the second (real) eigenvalue isWR2 / SCALE2, but this may overflow or underflow, and in fact,SCALE2may be zero or less than the underflow threshold if the exact eigenvalue is sufficiently large. - WR1 β !>
WR1isDOUBLE PRECISION. If the eigenvalue is real, thenWR1isSCALE1times the eigenvalue closest to the(2,2)element ofA B**(-1). If the eigenvalue is complex, thenWR1=WR2isSCALE1times the real part of the eigenvalues. - WR2 β !>
WR2isDOUBLE PRECISION. If the eigenvalue is real, thenWR2isSCALE2times the other eigenvalue. If the eigenvalue is complex, thenWR1=WR2isSCALE1times the real part of the eigenvalues. - WI β !>
WIisDOUBLE PRECISION. If the eigenvalue is real, thenWIis zero. If the eigenvalue is complex, thenWIisSCALE1times the imaginary part of the eigenvalues.WIwill always be non-negative.
π«Ά real talk:SCALE1/SCALE2can genuinely be zero or fall below the underflow threshold when the exact eigenvalue is big enough. that's not a bug, that's just how the math goes, bestie. don't come for her.
π Author
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
Definition at line 154 of file dlag2.f.
π§ subroutine slag2 (real, dimension( lda, * ) a, integer lda, real, dimension( ldb, * ) b, integer ldb, real safmin, real scale1, real scale2, real wr1, real wr2, real wi)
SLAG2 computes the eigenvalues of a 2-by-2 generalized eigenvalue problem, with scaling as necessary to avoid over-/underflow.
β Purpose:
!>
!> SLAG2 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.
!>
same purpose, same s A - w B flex, just in REAL instead of DOUBLE PRECISION. she ate and left no crumbs β¨
π Parameters
- A β !>
AisREALarray, dimension(LDA, 2). On entry, the 2 x 2 matrix A. It is assumed that its 1-norm is less than1/SAFMIN. Entries less thansqrt(SAFMIN)*norm(A)are subject to being treated as zero. - LDA β !>
LDAisINTEGER. The leading dimension of the array A.LDA >= 2. - B β !>
BisREALarray, dimension(LDB, 2). On entry, the 2 x 2 upper triangular matrix B. It is assumed that the one-norm of B is less than1/SAFMIN. The diagonals should be at leastsqrt(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. - LDB β !>
LDBisINTEGER. The leading dimension of the array B.LDB >= 2. - SAFMIN β !>
SAFMINisREAL. The smallest positive number s.t.1/SAFMINdoes not overflow. (This should always beSLAMCH('S')-- it is an argument in order to avoid having to call SLAMCH frequently.) - SCALE1 β !>
SCALE1isREAL. 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, andSCALE1will always be positive. If the eigenvalues are real, then the first (real) eigenvalue isWR1 / 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. - SCALE2 β !>
SCALE2isREAL. A scaling factor used to avoid over-/underflow in the eigenvalue equation which defines the second eigenvalue. If the eigenvalues are complex, thenSCALE2=SCALE1. If the eigenvalues are real, then the second (real) eigenvalue isWR2 / SCALE2, but this may overflow or underflow, and in fact,SCALE2may be zero or less than the underflow threshold if the exact eigenvalue is sufficiently large. - WR1 β !>
WR1isREAL. If the eigenvalue is real, thenWR1isSCALE1times the eigenvalue closest to the(2,2)element ofA B**(-1). If the eigenvalue is complex, thenWR1=WR2isSCALE1times the real part of the eigenvalues. - WR2 β !>
WR2isREAL. If the eigenvalue is real, thenWR2isSCALE2times the other eigenvalue. If the eigenvalue is complex, thenWR1=WR2isSCALE1times the real part of the eigenvalues. - WI β !>
WIisREAL. If the eigenvalue is real, thenWIis zero. If the eigenvalue is complex, thenWIisSCALE1times the imaginary part of the eigenvalues.WIwill always be non-negative.
π literally same caveat as her double-precision sister: the scales can hit zero or dip under the underflow threshold. it's giving "feature, not bug."
π Author
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
Definition at line 154 of file slag2.f.
πΈ Author
Generated automatically by Doxygen for LAPACK from the source code. (so nobody hand-wrote this bad boy, the robots did it π«‘)
and that's the whole page bestie!! LAPACK, Version 3.12.0 β that's the version and the date-stamp vibe, straight from the footer. mwah, go compute some eigenvalues, ily π π
π¦ 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