LAPACK 3.12.1
LAPACK: Linear Algebra PACKage
Loading...
Searching...
No Matches
csyr.f
Go to the documentation of this file.
1*> \brief \b CSYR performs the symmetric rank-1 update of a complex symmetric matrix.
2*
3* =========== DOCUMENTATION ===========
4*
5* Online html documentation available at
6* http://www.netlib.org/lapack/explore-html/
7*
8*> Download CSYR + dependencies
9*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/csyr.f">
10*> [TGZ]</a>
11*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/csyr.f">
12*> [ZIP]</a>
13*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/csyr.f">
14*> [TXT]</a>
15*
16* Definition:
17* ===========
18*
19* SUBROUTINE CSYR( UPLO, N, ALPHA, X, INCX, A, LDA )
20*
21* .. Scalar Arguments ..
22* CHARACTER UPLO
23* INTEGER INCX, LDA, N
24* COMPLEX ALPHA
25* ..
26* .. Array Arguments ..
27* COMPLEX A( LDA, * ), X( * )
28* ..
29*
30*
31*> \par Purpose:
32* =============
33*>
34*> \verbatim
35*>
36*> CSYR performs the symmetric rank 1 operation
37*>
38*> A := alpha*x*x**H + A,
39*>
40*> where alpha is a complex scalar, x is an n element vector and A is an
41*> n by n symmetric matrix.
42*> \endverbatim
43*
44* Arguments:
45* ==========
46*
47*> \param[in] UPLO
48*> \verbatim
49*> UPLO is CHARACTER*1
50*> On entry, UPLO specifies whether the upper or lower
51*> triangular part of the array A is to be referenced as
52*> follows:
53*>
54*> UPLO = 'U' or 'u' Only the upper triangular part of A
55*> is to be referenced.
56*>
57*> UPLO = 'L' or 'l' Only the lower triangular part of A
58*> is to be referenced.
59*>
60*> Unchanged on exit.
61*> \endverbatim
62*>
63*> \param[in] N
64*> \verbatim
65*> N is INTEGER
66*> On entry, N specifies the order of the matrix A.
67*> N must be at least zero.
68*> Unchanged on exit.
69*> \endverbatim
70*>
71*> \param[in] ALPHA
72*> \verbatim
73*> ALPHA is COMPLEX
74*> On entry, ALPHA specifies the scalar alpha.
75*> Unchanged on exit.
76*> \endverbatim
77*>
78*> \param[in] X
79*> \verbatim
80*> X is COMPLEX array, dimension at least
81*> ( 1 + ( N - 1 )*abs( INCX ) ).
82*> Before entry, the incremented array X must contain the N-
83*> element vector x.
84*> Unchanged on exit.
85*> \endverbatim
86*>
87*> \param[in] INCX
88*> \verbatim
89*> INCX is INTEGER
90*> On entry, INCX specifies the increment for the elements of
91*> X. INCX must not be zero.
92*> Unchanged on exit.
93*> \endverbatim
94*>
95*> \param[in,out] A
96*> \verbatim
97*> A is COMPLEX array, dimension ( LDA, N )
98*> Before entry, with UPLO = 'U' or 'u', the leading n by n
99*> upper triangular part of the array A must contain the upper
100*> triangular part of the symmetric matrix and the strictly
101*> lower triangular part of A is not referenced. On exit, the
102*> upper triangular part of the array A is overwritten by the
103*> upper triangular part of the updated matrix.
104*> Before entry, with UPLO = 'L' or 'l', the leading n by n
105*> lower triangular part of the array A must contain the lower
106*> triangular part of the symmetric matrix and the strictly
107*> upper triangular part of A is not referenced. On exit, the
108*> lower triangular part of the array A is overwritten by the
109*> lower triangular part of the updated matrix.
110*> \endverbatim
111*>
112*> \param[in] LDA
113*> \verbatim
114*> LDA is INTEGER
115*> On entry, LDA specifies the first dimension of A as declared
116*> in the calling (sub) program. LDA must be at least
117*> max( 1, N ).
118*> Unchanged on exit.
119*> \endverbatim
120*
121* Authors:
122* ========
123*
124*> \author Univ. of Tennessee
125*> \author Univ. of California Berkeley
126*> \author Univ. of Colorado Denver
127*> \author NAG Ltd.
128*
129*> \ingroup her
130*
131* =====================================================================
132 SUBROUTINE csyr( UPLO, N, ALPHA, X, INCX, A, LDA )
133*
134* -- LAPACK auxiliary routine --
135* -- LAPACK is a software package provided by Univ. of Tennessee, --
136* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
137*
138* .. Scalar Arguments ..
139 CHARACTER UPLO
140 INTEGER INCX, LDA, N
141 COMPLEX ALPHA
142* ..
143* .. Array Arguments ..
144 COMPLEX A( LDA, * ), X( * )
145* ..
146*
147* =====================================================================
148*
149* .. Parameters ..
150 COMPLEX ZERO
151 parameter( zero = ( 0.0e+0, 0.0e+0 ) )
152* ..
153* .. Local Scalars ..
154 INTEGER I, INFO, IX, J, JX, KX
155 COMPLEX TEMP
156* ..
157* .. External Functions ..
158 LOGICAL LSAME
159 EXTERNAL lsame
160* ..
161* .. External Subroutines ..
162 EXTERNAL xerbla
163* ..
164* .. Intrinsic Functions ..
165 INTRINSIC max
166* ..
167* .. Executable Statements ..
168*
169* Test the input parameters.
170*
171 info = 0
172 IF( .NOT.lsame( uplo, 'U' ) .AND.
173 $ .NOT.lsame( uplo, 'L' ) ) THEN
174 info = 1
175 ELSE IF( n.LT.0 ) THEN
176 info = 2
177 ELSE IF( incx.EQ.0 ) THEN
178 info = 5
179 ELSE IF( lda.LT.max( 1, n ) ) THEN
180 info = 7
181 END IF
182 IF( info.NE.0 ) THEN
183 CALL xerbla( 'CSYR ', info )
184 RETURN
185 END IF
186*
187* Quick return if possible.
188*
189 IF( ( n.EQ.0 ) .OR. ( alpha.EQ.zero ) )
190 $ RETURN
191*
192* Set the start point in X if the increment is not unity.
193*
194 IF( incx.LE.0 ) THEN
195 kx = 1 - ( n-1 )*incx
196 ELSE IF( incx.NE.1 ) THEN
197 kx = 1
198 END IF
199*
200* Start the operations. In this version the elements of A are
201* accessed sequentially with one pass through the triangular part
202* of A.
203*
204 IF( lsame( uplo, 'U' ) ) THEN
205*
206* Form A when A is stored in upper triangle.
207*
208 IF( incx.EQ.1 ) THEN
209 DO 20 j = 1, n
210 IF( x( j ).NE.zero ) THEN
211 temp = alpha*x( j )
212 DO 10 i = 1, j
213 a( i, j ) = a( i, j ) + x( i )*temp
214 10 CONTINUE
215 END IF
216 20 CONTINUE
217 ELSE
218 jx = kx
219 DO 40 j = 1, n
220 IF( x( jx ).NE.zero ) THEN
221 temp = alpha*x( jx )
222 ix = kx
223 DO 30 i = 1, j
224 a( i, j ) = a( i, j ) + x( ix )*temp
225 ix = ix + incx
226 30 CONTINUE
227 END IF
228 jx = jx + incx
229 40 CONTINUE
230 END IF
231 ELSE
232*
233* Form A when A is stored in lower triangle.
234*
235 IF( incx.EQ.1 ) THEN
236 DO 60 j = 1, n
237 IF( x( j ).NE.zero ) THEN
238 temp = alpha*x( j )
239 DO 50 i = j, n
240 a( i, j ) = a( i, j ) + x( i )*temp
241 50 CONTINUE
242 END IF
243 60 CONTINUE
244 ELSE
245 jx = kx
246 DO 80 j = 1, n
247 IF( x( jx ).NE.zero ) THEN
248 temp = alpha*x( jx )
249 ix = jx
250 DO 70 i = j, n
251 a( i, j ) = a( i, j ) + x( ix )*temp
252 ix = ix + incx
253 70 CONTINUE
254 END IF
255 jx = jx + incx
256 80 CONTINUE
257 END IF
258 END IF
259*
260 RETURN
261*
262* End of CSYR
263*
264 END
subroutine xerbla(srname, info)
Definition cblat2.f:3285
subroutine csyr(uplo, n, alpha, x, incx, a, lda)
CSYR performs the symmetric rank-1 update of a complex symmetric matrix.
Definition csyr.f:133