SRC/zlartg.f90(3)

πŸ“¦
version 3.12.1 Β· 3 versions
, in arch rolling

πŸ’– SRC/zlartg.f90(3) πŸ’–

okay bestie, you're on the SRC/zlartg.f90(3) page from the Library Functions Manual, and it's all about one iconic little subroutine. Let's get into it. 🫢


🌸 NAME 🌸

SRC/zlartg.f90 β€” yep, that's the file, bestie. This page is literally the manual for that source file's zlartg routine.


✨ SYNOPSIS ✨

🧩 Functions/Subroutines 🧩

  • subroutine zlartg (f, g, c, s, r) β€” ZLARTG generates a plane rotation with real cosine and complex sine.

πŸ› οΈ Function/Subroutine Documentation πŸ› οΈ

subroutine zlartg (complex(wp) f, complex(wp) g, real(wp) c, complex(wp) s,
    complex(wp) r)

ZLARTG generates a plane rotation with real cosine and complex sine. πŸ’…

🎯 Purpose:

okay so the whole point is generating a plane rotation so that:

   [  C         S  ] . [ F ]  =  [ R ]
   [ -conjg(S)  C  ]   [ G ]     [ 0 ]

where C is real and C**2 + |S|**2 = 1. no cap, that's the vibe. ✨

The mathematical formulas used for C and S are:

   sgn(x) = {  x / |x|,   x != 0
            {  1,         x  = 0

   R = sgn(F) * sqrt(|F|**2 + |G|**2)

   C = |F| / sqrt(|F|**2 + |G|**2)

   S = sgn(F) * conjg(G) / sqrt(|F|**2 + |G|**2)

Special conditions, bestie:

  • If G=0, then C=1 and S=0.
  • If F=0, then C=0 and S is chosen so that R is real.

When F and G are real, the formulas simplify to C = F/R and S = G/R, and the returned values of C, S, and R should be identical to those returned by DLARTG. πŸŽ€

The algorithm used to compute these quantities incorporates scaling to avoid overflow or underflow in computing the square root of the sum of squares. safe scaling icon behavior, we love to see it. πŸ”₯

This is the same routine ZROTG fom BLAS1, except that F and G are unchanged on return.

Below, wp=>dp stands for double precision from LA_CONSTANTS module. 🧚

🧸 Parameters

  • F β€” F is COMPLEX(wp): the first component of vector to be rotated.
  • G β€” G is COMPLEX(wp): the second component of vector to be rotated.
  • C β€” C is REAL(wp): the cosine of the rotation.
  • S β€” S is COMPLEX(wp): the sine of the rotation.
  • R β€” R is COMPLEX(wp): the nonzero component of the rotated vector.

πŸ‘‘ 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 115 of file zlartg.f90.

πŸ€– Author

Generated automatically by Doxygen for LAPACK from the source code.


mwah πŸ’‹ that's the whole page, bestie β€” LAPACK Version 3.12.0, source page SRC/zlartg.f90(3), with a December 2021 date stamp. πŸ’…βœ¨

πŸ“¦ where this page comes from