LAPACK  3.9.1
LAPACK: Linear Algebra PACKage

◆ crotg()

subroutine crotg ( complex  CA,
complex  CB,
real  C,
complex  S 
)

CROTG

Purpose:
 CROTG determines a complex Givens rotation.
Parameters
[in,out]CA
          CA is COMPLEX
[in]CB
          CB is COMPLEX
[out]C
          C is REAL
[out]S
          S is COMPLEX
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.

Definition at line 61 of file crotg.f.

62 *
63 * -- Reference BLAS level1 routine --
64 * -- Reference BLAS is a software package provided by Univ. of Tennessee, --
65 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
66 *
67 * .. Scalar Arguments ..
68  COMPLEX CA,CB,S
69  REAL C
70 * ..
71 *
72 * =====================================================================
73 *
74 * .. Local Scalars ..
75  COMPLEX ALPHA
76  REAL NORM,SCALE
77 * ..
78 * .. Intrinsic Functions ..
79  INTRINSIC cabs,conjg,sqrt
80 * ..
81  IF (cabs(ca).EQ.0.) THEN
82  c = 0.
83  s = (1.,0.)
84  ca = cb
85  ELSE
86  scale = cabs(ca) + cabs(cb)
87  norm = scale*sqrt((cabs(ca/scale))**2+ (cabs(cb/scale))**2)
88  alpha = ca/cabs(ca)
89  c = cabs(ca)/norm
90  s = alpha*conjg(cb)/norm
91  ca = alpha*norm
92  END IF
93  RETURN
Here is the caller graph for this function: