1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
|
*> \brief \b CROTG
*
* =========== DOCUMENTATION ===========
*
* Online html documentation available at
* http://www.netlib.org/lapack/explore-html/
*
* Definition
* ==========
*
* SUBROUTINE CROTG(CA,CB,C,S)
*
* .. Scalar Arguments ..
* COMPLEX CA,CB,S
* REAL C
* ..
*
* Purpose
* =======
*
*>\details \b Purpose:
*>\verbatim
*>
*> CROTG determines a complex Givens rotation.
*>
*>\endverbatim
*
* Authors
* =======
*
*> \author Univ. of Tennessee
*> \author Univ. of California Berkeley
*> \author Univ. of Colorado Denver
*> \author NAG Ltd.
*
*> \date November 2011
*
*> \ingroup complex_blas_level1
*
* =====================================================================
SUBROUTINE CROTG(CA,CB,C,S)
*
* -- Reference BLAS level1 routine (version 3.4.0) --
* -- Reference BLAS is a software package provided by Univ. of Tennessee, --
* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
* November 2011
*
* .. Scalar Arguments ..
COMPLEX CA,CB,S
REAL C
* ..
*
* =====================================================================
*
* .. Local Scalars ..
COMPLEX ALPHA
REAL NORM,SCALE
* ..
* .. Intrinsic Functions ..
INTRINSIC CABS,CONJG,SQRT
* ..
IF (CABS(CA).EQ.0.) THEN
C = 0.
S = (1.,0.)
CA = CB
ELSE
SCALE = CABS(CA) + CABS(CB)
NORM = SCALE*SQRT((CABS(CA/SCALE))**2+ (CABS(CB/SCALE))**2)
ALPHA = CA/CABS(CA)
C = CABS(CA)/NORM
S = ALPHA*CONJG(CB)/NORM
CA = ALPHA*NORM
END IF
RETURN
END
|