Line | |
---|
1 | SUBROUTINE CROTG(CA,CB,C,S) |
---|
2 | * .. Scalar Arguments .. |
---|
3 | COMPLEX CA,CB,S |
---|
4 | REAL C |
---|
5 | * .. |
---|
6 | * |
---|
7 | * Purpose |
---|
8 | * ======= |
---|
9 | * |
---|
10 | * CROTG determines a complex Givens rotation. |
---|
11 | * |
---|
12 | * .. Local Scalars .. |
---|
13 | COMPLEX ALPHA |
---|
14 | REAL NORM,SCALE |
---|
15 | * .. |
---|
16 | * .. Intrinsic Functions .. |
---|
17 | INTRINSIC CABS,CONJG,SQRT |
---|
18 | * .. |
---|
19 | IF (CABS(CA).NE.0.) GO TO 10 |
---|
20 | C = 0. |
---|
21 | S = (1.,0.) |
---|
22 | CA = CB |
---|
23 | GO TO 20 |
---|
24 | 10 CONTINUE |
---|
25 | SCALE = CABS(CA) + CABS(CB) |
---|
26 | NORM = SCALE*SQRT((CABS(CA/SCALE))**2+ (CABS(CB/SCALE))**2) |
---|
27 | ALPHA = CA/CABS(CA) |
---|
28 | C = CABS(CA)/NORM |
---|
29 | S = ALPHA*CONJG(CB)/NORM |
---|
30 | CA = ALPHA*NORM |
---|
31 | 20 CONTINUE |
---|
32 | RETURN |
---|
33 | END |
---|
Note: See
TracBrowser
for help on using the repository browser.