CROTG(3)

๐Ÿ“ฆ version 3.12.0, in opensuse-leap 16.0

๐Ÿ’… 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 BLAS rot,
  • lartgp โ€” generate plane rotation, more accurate than BLAS rot

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