LAPACK  3.8.0
LAPACK: Linear Algebra PACKage

◆ srotm()

subroutine srotm ( integer  N,
real, dimension(*)  SX,
integer  INCX,
real, dimension(*)  SY,
integer  INCY,
real, dimension(5)  SPARAM 
)

SROTM

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

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

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

    SFLAG=-1.E0     SFLAG=0.E0        SFLAG=1.E0     SFLAG=-2.E0

      (SH11  SH12)    (1.E0  SH12)    (SH11  1.E0)    (1.E0  0.E0)
    H=(          )    (          )    (          )    (          )
      (SH21  SH22),   (SH21  1.E0),   (-1.E0 SH22),   (0.E0  1.E0).
    SEE  SROTMG FOR A DESCRIPTION OF DATA STORAGE IN SPARAM.
Parameters
[in]N
          N is INTEGER
         number of elements in input vector(s)
[in,out]SX
          SX is REAL array, dimension ( 1 + ( N - 1 )*abs( INCX ) )
[in]INCX
          INCX is INTEGER
         storage spacing between elements of SX
[in,out]SY
          SY is REAL array, dimension ( 1 + ( N - 1 )*abs( INCY ) )
[in]INCY
          INCY is INTEGER
         storage spacing between elements of SY
[in]SPARAM
          SPARAM is REAL array, dimension (5)
     SPARAM(1)=SFLAG
     SPARAM(2)=SH11
     SPARAM(3)=SH21
     SPARAM(4)=SH12
     SPARAM(5)=SH22
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Date
November 2017

Definition at line 99 of file srotm.f.

99 *
100 * -- Reference BLAS level1 routine (version 3.8.0) --
101 * -- Reference BLAS is a software package provided by Univ. of Tennessee, --
102 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
103 * November 2017
104 *
105 * .. Scalar Arguments ..
106  INTEGER incx,incy,n
107 * ..
108 * .. Array Arguments ..
109  REAL sparam(5),sx(*),sy(*)
110 * ..
111 *
112 * =====================================================================
113 *
114 * .. Local Scalars ..
115  REAL sflag,sh11,sh12,sh21,sh22,two,w,z,zero
116  INTEGER i,kx,ky,nsteps
117 * ..
118 * .. Data statements ..
119  DATA zero,two/0.e0,2.e0/
120 * ..
121 *
122  sflag = sparam(1)
123  IF (n.LE.0 .OR. (sflag+two.EQ.zero)) RETURN
124  IF (incx.EQ.incy.AND.incx.GT.0) THEN
125 *
126  nsteps = n*incx
127  IF (sflag.LT.zero) THEN
128  sh11 = sparam(2)
129  sh12 = sparam(4)
130  sh21 = sparam(3)
131  sh22 = sparam(5)
132  DO i = 1,nsteps,incx
133  w = sx(i)
134  z = sy(i)
135  sx(i) = w*sh11 + z*sh12
136  sy(i) = w*sh21 + z*sh22
137  END DO
138  ELSE IF (sflag.EQ.zero) THEN
139  sh12 = sparam(4)
140  sh21 = sparam(3)
141  DO i = 1,nsteps,incx
142  w = sx(i)
143  z = sy(i)
144  sx(i) = w + z*sh12
145  sy(i) = w*sh21 + z
146  END DO
147  ELSE
148  sh11 = sparam(2)
149  sh22 = sparam(5)
150  DO i = 1,nsteps,incx
151  w = sx(i)
152  z = sy(i)
153  sx(i) = w*sh11 + z
154  sy(i) = -w + sh22*z
155  END DO
156  END IF
157  ELSE
158  kx = 1
159  ky = 1
160  IF (incx.LT.0) kx = 1 + (1-n)*incx
161  IF (incy.LT.0) ky = 1 + (1-n)*incy
162 *
163  IF (sflag.LT.zero) THEN
164  sh11 = sparam(2)
165  sh12 = sparam(4)
166  sh21 = sparam(3)
167  sh22 = sparam(5)
168  DO i = 1,n
169  w = sx(kx)
170  z = sy(ky)
171  sx(kx) = w*sh11 + z*sh12
172  sy(ky) = w*sh21 + z*sh22
173  kx = kx + incx
174  ky = ky + incy
175  END DO
176  ELSE IF (sflag.EQ.zero) THEN
177  sh12 = sparam(4)
178  sh21 = sparam(3)
179  DO i = 1,n
180  w = sx(kx)
181  z = sy(ky)
182  sx(kx) = w + z*sh12
183  sy(ky) = w*sh21 + z
184  kx = kx + incx
185  ky = ky + incy
186  END DO
187  ELSE
188  sh11 = sparam(2)
189  sh22 = sparam(5)
190  DO i = 1,n
191  w = sx(kx)
192  z = sy(ky)
193  sx(kx) = w*sh11 + z
194  sy(ky) = -w + sh22*z
195  kx = kx + incx
196  ky = ky + incy
197  END DO
198  END IF
199  END IF
200  RETURN
Here is the caller graph for this function: