LAPACK  3.6.1
LAPACK: Linear Algebra PACKage
subroutine crotg ( complex  CA,
complex  CB,
real  C,
complex  S 
)

CROTG

Purpose:
 CROTG determines a complex Givens rotation.
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Date
November 2011

Definition at line 41 of file crotg.f.

41 *
42 * -- Reference BLAS level1 routine (version 3.4.0) --
43 * -- Reference BLAS is a software package provided by Univ. of Tennessee, --
44 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
45 * November 2011
46 *
47 * .. Scalar Arguments ..
48  COMPLEX ca,cb,s
49  REAL c
50 * ..
51 *
52 * =====================================================================
53 *
54 * .. Local Scalars ..
55  COMPLEX alpha
56  REAL norm,scale
57 * ..
58 * .. Intrinsic Functions ..
59  INTRINSIC cabs,conjg,sqrt
60 * ..
61  IF (cabs(ca).EQ.0.) THEN
62  c = 0.
63  s = (1.,0.)
64  ca = cb
65  ELSE
66  scale = cabs(ca) + cabs(cb)
67  norm = scale*sqrt((cabs(ca/scale))**2+ (cabs(cb/scale))**2)
68  alpha = ca/cabs(ca)
69  c = cabs(ca)/norm
70  s = alpha*conjg(cb)/norm
71  ca = alpha*norm
72  END IF
73  RETURN

Here is the caller graph for this function: