LAPACK  3.8.0
LAPACK: Linear Algebra PACKage

◆ 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.
Date
November 2017
Further Details:
     jack dongarra, linpack, 3/11/78.
     modified 12/3/93, array(1) declarations changed to array(*)

Definition at line 94 of file srot.f.

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