LAPACK  3.9.0
LAPACK: Linear Algebra PACKage
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 *> \date November 2017
80 *
81 *> \ingroup single_blas_level1
82 *
83 *> \par Further Details:
84 * =====================
85 *>
86 *> \verbatim
87 *>
88 *> jack dongarra, linpack, 3/11/78.
89 *> modified 12/3/93, array(1) declarations changed to array(*)
90 *> \endverbatim
91 *>
92 * =====================================================================
93  SUBROUTINE srot(N,SX,INCX,SY,INCY,C,S)
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
142  END
srot
subroutine srot(N, SX, INCX, SY, INCY, C, S)
SROT
Definition: srot.f:94