rotg(3)
β¨ NAME β¨
rotg β bestie, this is rotg: it generates a plane rotation (cf. lartg). That's the whole assignment, and it ate. π«
π SYNOPSIS π
Functions πΈ
subroutine crotg (a, b, c, s)β CROTG generates a Givens rotation with real cosine and complex sine.subroutine drotg (a, b, c, s)β DROTGsubroutine srotg (a, b, c, s)β SROTGsubroutine zrotg (a, b, c, s)β ZROTG generates a Givens rotation with real cosine and complex sine.
π Detailed Description π
Okay so the original page literally leaves this section empty β no cap, there is nothing under "Detailed Description." All the actual tea is in Function Documentation below, so keep scrolling bestie π«Ά
π₯ Function 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. Iconic behavior honestly.
Purpose:
!>
!> 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.
!>
!>
See also π
lartg: generate plane rotation, more accurate than BLASrotlartgp: generate plane rotation, more accurate than BLASrot
Parameters π―
- A β
A is COMPLEX. On entry, the scalar a. On exit, the scalar r. - 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
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.
π subroutine drotg (real(wp) a, real(wp) b, real(wp) c, real(wp) s)
DROTG. That's it, that's the description β short and mysterious, main character energy fr fr.
Purpose:
!>
!> DROTG constructs a plane rotation
!> [ c s ] [ a ] = [ r ]
!> [ -s c ] [ b ] [ 0 ]
!> satisfying c**2 + s**2 = 1.
!>
!> The computation uses the formulas
!> sigma = sgn(a) if |a| > |b|
!> = sgn(b) if |b| >= |a|
!> r = sigma*sqrt( a**2 + b**2 )
!> c = 1; s = 0 if r = 0
!> c = a/r; s = b/r if r != 0
!> The subroutine also computes
!> z = s if |a| > |b|,
!> = 1/c if |b| >= |a| and c != 0
!> = 1 if c = 0
!> This allows c and s to be reconstructed from z as follows:
!> If z = 1, set c = 0, s = 1.
!> If |z| < 1, set c = sqrt(1 - z**2) and s = z.
!> If |z| > 1, set c = 1/z and s = sqrt( 1 - c**2).
!>
!>
See also π
lartg: generate plane rotation, more accurate than BLASrotlartgp: generate plane rotation, more accurate than BLASrot
Parameters π―
- A β
A is DOUBLE PRECISION. On entry, the scalar a. On exit, the scalar r. - B β
B is DOUBLE PRECISION. On entry, the scalar b. On exit, the scalar z. - C β
C is DOUBLE PRECISION. The scalar c. - S β
S is DOUBLE PRECISION. The scalar s.
Author βοΈ
Edward Anderson, Lockheed Martin
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 91 of file drotg.f90.
π¦ subroutine srotg (real(wp) a, real(wp) b, real(wp) c, real(wp) s)
SROTG. Also just vibes in the description field. Slay.
Purpose:
!>
!> SROTG constructs a plane rotation
!> [ c s ] [ a ] = [ r ]
!> [ -s c ] [ b ] [ 0 ]
!> satisfying c**2 + s**2 = 1.
!>
!> The computation uses the formulas
!> sigma = sgn(a) if |a| > |b|
!> = sgn(b) if |b| >= |a|
!> r = sigma*sqrt( a**2 + b**2 )
!> c = 1; s = 0 if r = 0
!> c = a/r; s = b/r if r != 0
!> The subroutine also computes
!> z = s if |a| > |b|,
!> = 1/c if |b| >= |a| and c != 0
!> = 1 if c = 0
!> This allows c and s to be reconstructed from z as follows:
!> If z = 1, set c = 0, s = 1.
!> If |z| < 1, set c = sqrt(1 - z**2) and s = z.
!> If |z| > 1, set c = 1/z and s = sqrt( 1 - c**2).
!>
!>
See also π
lartg: generate plane rotation, more accurate than BLASrotlartgp: generate plane rotation, more accurate than BLASrot
Parameters π―
- A β
A is REAL. On entry, the scalar a. On exit, the scalar r. - B β
B is REAL. On entry, the scalar b. On exit, the scalar z. - C β
C is REAL. The scalar c. - S β
S is REAL. The scalar s.
Author βοΈ
Edward Anderson, Lockheed Martin
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 91 of file srotg.f90.
π subroutine zrotg (complex(wp) a, complex(wp) b, real(wp) c, complex(wp) s)
ZROTG generates a Givens rotation with real cosine and complex sine. The complex one. Obsessed.
Purpose:
!>
!> ZROTG 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 DROTG when |a| > |b|. When |b| >= |a|, the
!> sign of c and s will be different from those computed by DROTG
!> if the signs of a and b are not the same.
!>
!>
See also π
lartg: generate plane rotation, more accurate than BLASrotlartgp: generate plane rotation, more accurate than BLASrot
Parameters π―
- A β
A is DOUBLE COMPLEX. On entry, the scalar a. On exit, the scalar r. - B β
B is DOUBLE COMPLEX. The scalar b. - C β
C is DOUBLE PRECISION. The scalar c. - S β
S is DOUBLE COMPLEX. The scalar s.
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 zrotg.f90.
π Author π
Generated automatically by Doxygen for LAPACK from the source code.
π that's the whole page bestie, go forth and rotate those planes π
Sign-off time, and it's giving official: this iconic little document is LAPACK, Version 3.12.0, rotg(3) β mwah, no notes, periodt πβ¨
π¦ 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