1+ ! > \brief \b CROT applies a plane rotation with real cosine and complex sine to a pair of complex vectors.
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 CROT( N, X, INCX, Y, INCY, C, S )
12+ !
13+ ! .. Scalar Arguments ..
14+ ! INTEGER INCX, INCY, N
15+ ! REAL C
16+ ! COMPLEX S
17+ ! ..
18+ ! .. Array Arguments ..
19+ ! COMPLEX X( * ), Y( * )
20+ ! ..
21+ !
22+ !
23+ ! > \par Purpose:
24+ ! =============
25+ ! >
26+ ! > \verbatim
27+ ! >
28+ ! > CROT applies a plane rotation to vectors x and y:
29+ ! >
30+ ! > [ c s ] [ x(1) x(2) ... x(n) ]
31+ ! > [ -conjg(s) c ] [ y(1) y(2) ... y(n) ]
32+ ! >
33+ ! > where c is real, s is complex, and c**2 + conjg(s)*s = 1.
34+ ! >
35+ ! > \endverbatim
36+ !
37+ ! Arguments:
38+ ! ==========
39+ !
40+ ! > \param[in] N
41+ ! > \verbatim
42+ ! > N is INTEGER
43+ ! > The number of elements in the vectors X and Y.
44+ ! > \endverbatim
45+ ! >
46+ ! > \param[in,out] X
47+ ! > \verbatim
48+ ! > X is COMPLEX array, dimension (N)
49+ ! > On input, the vector X.
50+ ! > On output, X is overwritten with C*X + S*Y.
51+ ! > \endverbatim
52+ ! >
53+ ! > \param[in] INCX
54+ ! > \verbatim
55+ ! > INCX is INTEGER
56+ ! > The increment between successive values of X. INCX <> 0.
57+ ! > \endverbatim
58+ ! >
59+ ! > \param[in,out] Y
60+ ! > \verbatim
61+ ! > Y is COMPLEX array, dimension (N)
62+ ! > On input, the vector Y.
63+ ! > On output, Y is overwritten with -CONJG(S)*X + C*Y.
64+ ! > \endverbatim
65+ ! >
66+ ! > \param[in] INCY
67+ ! > \verbatim
68+ ! > INCY is INTEGER
69+ ! > The increment between successive values of Y. INCX <> 0.
70+ ! > \endverbatim
71+ ! >
72+ ! > \param[in] C
73+ ! > \verbatim
74+ ! > C is REAL
75+ ! > \endverbatim
76+ ! >
77+ ! > \param[in] S
78+ ! > \verbatim
79+ ! > S is COMPLEX
80+ ! > \endverbatim
81+ !
82+ ! Authors:
83+ ! ========
84+ !
85+ ! > \author Edward Anderson, Lockheed Martin
86+ !
87+ ! > \date August 2016
88+ !
89+ ! > \ingroup complexOTHERauxiliary
90+ !
91+ ! > \par Contributors:
92+ ! ==================
93+ ! >
94+ ! > Weslley Pereira, University of Colorado Denver, USA
95+ !
96+ ! > \par Further Details:
97+ ! =====================
98+ ! >
99+ ! > \verbatim
100+ ! >
101+ ! > Anderson E. (2017)
102+ ! > Algorithm 978: Safe Scaling in the Level 1 BLAS
103+ ! > ACM Trans Math Softw 44:1--28
104+ ! > https://doi.org/10.1145/3061665
105+ ! >
106+ ! > \endverbatim
107+ !
108+ ! =====================================================================
1109subroutine CROT ( n , x , incx , y , incy , c , s )
2110 use LA_CONSTANTS32, only: wp
3111!
4- ! Updated Level 1 BLAS
5- ! E. Anderson
6- ! August 11, 2016
112+ ! -- LAPACK auxiliary routine (version 3.10.0) --
113+ ! -- LAPACK is a software package provided by Univ. of Tennessee, --
114+ ! -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
115+ ! March 2021
7116!
8117! .. Scalar Arguments ..
9118 integer :: incx, incy, n
@@ -13,49 +122,6 @@ subroutine CROT( n, x, incx, y, incy, c, s )
13122! .. Array Arguments ..
14123 complex (wp) :: x(* ), y(* )
15124! ..
16- !
17- ! Purpose
18- ! =======
19- !
20- ! CROT applies a plane rotation to vectors x and y:
21- !
22- ! [ c s ] [ x(1) x(2) ... x(n) ]
23- ! [ -conjg(s) c ] [ y(1) y(2) ... y(n) ]
24- !
25- ! where c is real, s is complex, and c**2 + conjg(s)*s = 1.
26- !
27- ! Arguments
28- ! =========
29- !
30- ! N (input) INTEGER
31- ! The number of elements of the vectors x and y.
32- !
33- ! X (input/output) COMPLEX array, dimension (1+(N-1)*abs(INCX))
34- ! On entry, the n-element vector x.
35- ! On exit, the vector sum c*x + s*y.
36- !
37- ! INCX (input) INTEGER
38- ! The increment between successive values of the vector x.
39- ! If INCX >= 0, X(1+(i-1)*INCX) = x(i) for 1 <= i <= n
40- ! If INCX < 0, X(1-(n-i)*INCX) = x(i) for 1 <= i <= n
41- !
42- ! Y (input/output) COMPLEX array, dimension (1+(N-1)*abs(INCY))
43- ! On entry, the n-element vector y.
44- ! On exit, the vector sum -conjg(s)*x + c*y.
45- !
46- ! INCY (input) INTEGER
47- ! The increment between successive values of the vector y.
48- ! If INCY >= 0, Y(1+(i-1)*INCY) = y(i) for 1 <= i <= n
49- ! If INCY < 0, Y(1-(n-i)*INCY) = y(i) for 1 <= i <= n
50- !
51- ! C (input) REAL
52- ! The scalar c.
53- !
54- ! S (input) COMPLEX
55- ! The scalar s.
56- !
57- ! =====================================================================
58- !
59125! .. Local Scalars ..
60126 integer :: i, ix, iy
61127 complex (wp) :: stmp
0 commit comments