LAPACK  3.9.0
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]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.
Date
November 2017

Definition at line 64 of file crotg.f.

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