1 SUBROUTINE DROTMG
(DD1
,DD2
,DX1
,DY1
,DPARAM
)
2 * .. Scalar Arguments
..
3 DOUBLE PRECISION DD1
,DD2
,DX1
,DY1
5 * .. Array Arguments
..
6 DOUBLE PRECISION DPARAM
(5)
12 * CONSTRUCT THE MODIFIED GIVENS TRANSFORMATION MATRIX H WHICH ZEROS
13 * THE SECOND COMPONENT OF THE
2-VECTOR
(DSQRT
(DD1
)*DX1
,DSQRT
(DD2
)*
15 * WITH DPARAM
(1)=DFLAG
, H HAS ONE OF THE FOLLOWING FORMS
..
17 * DFLAG
=-1.D0 DFLAG
=0.D0 DFLAG
=1.D0 DFLAG
=-2.D0
19 * (DH11 DH12
) (1.D0 DH12
) (DH11
1.D0
) (1.D0
0.D0
)
21 * (DH21 DH22
), (DH21
1.D0
), (-1.D0 DH22
), (0.D0
1.D0
).
22 * LOCATIONS
2-4 OF DPARAM CONTAIN DH11
, DH21
, DH12
, AND DH22
23 * RESPECTIVELY
. (VALUES OF
1.D0
, -1.D0
, OR
0.D0 IMPLIED BY THE
24 * VALUE OF DPARAM
(1) ARE NOT STORED IN DPARAM
.)
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 DD1 AND DD2
. ALL ACTUAL SCALING OF DATA IS DONE USING GAM
.
34 * DD1
(input
/output
) DOUBLE PRECISION
36 * DD2
(input
/output
) DOUBLE PRECISION
38 * DX1
(input
/output
) DOUBLE PRECISION
40 * DY1
(input
) DOUBLE PRECISION
42 * DPARAM
(input
/output
) DOUBLE PRECISION array
, dimension 5
49 * =====================================================================
52 DOUBLE PRECISION DFLAG
,DH11
,DH12
,DH21
,DH22
,DP1
,DP2
,DQ1
,DQ2
,DTEMP
,
53 + DU
,GAM
,GAMSQ
,ONE
,RGAMSQ
,TWO
,ZERO
56 * .. Intrinsic Functions
..
59 * .. Data statements
..
61 DATA ZERO
,ONE
,TWO
/0.D0
,1.D0
,2.D0
/
62 DATA GAM
,GAMSQ
,RGAMSQ
/4096.D0
,16777216.D0
,5.9604645D
-8/
65 IF (.NOT
.DD1
.LT
.ZERO
) GO TO 10
66 * GO ZERO
-H
-D
-AND
-DX1
..
69 * CASE
-DD1
-NONNEGATIVE
71 IF (.NOT
.DP2
.EQ
.ZERO
) GO TO 20
80 IF (.NOT
.DABS
(DQ1
).GT
.DABS
(DQ2
)) GO TO 40
86 IF (.NOT
.DU
.LE
.ZERO
) GO TO 30
87 * GO ZERO
-H
-D
-AND
-DX1
..
97 IF (.NOT
.DQ2
.LT
.ZERO
) GO TO 50
98 * GO ZERO
-H
-D
-AND
-DX1
..
111 * PROCEDURE
..ZERO
-H
-D
-AND
-DX1
..
126 IF (.NOT
.DFLAG
.GE
.ZERO
) GO TO 90
128 IF (.NOT
.DFLAG
.EQ
.ZERO
) GO TO 80
138 GO TO IGO
(120,150,180,210)
139 * PROCEDURE
..SCALE
-CHECK
142 IF (.NOT
.DD1
.LE
.RGAMSQ
) GO TO 130
143 IF (DD1
.EQ
.ZERO
) GO TO 160
155 IF (.NOT
.DD1
.GE
.GAMSQ
) GO TO 160
167 IF (.NOT
.DABS
(DD2
).LE
.RGAMSQ
) GO TO 190
168 IF (DD2
.EQ
.ZERO
) GO TO 220
179 IF (.NOT
.DABS
(DD2
).GE
.GAMSQ
) GO TO 220
189 IF (DFLAG
) 250,230,240