CROTG(3)
๐ CROTG(3) โ Library Functions Manual โจ
okay bestie, buckle up ๐ซถ this is the CROTG page straight outta the Library Functions Manual, and it's genuinely iconic. we're doing Givens rotations today and you're gonna slay it, no cap.
๐ NAME
/home/abuild/rpmbuild/BUILD/lapack-static-3.12.0-build/lapack-3.12.0/BLAS/SRC/crotg.f90
like yes, that's the whole name, it's giving "full government name at the DMV" energy but that's literally what the page says ๐
๐ธ SYNOPSIS
Functions/Subroutines
subroutine CROTG (a, b, c, 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. that's the whole vibe, bestie ๐
โจ Purpose
okay so here's what it actually does โ CROTG constructs a plane rotation, and the way it looks is:
!> CROTG constructs a plane rotation
!> [ 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.
!>
!>
like, the math is mathing ๐งฎโจ and the c is real, s is complex, and c**2 + conjg(s)*s = 1 โ that's the whole personality of this rotation.
๐ See also
lartgโ generate plane rotation, more accurate than BLASrot,lartgpโ generate plane rotation, more accurate than BLASrot
ngl if you need the more accurate one, the LARTG girlies have you covered ๐
๐ Parameters
A
!> A is COMPLEX
!> On entry, the scalar a.
!> On exit, the scalar r.
!>
so A goes in as a and comes out as r โ it's giving main character transformation arc, we love a glow-up ๐ฆ
B
!> B is COMPLEX
!> The scalar b.
!>
C
!> C is REAL
!> The scalar c.
!>
S
!> S is COMPLEX
!> The scalar s.
!>
๐ Author
Weslley Pereira, University of Colorado Denver, USA โ periodt, thank you Weslley ๐ซถ
๐ 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
!>
!>
so it's built on Anderson E. (2017), "Algorithm 978: Safe Scaling in the Level 1 BLAS", ACM Trans Math Softw 44:1--28, over at https://doi.org/10.1145/3061665 โ cite your sources bestie, it's the law ๐๐
Definition at line 88 of file crotg.f90.
๐ Author
Generated automatically by Doxygen for LAPACK from the source code. not me being auto-generated ๐ the robots did this one, I'm just the messenger โจ
and that's the whole page!! ๐ the footer says this is LAPACK, Version 3.12.0, dated /home/abui...C/crotg.f90(3) โ so yeah, that's the source/version/date sign-off, mwah, go rotate some planes responsibly ๐๐ธ๐ฅ
๐ฆ 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