root / src / blas / srotg.f @ 2
Historique | Voir | Annoter | Télécharger (783 octet)
| 1 | 1 | pfleura2 | SUBROUTINE SROTG(SA,SB,C,S) |
|---|---|---|---|
| 2 | 1 | pfleura2 | * .. Scalar Arguments .. |
| 3 | 1 | pfleura2 | REAL C,S,SA,SB |
| 4 | 1 | pfleura2 | * .. |
| 5 | 1 | pfleura2 | * |
| 6 | 1 | pfleura2 | * Purpose |
| 7 | 1 | pfleura2 | * ======= |
| 8 | 1 | pfleura2 | * |
| 9 | 1 | pfleura2 | * construct givens plane rotation. |
| 10 | 1 | pfleura2 | * jack dongarra, linpack, 3/11/78. |
| 11 | 1 | pfleura2 | * |
| 12 | 1 | pfleura2 | * |
| 13 | 1 | pfleura2 | * .. Local Scalars .. |
| 14 | 1 | pfleura2 | REAL R,ROE,SCALE,Z |
| 15 | 1 | pfleura2 | * .. |
| 16 | 1 | pfleura2 | * .. Intrinsic Functions .. |
| 17 | 1 | pfleura2 | INTRINSIC ABS,SIGN,SQRT |
| 18 | 1 | pfleura2 | * .. |
| 19 | 1 | pfleura2 | ROE = SB |
| 20 | 1 | pfleura2 | IF (ABS(SA).GT.ABS(SB)) ROE = SA |
| 21 | 1 | pfleura2 | SCALE = ABS(SA) + ABS(SB) |
| 22 | 1 | pfleura2 | IF (SCALE.NE.0.0) GO TO 10 |
| 23 | 1 | pfleura2 | C = 1.0 |
| 24 | 1 | pfleura2 | S = 0.0 |
| 25 | 1 | pfleura2 | R = 0.0 |
| 26 | 1 | pfleura2 | Z = 0.0 |
| 27 | 1 | pfleura2 | GO TO 20 |
| 28 | 1 | pfleura2 | 10 R = SCALE*SQRT((SA/SCALE)**2+ (SB/SCALE)**2) |
| 29 | 1 | pfleura2 | R = SIGN(1.0,ROE)*R |
| 30 | 1 | pfleura2 | C = SA/R |
| 31 | 1 | pfleura2 | S = SB/R |
| 32 | 1 | pfleura2 | Z = 1.0 |
| 33 | 1 | pfleura2 | IF (ABS(SA).GT.ABS(SB)) Z = S |
| 34 | 1 | pfleura2 | IF (ABS(SB).GE.ABS(SA) .AND. C.NE.0.0) Z = 1.0/C |
| 35 | 1 | pfleura2 | 20 SA = R |
| 36 | 1 | pfleura2 | SB = Z |
| 37 | 1 | pfleura2 | RETURN |
| 38 | 1 | pfleura2 | END |