 LAPACK  3.6.1 LAPACK: Linear Algebra PACKage
 subroutine csyr ( character UPLO, integer N, complex ALPHA, complex, dimension( * ) X, integer INCX, complex, dimension( lda, * ) A, integer LDA )

CSYR performs the symmetric rank-1 update of a complex symmetric matrix.

Purpose:
``` CSYR   performs the symmetric rank 1 operation

A := alpha*x*x**H + A,

where alpha is a complex scalar, x is an n element vector and A is an
n by n symmetric matrix.```
Parameters
 [in] UPLO ``` UPLO is CHARACTER*1 On entry, UPLO specifies whether the upper or lower triangular part of the array A is to be referenced as follows: UPLO = 'U' or 'u' Only the upper triangular part of A is to be referenced. UPLO = 'L' or 'l' Only the lower triangular part of A is to be referenced. Unchanged on exit.``` [in] N ``` N is INTEGER On entry, N specifies the order of the matrix A. N must be at least zero. Unchanged on exit.``` [in] ALPHA ``` ALPHA is COMPLEX On entry, ALPHA specifies the scalar alpha. Unchanged on exit.``` [in] X ``` X is COMPLEX array, dimension at least ( 1 + ( N - 1 )*abs( INCX ) ). Before entry, the incremented array X must contain the N- element vector x. Unchanged on exit.``` [in] INCX ``` INCX is INTEGER On entry, INCX specifies the increment for the elements of X. INCX must not be zero. Unchanged on exit.``` [in,out] A ``` A is COMPLEX array, dimension ( LDA, N ) Before entry, with UPLO = 'U' or 'u', the leading n by n upper triangular part of the array A must contain the upper triangular part of the symmetric matrix and the strictly lower triangular part of A is not referenced. On exit, the upper triangular part of the array A is overwritten by the upper triangular part of the updated matrix. Before entry, with UPLO = 'L' or 'l', the leading n by n lower triangular part of the array A must contain the lower triangular part of the symmetric matrix and the strictly upper triangular part of A is not referenced. On exit, the lower triangular part of the array A is overwritten by the lower triangular part of the updated matrix.``` [in] LDA ``` LDA is INTEGER On entry, LDA specifies the first dimension of A as declared in the calling (sub) program. LDA must be at least max( 1, N ). Unchanged on exit.```
Date
September 2012

Definition at line 137 of file csyr.f.

137 *
138 * -- LAPACK auxiliary routine (version 3.4.2) --
139 * -- LAPACK is a software package provided by Univ. of Tennessee, --
140 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
141 * September 2012
142 *
143 * .. Scalar Arguments ..
144  CHARACTER uplo
145  INTEGER incx, lda, n
146  COMPLEX alpha
147 * ..
148 * .. Array Arguments ..
149  COMPLEX a( lda, * ), x( * )
150 * ..
151 *
152 * =====================================================================
153 *
154 * .. Parameters ..
155  COMPLEX zero
156  parameter ( zero = ( 0.0e+0, 0.0e+0 ) )
157 * ..
158 * .. Local Scalars ..
159  INTEGER i, info, ix, j, jx, kx
160  COMPLEX temp
161 * ..
162 * .. External Functions ..
163  LOGICAL lsame
164  EXTERNAL lsame
165 * ..
166 * .. External Subroutines ..
167  EXTERNAL xerbla
168 * ..
169 * .. Intrinsic Functions ..
170  INTRINSIC max
171 * ..
172 * .. Executable Statements ..
173 *
174 * Test the input parameters.
175 *
176  info = 0
177  IF( .NOT.lsame( uplo, 'U' ) .AND. .NOT.lsame( uplo, 'L' ) ) THEN
178  info = 1
179  ELSE IF( n.LT.0 ) THEN
180  info = 2
181  ELSE IF( incx.EQ.0 ) THEN
182  info = 5
183  ELSE IF( lda.LT.max( 1, n ) ) THEN
184  info = 7
185  END IF
186  IF( info.NE.0 ) THEN
187  CALL xerbla( 'CSYR ', info )
188  RETURN
189  END IF
190 *
191 * Quick return if possible.
192 *
193  IF( ( n.EQ.0 ) .OR. ( alpha.EQ.zero ) )
194  \$ RETURN
195 *
196 * Set the start point in X if the increment is not unity.
197 *
198  IF( incx.LE.0 ) THEN
199  kx = 1 - ( n-1 )*incx
200  ELSE IF( incx.NE.1 ) THEN
201  kx = 1
202  END IF
203 *
204 * Start the operations. In this version the elements of A are
205 * accessed sequentially with one pass through the triangular part
206 * of A.
207 *
208  IF( lsame( uplo, 'U' ) ) THEN
209 *
210 * Form A when A is stored in upper triangle.
211 *
212  IF( incx.EQ.1 ) THEN
213  DO 20 j = 1, n
214  IF( x( j ).NE.zero ) THEN
215  temp = alpha*x( j )
216  DO 10 i = 1, j
217  a( i, j ) = a( i, j ) + x( i )*temp
218  10 CONTINUE
219  END IF
220  20 CONTINUE
221  ELSE
222  jx = kx
223  DO 40 j = 1, n
224  IF( x( jx ).NE.zero ) THEN
225  temp = alpha*x( jx )
226  ix = kx
227  DO 30 i = 1, j
228  a( i, j ) = a( i, j ) + x( ix )*temp
229  ix = ix + incx
230  30 CONTINUE
231  END IF
232  jx = jx + incx
233  40 CONTINUE
234  END IF
235  ELSE
236 *
237 * Form A when A is stored in lower triangle.
238 *
239  IF( incx.EQ.1 ) THEN
240  DO 60 j = 1, n
241  IF( x( j ).NE.zero ) THEN
242  temp = alpha*x( j )
243  DO 50 i = j, n
244  a( i, j ) = a( i, j ) + x( i )*temp
245  50 CONTINUE
246  END IF
247  60 CONTINUE
248  ELSE
249  jx = kx
250  DO 80 j = 1, n
251  IF( x( jx ).NE.zero ) THEN
252  temp = alpha*x( jx )
253  ix = jx
254  DO 70 i = j, n
255  a( i, j ) = a( i, j ) + x( ix )*temp
256  ix = ix + incx
257  70 CONTINUE
258  END IF
259  jx = jx + incx
260  80 CONTINUE
261  END IF
262  END IF
263 *
264  RETURN
265 *
266 * End of CSYR
267 *
subroutine xerbla(SRNAME, INFO)
XERBLA
Definition: xerbla.f:62
logical function lsame(CA, CB)
LSAME
Definition: lsame.f:55

Here is the call graph for this function:

Here is the caller graph for this function: