1 SUBROUTINE DROTM
(N
,DX
,INCX
,DY
,INCY
,DPARAM
)
2 * .. Scalar Arguments
..
5 * .. Array Arguments
..
6 DOUBLE PRECISION DPARAM
(5),DX
(*),DY
(*)
12 * APPLY THE MODIFIED GIVENS TRANSFORMATION
, H
, TO THE
2 BY N MATRIX
14 * (DX**T
) , WHERE
**T INDICATES TRANSPOSE
. THE ELEMENTS OF DX ARE IN
17 * DX
(LX
+I*INCX
), I
= 0 TO N
-1, WHERE LX
= 1 IF INCX
.GE
. 0, ELSE
18 * LX
= (-INCX
)*N
, AND SIMILARLY
FOR SY USING LY AND INCY
.
19 * WITH DPARAM
(1)=DFLAG
, H HAS ONE OF THE FOLLOWING FORMS
..
21 * DFLAG
=-1.D0 DFLAG
=0.D0 DFLAG
=1.D0 DFLAG
=-2.D0
23 * (DH11 DH12
) (1.D0 DH12
) (DH11
1.D0
) (1.D0
0.D0
)
25 * (DH21 DH22
), (DH21
1.D0
), (-1.D0 DH22
), (0.D0
1.D0
).
26 * SEE DROTMG
FOR A DESCRIPTION OF DATA STORAGE IN DPARAM
.
32 * number of elements in input vector
(s
)
34 * DX
(input
/output
) DOUBLE PRECISION array
, dimension N
35 * double precision vector with N elements
37 * INCX
(input
) INTEGER
38 * storage spacing between elements of DX
40 * DY
(input
/output
) DOUBLE PRECISION array
, dimension N
41 * double precision vector with N elements
43 * INCY
(input
) INTEGER
44 * storage spacing between elements of DY
46 * DPARAM
(input
/output
) DOUBLE PRECISION array
, dimension 5
53 * =====================================================================
56 DOUBLE PRECISION DFLAG
,DH11
,DH12
,DH21
,DH22
,TWO
,W
,Z
,ZERO
57 INTEGER I
,KX
,KY
,NSTEPS
59 * .. Data statements
..
60 DATA ZERO
,TWO
/0.D0
,2.D0
/
64 IF (N
.LE
.0 .OR
. (DFLAG
+TWO
.EQ
.ZERO
)) GO TO 140
65 IF (.NOT
. (INCX
.EQ
.INCY
.AND
.INCX
.GT
.0)) GO TO 70
72 DO 20 I
= 1,NSTEPS
,INCX
82 DO 40 I
= 1,NSTEPS
,INCX
94 DO 60 I
= 1,NSTEPS
,INCX
97 DX
(I
) = W*DH11
+ Z*DH12
98 DY
(I
) = W*DH21
+ Z*DH22
104 IF (INCX
.LT
.0) KX
= 1 + (1-N
)*INCX
105 IF (INCY
.LT
.0) KY
= 1 + (1-N
)*INCY
107 IF (DFLAG
) 120,80,100
140 DX
(KX
) = W*DH11
+ Z*DH12
141 DY
(KY
) = W*DH21
+ Z*DH22