SRC/dlartg.f90(3)
SRC/dlartg.f90(3) π β¨
okay bestie, welcome to the Library Functions Manual β this page is SRC/dlartg.f90, and it's all about DLARTG doing plane-rotation math with real cosine and real sine. it's giving linear algebra main character energy. π«Ά
πΈ NAME πΈ
SRC/dlartg.f90 π
β¨ SYNOPSIS β¨
Functions/Subroutines
subroutine dlartg (f, g, c, s, r)βDLARTGgenerates a plane rotation with real cosine and real sine. π
subroutine dlartg (f, g, c, s, r)
DLARTG generates a plane rotation with real cosine and real sine.
π§ Function/Subroutine Documentation π§
subroutine dlartg (real(wp) f, real(wp) g, real(wp) c, real(wp) s, real(wp) r)
DLARTG generates a plane rotation with real cosine and real sine. periodt. π
Purpose
okay so DLARTG generates a plane rotation so that
[ C S ] . [ F ] = [ R ]
[ -S C ] [ G ] [ 0 ]
where C**2 + S**2 = 1. β¨
The mathematical formulas used for C and S are
R = sign(F) * sqrt(F**2 + G**2)
C = F / R
S = G / R
Hence C >= 0. The algorithm used to compute these quantities incorporates scaling to avoid overflow or underflow in computing the square root of the sum of squares. no cap, that's the safety bit. π
This version is discontinuous in R at F = 0 but it returns the same C and S as ZLARTG for complex inputs (F,0) and (G,0). π
This is a more accurate version of the BLAS1 routine DROTG, with the following other differences:
FandGare unchanged on return.- If
G=0, thenC=1andS=0. - If
F=0and (G .ne. 0), thenC=0andS=sign(1,G)without doing any floating point operations (saves work inDBDSQRwhen there are zeros on the diagonal). π
Below, wp=>dp stands for double precision from LA_CONSTANTS module. π«Ά
Parameters
FβF is REAL(wp); the first component of vector to be rotated. πGβG is REAL(wp); the second component of vector to be rotated. πΈCβC is REAL(wp); the cosine of the rotation. πSβS is REAL(wp); the sine of the rotation. π¦RβR is REAL(wp); the nonzero component of the rotated vector. β
Author
Edward Anderson, Lockheed Martin π
Date
July 2016 ποΈ
Contributors
Weslley Pereira, University of Colorado Denver, USA π
Further Details
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 110 of file dlartg.f90. π
π Author π
Generated automatically by Doxygen for LAPACK from the source code. π€
that's the whole page, bestie β mwah π this is LAPACK, Version 3.12.0, page SRC/dlartg.f90(3), and the doc date is July 2016. go rotate something cute. ππ¦
π¦ 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