ZLARTG(3)
π ZLARTG(3) π
okay bestie, welcome to the Library Functions Manual page for ZLARTG. We're gonna make this rotation routine make sense, no cap. β¨
β¨ NAME β¨
The NAME tea is literally this path, character for character:
/home/abuild/rpmbuild/BUILD/lapack-static-3.12.0-build/lapack-3.12.0/SRC/zlartg.f90
β¨ SYNOPSIS β¨
Functions/Subroutines
Functions/Subroutines
subroutine ZLARTG (f, g, c, s, r)
ZLARTG generates a plane rotation with real cosine and complex sine.
π¦ Function/Subroutine Documentation π¦
subroutine ZLARTG (complex(wp) f, complex(wp) g, real(wp) c, complex(wp) s, complex(wp) r)
ZLARTG generates a plane rotation with real cosine and complex sine. That's the whole vibe. π«
β¨ Purpose β¨
okay so the main character moment: ZLARTG generates a plane rotation so that
[ C S ] . [ F ] = [ R ]
[ -conjg(S) C ] [ G ] [ 0 ]
where C is real and C**2 + |S|**2 = 1.
The mathematical formulas used for C and S are
sgn(x) = { x / |x|, x != 0
{ 1, x = 0
R = sgn(F) * sqrt(|F|**2 + |G|**2)
C = |F| / sqrt(|F|**2 + |G|**2)
S = sgn(F) * conjg(G) / sqrt(|F|**2 + |G|**2)
Special conditions, bestie:
- If
G=0, thenC=1andS=0. - If
F=0, thenC=0andSis chosen so thatRis real.
When F and G are real, the formulas simplify to C = F/R and S = G/R, and the returned values of C, S, and R should be identical to those returned by DLARTG.
The algorithm used to compute these quantities incorporates scaling to avoid overflow or underflow in computing the square root of the sum of squares. Safety first, always. π
This is the same routine ZROTG fom BLAS1, except that F and G are unchanged on return.
Below, wp=>dp stands for double precision from LA_CONSTANTS module.
π Parameters π
FβF is COMPLEX(wp). The first component of vector to be rotated.GβG is COMPLEX(wp). The second component of vector to be rotated.CβC is REAL(wp). The cosine of the rotation.SβS is COMPLEX(wp). The sine of the rotation.RβR is COMPLEX(wp). The nonzero component of the rotated vector.
πΈ Author πΈ
Weslley Pereira, University of Colorado Denver, USA
π Date π
December 2021
β Further Details β
Based on the algorithm from
Anderson E. (2017)
Algorithm 978: Safe Scaling in the Level 1 BLAS
ACM Trans Math Softw 44:1--28
https://doi.org/10.1145/3061665
Definition at line 115 of file zlartg.f90.
π Author π
Generated automatically by Doxygen for LAPACK from the source code.
mwah π this page is sourced from LAPACK Version 3.12.0, dated December 2021, and the file is /home/abui.../zlartg.f90(3). Byeee π«Ά
π¦ 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