LAPACK 3.12.0
LAPACK: Linear Algebra PACKage
Loading...
Searching...
No Matches

◆ drotm()

subroutine drotm ( integer  n,
double precision, dimension(*)  dx,
integer  incx,
double precision, dimension(*)  dy,
integer  incy,
double precision, dimension(5)  dparam 
)

DROTM

Purpose:
    APPLY THE MODIFIED GIVENS TRANSFORMATION, H, TO THE 2 BY N MATRIX

    (DX**T) , WHERE **T INDICATES TRANSPOSE. THE ELEMENTS OF DX ARE IN
    (DY**T)

    DX(LX+I*INCX), I = 0 TO N-1, WHERE LX = 1 IF INCX .GE. 0, ELSE
    LX = (-INCX)*N, AND SIMILARLY FOR SY USING LY AND INCY.
    WITH DPARAM(1)=DFLAG, H HAS ONE OF THE FOLLOWING FORMS..

    DFLAG=-1.D0     DFLAG=0.D0        DFLAG=1.D0     DFLAG=-2.D0

      (DH11  DH12)    (1.D0  DH12)    (DH11  1.D0)    (1.D0  0.D0)
    H=(          )    (          )    (          )    (          )
      (DH21  DH22),   (DH21  1.D0),   (-1.D0 DH22),   (0.D0  1.D0).
    SEE DROTMG FOR A DESCRIPTION OF DATA STORAGE IN DPARAM.
Parameters
[in]N
          N is INTEGER
         number of elements in input vector(s)
[in,out]DX
          DX is DOUBLE PRECISION array, dimension ( 1 + ( N - 1 )*abs( INCX ) )
[in]INCX
          INCX is INTEGER
         storage spacing between elements of DX
[in,out]DY
          DY is DOUBLE PRECISION array, dimension ( 1 + ( N - 1 )*abs( INCY ) )
[in]INCY
          INCY is INTEGER
         storage spacing between elements of DY
[in]DPARAM
          DPARAM is DOUBLE PRECISION array, dimension (5)
     DPARAM(1)=DFLAG
     DPARAM(2)=DH11
     DPARAM(3)=DH21
     DPARAM(4)=DH12
     DPARAM(5)=DH22
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.

Definition at line 95 of file drotm.f.

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*
Here is the caller graph for this function: