LAPACK 3.12.0 LAPACK: Linear Algebra PACKage
Searching...
No Matches
srot.f
Go to the documentation of this file.
1*> \brief \b SROT
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 SROT(N,SX,INCX,SY,INCY,C,S)
12*
13* .. Scalar Arguments ..
14* REAL C,S
15* INTEGER INCX,INCY,N
16* ..
17* .. Array Arguments ..
18* REAL SX(*),SY(*)
19* ..
20*
21*
22*> \par Purpose:
23* =============
24*>
25*> \verbatim
26*>
27*> applies a plane rotation.
28*> \endverbatim
29*
30* Arguments:
31* ==========
32*
33*> \param[in] N
34*> \verbatim
35*> N is INTEGER
36*> number of elements in input vector(s)
37*> \endverbatim
38*>
39*> \param[in,out] SX
40*> \verbatim
41*> SX is REAL array, dimension ( 1 + ( N - 1 )*abs( INCX ) )
42*> \endverbatim
43*>
44*> \param[in] INCX
45*> \verbatim
46*> INCX is INTEGER
47*> storage spacing between elements of SX
48*> \endverbatim
49*>
50*> \param[in,out] SY
51*> \verbatim
52*> SY is REAL array, dimension ( 1 + ( N - 1 )*abs( INCY ) )
53*> \endverbatim
54*>
55*> \param[in] INCY
56*> \verbatim
57*> INCY is INTEGER
58*> storage spacing between elements of SY
59*> \endverbatim
60*>
61*> \param[in] C
62*> \verbatim
63*> C is REAL
64*> \endverbatim
65*>
66*> \param[in] S
67*> \verbatim
68*> S is REAL
69*> \endverbatim
70*
71* Authors:
72* ========
73*
74*> \author Univ. of Tennessee
75*> \author Univ. of California Berkeley
76*> \author Univ. of Colorado Denver
77*> \author NAG Ltd.
78*
79*> \ingroup rot
80*
81*> \par Further Details:
82* =====================
83*>
84*> \verbatim
85*>
86*> jack dongarra, linpack, 3/11/78.
87*> modified 12/3/93, array(1) declarations changed to array(*)
88*> \endverbatim
89*>
90* =====================================================================
91 SUBROUTINE srot(N,SX,INCX,SY,INCY,C,S)
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*
142 END
subroutine srot(n, sx, incx, sy, incy, c, s)
SROT
Definition srot.f:92