Constructs Givens plane rotation.
BLAS Library (libblas.a)
Given vectors A and B, the SROTG, DROTG, CROTG, or ZROTG subroutine computes:
A B
a = ---------, b = ---------
|A| + |B| |A| + |B|
2 2 1/2
roe = { a if |A| > |B| } r = roe ( a + b ),
{ b if |B| >= |A| }
C = { A/r if r not = 0} S = { B/r if r not = 0 }
{ 1 if r = 0 } { 0 if r = 0 }
The numbers C, S, and r then satisfy the matrix equation:
--- --- --- --- --- ---
| C S | | A | | r |
| | . | | = | |
| -S C | | B | | 0 |
--- --- --- --- --- ---
The subroutines also compute:
{ S if |A| > |B|,
z = { 1/C if |B| >= |A| and C not = 0,
{ 1 if C = 0.
The subroutines return r overwriting A and z overwriting B, as well as returning C and S.
Item | Description |
---|---|
A | On entry, contains a scalar constant; on exit, contains the value r. |
B | On entry, contains a scalar constant; on exit, contains the value z. |
C | Can contain any value on entry; the value C returned on exit. |
S | Can contain any value on entry; the value S returned on exit. |