LAPACK  3.8.0 LAPACK: Linear Algebra PACKage
drot.f
Go to the documentation of this file.
1 *> \brief \b DROT
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 DROT(N,DX,INCX,DY,INCY,C,S)
12 *
13 * .. Scalar Arguments ..
14 * DOUBLE PRECISION C,S
15 * INTEGER INCX,INCY,N
16 * ..
17 * .. Array Arguments ..
18 * DOUBLE PRECISION DX(*),DY(*)
19 * ..
20 *
21 *
22 *> \par Purpose:
23 * =============
24 *>
25 *> \verbatim
26 *>
27 *> DROT 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] DX
40 *> \verbatim
41 *> DX is DOUBLE PRECISION 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 DX
48 *> \endverbatim
49 *>
50 *> \param[in,out] DY
51 *> \verbatim
52 *> DY is DOUBLE PRECISION 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 DY
59 *> \endverbatim
60 *>
61 *> \param[in] C
62 *> \verbatim
63 *> C is DOUBLE PRECISION
64 *> \endverbatim
65 *>
66 *> \param[in] S
67 *> \verbatim
68 *> S is DOUBLE PRECISION
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 double_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 drot(N,DX,INCX,DY,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  DOUBLE PRECISION C,S
102  INTEGER INCX,INCY,N
103 * ..
104 * .. Array Arguments ..
105  DOUBLE PRECISION DX(*),DY(*)
106 * ..
107 *
108 * =====================================================================
109 *
110 * .. Local Scalars ..
111  DOUBLE PRECISION DTEMP
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  dtemp = c*dx(i) + s*dy(i)
121  dy(i) = c*dy(i) - s*dx(i)
122  dx(i) = dtemp
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  dtemp = c*dx(ix) + s*dy(iy)
135  dy(iy) = c*dy(iy) - s*dx(ix)
136  dx(ix) = dtemp
137  ix = ix + incx
138  iy = iy + incy
139  END DO
140  END IF
141  RETURN
142  END
subroutine drot(N, DX, INCX, DY, INCY, C, S)
DROT
Definition: drot.f:94