BLAS/SRC/crotg.f90(3)
π NAME
Okay bestie, this is the BLAS/SRC/crotg.f90 page from the Library Functions Manual, and itβs all about crotg β the BLAS subroutine that builds a Givens rotation with a real cosine and a complex sine. β¨
π SYNOPSIS
Functions/Subroutines
subroutine crotg (a, b, c, s)β CROTG generates a Givens rotation with real cosine and complex sine.
Hereβs the full signature, exactly as promised:
subroutine crotg (complex(wp) a, complex(wp) b, real(wp) c, complex(wp) s)
CROTG generates a Givens rotation with real cosine and complex sine. π«Ά
π Function/Subroutine Documentation
subroutine crotg (complex(wp) a, complex(wp) b, real(wp) c, complex(wp) s)
CROTG generates a Givens rotation with real cosine and complex sine.
β¨ Purpose
Okay so CROTG constructs a plane rotation, and the matrix situation is literally this:
[ c s ] [ a ] = [ r ]
[ -conjg(s) c ] [ b ] [ 0 ]
where c is real, s is complex, and c**2 + conjg(s)*s = 1.
The computation uses the formulas:
|x| = sqrt( Re(x)**2 + Im(x)**2 )
sgn(x) = x / |x| if x /= 0
= 1 if x = 0
c = |a| / sqrt(|a|**2 + |b|**2)
s = sgn(a) * conjg(b) / sqrt(|a|**2 + |b|**2)
r = sgn(a)*sqrt(|a|**2 + |b|**2)
When a and b are real and r /= 0, the formulas simplify to:
c = a / r
s = b / r
the same as in SROTG when |a| > |b|. When |b| >= |a|, the sign of c and s will be different from those computed by SROTG if the signs of a and b are not the same.
π See also
lartgβ generate plane rotation, more accurate than BLASrot,lartgpβ generate plane rotation, more accurate than BLASrot
π§ Parameters
AβA is COMPLEX. On entry, the scalara. On exit, the scalarr.BβB is COMPLEX. The scalarb.CβC is REAL. The scalarc.SβS is COMPLEX. The scalars.
π 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 88 of file crotg.f90.
π Author
Generated automatically by Doxygen for LAPACK from the source code.
Thatβs the whole page, bestie β final source/version vibe: LAPACK, Version 3.12.0, page BLAS/SRC/crotg.f90(3), with the function dated December 2021. Mwah πβ¨
π¦ 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