1 *> \brief \b ZSYR performs the symmetric rank-1 update of a complex symmetric matrix.
3 * =========== DOCUMENTATION ===========
5 * Online html documentation available at
6 * http://www.netlib.org/lapack/explore-html/
9 *> Download ZSYR + dependencies
10 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/zsyr.f">
12 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/zsyr.f">
14 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zsyr.f">
21 * SUBROUTINE ZSYR( UPLO, N, ALPHA, X, INCX, A, LDA )
23 * .. Scalar Arguments ..
25 * INTEGER INCX, LDA, N
28 * .. Array Arguments ..
29 * COMPLEX*16 A( LDA, * ), X( * )
38 *> ZSYR performs the symmetric rank 1 operation
40 *> A := alpha*x*x**H + A,
42 *> where alpha is a complex scalar, x is an n element vector and A is an
43 *> n by n symmetric matrix.
51 *> UPLO is CHARACTER*1
52 *> On entry, UPLO specifies whether the upper or lower
53 *> triangular part of the array A is to be referenced as
56 *> UPLO = 'U' or 'u' Only the upper triangular part of A
57 *> is to be referenced.
59 *> UPLO = 'L' or 'l' Only the lower triangular part of A
60 *> is to be referenced.
68 *> On entry, N specifies the order of the matrix A.
69 *> N must be at least zero.
75 *> ALPHA is COMPLEX*16
76 *> On entry, ALPHA specifies the scalar alpha.
82 *> X is COMPLEX*16 array, dimension at least
83 *> ( 1 + ( N - 1 )*abs( INCX ) ).
84 *> Before entry, the incremented array X must contain the N-
92 *> On entry, INCX specifies the increment for the elements of
93 *> X. INCX must not be zero.
99 *> A is COMPLEX*16 array, dimension ( LDA, N )
100 *> Before entry, with UPLO = 'U' or 'u', the leading n by n
101 *> upper triangular part of the array A must contain the upper
102 *> triangular part of the symmetric matrix and the strictly
103 *> lower triangular part of A is not referenced. On exit, the
104 *> upper triangular part of the array A is overwritten by the
105 *> upper triangular part of the updated matrix.
106 *> Before entry, with UPLO = 'L' or 'l', the leading n by n
107 *> lower triangular part of the array A must contain the lower
108 *> triangular part of the symmetric matrix and the strictly
109 *> upper triangular part of A is not referenced. On exit, the
110 *> lower triangular part of the array A is overwritten by the
111 *> lower triangular part of the updated matrix.
117 *> On entry, LDA specifies the first dimension of A as declared
118 *> in the calling (sub) program. LDA must be at least
120 *> Unchanged on exit.
126 *> \author Univ. of Tennessee
127 *> \author Univ. of California Berkeley
128 *> \author Univ. of Colorado Denver
131 *> \date September 2012
133 *> \ingroup complex16SYauxiliary
135 * =====================================================================
136 SUBROUTINE ZSYR( UPLO, N, ALPHA, X, INCX, A, LDA )
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..--
143 * .. Scalar Arguments ..
148 * .. Array Arguments ..
149 COMPLEX*16 A( LDA, * ), X( * )
152 * =====================================================================
156 PARAMETER ( ZERO = ( 0.0D+0, 0.0D+0 ) )
158 * .. Local Scalars ..
159 INTEGER I, INFO, IX, J, JX, KX
162 * .. External Functions ..
166 * .. External Subroutines ..
169 * .. Intrinsic Functions ..
172 * .. Executable Statements ..
174 * Test the input parameters.
177 IF( .NOT.LSAME( UPLO, 'U' ) .AND. .NOT.LSAME( UPLO, 'L' ) ) THEN
179 ELSE IF( N.LT.0 ) THEN
181 ELSE IF( INCX.EQ.0 ) THEN
183 ELSE IF( LDA.LT.MAX( 1, N ) ) THEN
187 CALL XERBLA( 'ZSYR ', INFO )
191 * Quick return if possible.
193 IF( ( N.EQ.0 ) .OR. ( ALPHA.EQ.ZERO ) )
196 * Set the start point in X if the increment is not unity.
199 KX = 1 - ( N-1 )*INCX
200 ELSE IF( INCX.NE.1 ) THEN
204 * Start the operations. In this version the elements of A are
205 * accessed sequentially with one pass through the triangular part
208 IF( LSAME( UPLO, 'U' ) ) THEN
210 * Form A when A is stored in upper triangle.
214 IF( X( J ).NE.ZERO ) THEN
217 A( I, J ) = A( I, J ) + X( I )*TEMP
224 IF( X( JX ).NE.ZERO ) THEN
228 A( I, J ) = A( I, J ) + X( IX )*TEMP
237 * Form A when A is stored in lower triangle.
241 IF( X( J ).NE.ZERO ) THEN
244 A( I, J ) = A( I, J ) + X( I )*TEMP
251 IF( X( JX ).NE.ZERO ) THEN
255 A( I, J ) = A( I, J ) + X( IX )*TEMP