public interface lartg
LARTG generates a plane rotation so that
[ C S ] . [ F ] = [ R ]
[ -conjg(S) C ] [ G ] [ 0 ]
where C is real and C2 + |S|2 = 1.
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)
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 LARTG.
The algorithm used to compute these quantities incorporates scaling
to avoid overflow or underflow in computing the square root of the
sum of squares.
This is a faster version of the BLAS1 routine CROTG, except for
the following differences:
F and G are unchanged on return.
If G=0, then C=1 and S=0.
If F=0, then C=0 and S is chosen so that R is real.
Below, wp=>sp stands for single precision from LA_CONSTANTS module.
Subroutines
Arguments
| Type |
Intent | Optional | Attributes |
|
Name |
|
|
complex(kind=sp),
|
intent(in) |
|
|
:: |
f |
|
|
complex(kind=sp),
|
intent(in) |
|
|
:: |
g |
|
|
real(kind=sp),
|
intent(out) |
|
|
:: |
c |
|
|
complex(kind=sp),
|
intent(out) |
|
|
:: |
s |
|
|
complex(kind=sp),
|
intent(out) |
|
|
:: |
r |
|
Arguments
| Type |
Intent | Optional | Attributes |
|
Name |
|
|
real(kind=dp),
|
intent(in) |
|
|
:: |
f |
|
|
real(kind=dp),
|
intent(in) |
|
|
:: |
g |
|
|
real(kind=dp),
|
intent(out) |
|
|
:: |
c |
|
|
real(kind=dp),
|
intent(out) |
|
|
:: |
s |
|
|
real(kind=dp),
|
intent(out) |
|
|
:: |
r |
|
Arguments
| Type |
Intent | Optional | Attributes |
|
Name |
|
|
real(kind=sp),
|
intent(in) |
|
|
:: |
f |
|
|
real(kind=sp),
|
intent(in) |
|
|
:: |
g |
|
|
real(kind=sp),
|
intent(out) |
|
|
:: |
c |
|
|
real(kind=sp),
|
intent(out) |
|
|
:: |
s |
|
|
real(kind=sp),
|
intent(out) |
|
|
:: |
r |
|
Arguments
| Type |
Intent | Optional | Attributes |
|
Name |
|
|
complex(kind=dp),
|
intent(in) |
|
|
:: |
f |
|
|
complex(kind=dp),
|
intent(in) |
|
|
:: |
g |
|
|
real(kind=dp),
|
intent(out) |
|
|
:: |
c |
|
|
complex(kind=dp),
|
intent(out) |
|
|
:: |
s |
|
|
complex(kind=dp),
|
intent(out) |
|
|
:: |
r |
|
Module Procedures