1 SUBROUTINE SROTMG
(SD1
,SD2
,SX1
,SY1
,SPARAM
)
2 * .. Scalar Arguments
..
5 * .. Array Arguments
..
12 * CONSTRUCT THE MODIFIED GIVENS TRANSFORMATION MATRIX H WHICH ZEROS
13 * THE SECOND COMPONENT OF THE
2-VECTOR
(SQRT
(SD1
)*SX1
,SQRT
(SD2
)*
15 * WITH SPARAM
(1)=SFLAG
, H HAS ONE OF THE FOLLOWING FORMS
..
17 * SFLAG
=-1.E0 SFLAG
=0.E0 SFLAG
=1.E0 SFLAG
=-2.E0
19 * (SH11 SH12
) (1.E0 SH12
) (SH11
1.E0
) (1.E0
0.E0
)
21 * (SH21 SH22
), (SH21
1.E0
), (-1.E0 SH22
), (0.E0
1.E0
).
22 * LOCATIONS
2-4 OF SPARAM CONTAIN SH11
,SH21
,SH12
, AND SH22
23 * RESPECTIVELY
. (VALUES OF
1.E0
, -1.E0
, OR
0.E0 IMPLIED BY THE
24 * VALUE OF SPARAM
(1) ARE NOT STORED IN SPARAM
.)
26 * THE VALUES OF GAMSQ AND RGAMSQ SET IN THE DATA STATEMENT MAY BE
27 * INEXACT
. THIS IS OK AS THEY ARE ONLY USED
FOR TESTING THE SIZE
28 * OF SD1 AND SD2
. ALL ACTUAL SCALING OF DATA IS DONE USING GAM
.
35 * SD1
(input
/output
) REAL
37 * SD2
(input
/output
) REAL
39 * SX1
(input
/output
) REAL
44 * SPARAM
(input
/output
) REAL array
, dimension 5
51 * =====================================================================
54 REAL GAM
,GAMSQ
,ONE
,RGAMSQ
,SFLAG
,SH11
,SH12
,SH21
,SH22
,SP1
,SP2
,SQ1
,
55 + SQ2
,STEMP
,SU
,TWO
,ZERO
58 * .. Intrinsic Functions
..
61 * .. Data statements
..
63 DATA ZERO
,ONE
,TWO
/0.E0
,1.E0
,2.E0
/
64 DATA GAM
,GAMSQ
,RGAMSQ
/4096.E0
,1.67772E7
,5.96046E-8/
67 IF (.NOT
.SD1
.LT
.ZERO
) GO TO 10
68 * GO ZERO
-H
-D
-AND
-SX1
..
71 * CASE
-SD1
-NONNEGATIVE
73 IF (.NOT
.SP2
.EQ
.ZERO
) GO TO 20
82 IF (.NOT
.ABS
(SQ1
).GT
.ABS
(SQ2
)) GO TO 40
88 IF (.NOT
.SU
.LE
.ZERO
) GO TO 30
89 * GO ZERO
-H
-D
-AND
-SX1
..
99 IF (.NOT
.SQ2
.LT
.ZERO
) GO TO 50
100 * GO ZERO
-H
-D
-AND
-SX1
..
113 * PROCEDURE
..ZERO
-H
-D
-AND
-SX1
..
128 IF (.NOT
.SFLAG
.GE
.ZERO
) GO TO 90
130 IF (.NOT
.SFLAG
.EQ
.ZERO
) GO TO 80
140 GO TO IGO
(120,150,180,210)
141 * PROCEDURE
..SCALE
-CHECK
144 IF (.NOT
.SD1
.LE
.RGAMSQ
) GO TO 130
145 IF (SD1
.EQ
.ZERO
) GO TO 160
157 IF (.NOT
.SD1
.GE
.GAMSQ
) GO TO 160
169 IF (.NOT
.ABS
(SD2
).LE
.RGAMSQ
) GO TO 190
170 IF (SD2
.EQ
.ZERO
) GO TO 220
181 IF (.NOT
.ABS
(SD2
).GE
.GAMSQ
) GO TO 220
191 IF (SFLAG
) 250,230,240