3 * =========== DOCUMENTATION ===========
5 * Online html documentation available at
6 * http://www.netlib.org/lapack/explore-html/
11 * SUBROUTINE ZSYT03( UPLO, N, A, LDA, AINV, LDAINV, WORK, LDWORK,
12 * RWORK, RCOND, RESID )
14 * .. Scalar Arguments ..
16 * INTEGER LDA, LDAINV, LDWORK, N
17 * DOUBLE PRECISION RCOND, RESID
19 * .. Array Arguments ..
20 * DOUBLE PRECISION RWORK( * )
21 * COMPLEX*16 A( LDA, * ), AINV( LDAINV, * ),
31 *> ZSYT03 computes the residual for a complex symmetric matrix times
33 *> norm( I - A*AINV ) / ( N * norm(A) * norm(AINV) * EPS )
34 *> where EPS is the machine epsilon.
42 *> UPLO is CHARACTER*1
43 *> Specifies whether the upper or lower triangular part of the
44 *> complex symmetric matrix A is stored:
45 *> = 'U': Upper triangular
46 *> = 'L': Lower triangular
52 *> The number of rows and columns of the matrix A. N >= 0.
57 *> A is COMPLEX*16 array, dimension (LDA,N)
58 *> The original complex symmetric matrix A.
64 *> The leading dimension of the array A. LDA >= max(1,N)
67 *> \param[in,out] AINV
69 *> AINV is COMPLEX*16 array, dimension (LDAINV,N)
70 *> On entry, the inverse of the matrix A, stored as a symmetric
71 *> matrix in the same format as A.
72 *> In this version, AINV is expanded into a full matrix and
73 *> multiplied by A, so the opposing triangle of AINV will be
74 *> changed; i.e., if the upper triangular part of AINV is
75 *> stored, the lower triangular part will be used as work space.
81 *> The leading dimension of the array AINV. LDAINV >= max(1,N).
86 *> WORK is COMPLEX*16 array, dimension (LDWORK,N)
92 *> The leading dimension of the array WORK. LDWORK >= max(1,N).
97 *> RWORK is DOUBLE PRECISION array, dimension (N)
102 *> RCOND is DOUBLE PRECISION
103 *> The reciprocal of the condition number of A, computed as
104 *> RCOND = 1/ (norm(A) * norm(AINV)).
109 *> RESID is DOUBLE PRECISION
110 *> norm(I - A*AINV) / ( N * norm(A) * norm(AINV) * EPS )
116 *> \author Univ. of Tennessee
117 *> \author Univ. of California Berkeley
118 *> \author Univ. of Colorado Denver
121 *> \date November 2011
123 *> \ingroup complex16_lin
125 * =====================================================================
126 SUBROUTINE ZSYT03( UPLO, N, A, LDA, AINV, LDAINV, WORK, LDWORK,
127 $ RWORK, RCOND, RESID )
129 * -- LAPACK test routine (version 3.4.0) --
130 * -- LAPACK is a software package provided by Univ. of Tennessee, --
131 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
134 * .. Scalar Arguments ..
136 INTEGER LDA, LDAINV, LDWORK, N
137 DOUBLE PRECISION RCOND, RESID
139 * .. Array Arguments ..
140 DOUBLE PRECISION RWORK( * )
141 COMPLEX*16 A( LDA, * ), AINV( LDAINV, * ),
145 * =====================================================================
149 DOUBLE PRECISION ZERO, ONE
150 PARAMETER ( ZERO = 0.0D+0, ONE = 1.0D+0 )
151 COMPLEX*16 CZERO, CONE
152 PARAMETER ( CZERO = ( 0.0D+0, 0.0D+0 ),
153 $ CONE = ( 1.0D+0, 0.0D+0 ) )
155 * .. Local Scalars ..
157 DOUBLE PRECISION AINVNM, ANORM, EPS
159 * .. External Functions ..
161 DOUBLE PRECISION DLAMCH, ZLANGE, ZLANSY
162 EXTERNAL LSAME, DLAMCH, ZLANGE, ZLANSY
164 * .. External Subroutines ..
167 * .. Intrinsic Functions ..
170 * .. Executable Statements ..
172 * Quick exit if N = 0
180 * Exit with RESID = 1/EPS if ANORM = 0 or AINVNM = 0.
182 EPS = DLAMCH( 'Epsilon' )
183 ANORM = ZLANSY( '1', UPLO, N, A, LDA, RWORK )
184 AINVNM = ZLANSY( '1', UPLO, N, AINV, LDAINV, RWORK )
185 IF( ANORM.LE.ZERO .OR. AINVNM.LE.ZERO ) THEN
190 RCOND = ( ONE / ANORM ) / AINVNM
192 * Expand AINV into a full matrix and call ZSYMM to multiply
193 * AINV on the left by A (store the result in WORK).
195 IF( LSAME( UPLO, 'U' ) ) THEN
198 AINV( J, I ) = AINV( I, J )
204 AINV( J, I ) = AINV( I, J )
208 CALL ZSYMM( 'Left', UPLO, N, N, -CONE, A, LDA, AINV, LDAINV,
209 $ CZERO, WORK, LDWORK )
211 * Add the identity matrix to WORK .
214 WORK( I, I ) = WORK( I, I ) + CONE
217 * Compute norm(I - A*AINV) / (N * norm(A) * norm(AINV) * EPS)
219 RESID = ZLANGE( '1', N, N, WORK, LDWORK, RWORK )
221 RESID = ( ( RESID*RCOND ) / EPS ) / DBLE( N )