LAPACK 3.11.0 LAPACK: Linear Algebra PACKage
Searching...
No Matches
drotm.f
Go to the documentation of this file.
1*> \brief \b DROTM
2*
3* =========== DOCUMENTATION ===========
4*
5* Online html documentation available at
6* http://www.netlib.org/lapack/explore-html/
7*
8* Definition:
9* ===========
10*
11* SUBROUTINE DROTM(N,DX,INCX,DY,INCY,DPARAM)
12*
13* .. Scalar Arguments ..
14* INTEGER INCX,INCY,N
15* ..
16* .. Array Arguments ..
17* DOUBLE PRECISION DPARAM(5),DX(*),DY(*)
18* ..
19*
20*
21*> \par Purpose:
22* =============
23*>
24*> \verbatim
25*>
26*> APPLY THE MODIFIED GIVENS TRANSFORMATION, H, TO THE 2 BY N MATRIX
27*>
28*> (DX**T) , WHERE **T INDICATES TRANSPOSE. THE ELEMENTS OF DX ARE IN
29*> (DY**T)
30*>
31*> DX(LX+I*INCX), I = 0 TO N-1, WHERE LX = 1 IF INCX .GE. 0, ELSE
32*> LX = (-INCX)*N, AND SIMILARLY FOR SY USING LY AND INCY.
33*> WITH DPARAM(1)=DFLAG, H HAS ONE OF THE FOLLOWING FORMS..
34*>
35*> DFLAG=-1.D0 DFLAG=0.D0 DFLAG=1.D0 DFLAG=-2.D0
36*>
37*> (DH11 DH12) (1.D0 DH12) (DH11 1.D0) (1.D0 0.D0)
38*> H=( ) ( ) ( ) ( )
39*> (DH21 DH22), (DH21 1.D0), (-1.D0 DH22), (0.D0 1.D0).
40*> SEE DROTMG FOR A DESCRIPTION OF DATA STORAGE IN DPARAM.
41*> \endverbatim
42*
43* Arguments:
44* ==========
45*
46*> \param[in] N
47*> \verbatim
48*> N is INTEGER
49*> number of elements in input vector(s)
50*> \endverbatim
51*>
52*> \param[in,out] DX
53*> \verbatim
54*> DX is DOUBLE PRECISION array, dimension ( 1 + ( N - 1 )*abs( INCX ) )
55*> \endverbatim
56*>
57*> \param[in] INCX
58*> \verbatim
59*> INCX is INTEGER
60*> storage spacing between elements of DX
61*> \endverbatim
62*>
63*> \param[in,out] DY
64*> \verbatim
65*> DY is DOUBLE PRECISION array, dimension ( 1 + ( N - 1 )*abs( INCY ) )
66*> \endverbatim
67*>
68*> \param[in] INCY
69*> \verbatim
70*> INCY is INTEGER
71*> storage spacing between elements of DY
72*> \endverbatim
73*>
74*> \param[in] DPARAM
75*> \verbatim
76*> DPARAM is DOUBLE PRECISION array, dimension (5)
77*> DPARAM(1)=DFLAG
78*> DPARAM(2)=DH11
79*> DPARAM(3)=DH21
80*> DPARAM(4)=DH12
81*> DPARAM(5)=DH22
82*> \endverbatim
83*
84* Authors:
85* ========
86*
87*> \author Univ. of Tennessee
88*> \author Univ. of California Berkeley
89*> \author Univ. of Colorado Denver
90*> \author NAG Ltd.
91*
92*> \ingroup double_blas_level1
93*
94* =====================================================================
95 SUBROUTINE drotm(N,DX,INCX,DY,INCY,DPARAM)
96*
97* -- Reference BLAS level1 routine --
98* -- Reference BLAS is a software package provided by Univ. of Tennessee, --
99* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
100*
101* .. Scalar Arguments ..
102 INTEGER INCX,INCY,N
103* ..
104* .. Array Arguments ..
105 DOUBLE PRECISION DPARAM(5),DX(*),DY(*)
106* ..
107*
108* =====================================================================
109*
110* .. Local Scalars ..
111 DOUBLE PRECISION DFLAG,DH11,DH12,DH21,DH22,TWO,W,Z,ZERO
112 INTEGER I,KX,KY,NSTEPS
113* ..
114* .. Data statements ..
115 DATA zero,two/0.d0,2.d0/
116* ..
117*
118 dflag = dparam(1)
119 IF (n.LE.0 .OR. (dflag+two.EQ.zero)) RETURN
120 IF (incx.EQ.incy.AND.incx.GT.0) THEN
121*
122 nsteps = n*incx
123 IF (dflag.LT.zero) THEN
124 dh11 = dparam(2)
125 dh12 = dparam(4)
126 dh21 = dparam(3)
127 dh22 = dparam(5)
128 DO i = 1,nsteps,incx
129 w = dx(i)
130 z = dy(i)
131 dx(i) = w*dh11 + z*dh12
132 dy(i) = w*dh21 + z*dh22
133 END DO
134 ELSE IF (dflag.EQ.zero) THEN
135 dh12 = dparam(4)
136 dh21 = dparam(3)
137 DO i = 1,nsteps,incx
138 w = dx(i)
139 z = dy(i)
140 dx(i) = w + z*dh12
141 dy(i) = w*dh21 + z
142 END DO
143 ELSE
144 dh11 = dparam(2)
145 dh22 = dparam(5)
146 DO i = 1,nsteps,incx
147 w = dx(i)
148 z = dy(i)
149 dx(i) = w*dh11 + z
150 dy(i) = -w + dh22*z
151 END DO
152 END IF
153 ELSE
154 kx = 1
155 ky = 1
156 IF (incx.LT.0) kx = 1 + (1-n)*incx
157 IF (incy.LT.0) ky = 1 + (1-n)*incy
158*
159 IF (dflag.LT.zero) THEN
160 dh11 = dparam(2)
161 dh12 = dparam(4)
162 dh21 = dparam(3)
163 dh22 = dparam(5)
164 DO i = 1,n
165 w = dx(kx)
166 z = dy(ky)
167 dx(kx) = w*dh11 + z*dh12
168 dy(ky) = w*dh21 + z*dh22
169 kx = kx + incx
170 ky = ky + incy
171 END DO
172 ELSE IF (dflag.EQ.zero) THEN
173 dh12 = dparam(4)
174 dh21 = dparam(3)
175 DO i = 1,n
176 w = dx(kx)
177 z = dy(ky)
178 dx(kx) = w + z*dh12
179 dy(ky) = w*dh21 + z
180 kx = kx + incx
181 ky = ky + incy
182 END DO
183 ELSE
184 dh11 = dparam(2)
185 dh22 = dparam(5)
186 DO i = 1,n
187 w = dx(kx)
188 z = dy(ky)
189 dx(kx) = w*dh11 + z
190 dy(ky) = -w + dh22*z
191 kx = kx + incx
192 ky = ky + incy
193 END DO
194 END IF
195 END IF
196 RETURN
197*
198* End of DROTM
199*
200 END
subroutine drotm(N, DX, INCX, DY, INCY, DPARAM)
DROTM
Definition: drotm.f:96