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

◆ srot()

subroutine srot ( integer  n,
real, dimension(*)  sx,
integer  incx,
real, dimension(*)  sy,
integer  incy,
real  c,
real  s 
)

SROT

Purpose:
    applies a plane rotation.
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]C
          C is REAL
[in]S
          S is REAL
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Further Details:
     jack dongarra, linpack, 3/11/78.
     modified 12/3/93, array(1) declarations changed to array(*)

Definition at line 91 of file srot.f.

92*
93* -- Reference BLAS level1 routine --
94* -- Reference BLAS is a software package provided by Univ. of Tennessee, --
95* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
96*
97* .. Scalar Arguments ..
98 REAL C,S
99 INTEGER INCX,INCY,N
100* ..
101* .. Array Arguments ..
102 REAL SX(*),SY(*)
103* ..
104*
105* =====================================================================
106*
107* .. Local Scalars ..
108 REAL STEMP
109 INTEGER I,IX,IY
110* ..
111 IF (n.LE.0) RETURN
112 IF (incx.EQ.1 .AND. incy.EQ.1) THEN
113*
114* code for both increments equal to 1
115*
116 DO i = 1,n
117 stemp = c*sx(i) + s*sy(i)
118 sy(i) = c*sy(i) - s*sx(i)
119 sx(i) = stemp
120 END DO
121 ELSE
122*
123* code for unequal increments or equal increments not equal
124* to 1
125*
126 ix = 1
127 iy = 1
128 IF (incx.LT.0) ix = (-n+1)*incx + 1
129 IF (incy.LT.0) iy = (-n+1)*incy + 1
130 DO i = 1,n
131 stemp = c*sx(ix) + s*sy(iy)
132 sy(iy) = c*sy(iy) - s*sx(ix)
133 sx(ix) = stemp
134 ix = ix + incx
135 iy = iy + incy
136 END DO
137 END IF
138 RETURN
139*
140* End of SROT
141*
Here is the caller graph for this function: