LAPACK  3.6.1 LAPACK: Linear Algebra PACKage
 subroutine zstt22 ( integer N, integer M, integer KBAND, double precision, dimension( * ) AD, double precision, dimension( * ) AE, double precision, dimension( * ) SD, double precision, dimension( * ) SE, complex*16, dimension( ldu, * ) U, integer LDU, complex*16, dimension( ldwork, * ) WORK, integer LDWORK, double precision, dimension( * ) RWORK, double precision, dimension( 2 ) RESULT )

ZSTT22

Purpose:
ZSTT22  checks a set of M eigenvalues and eigenvectors,

A U = U S

where A is Hermitian tridiagonal, the columns of U are unitary,
and S is diagonal (if KBAND=0) or Hermitian tridiagonal (if KBAND=1).
Two tests are performed:

RESULT(1) = | U* A U - S | / ( |A| m ulp )

RESULT(2) = | I - U*U | / ( m ulp )
Parameters
 [in] N N is INTEGER The size of the matrix. If it is zero, ZSTT22 does nothing. It must be at least zero. [in] M M is INTEGER The number of eigenpairs to check. If it is zero, ZSTT22 does nothing. It must be at least zero. [in] KBAND KBAND is INTEGER The bandwidth of the matrix S. It may only be zero or one. If zero, then S is diagonal, and SE is not referenced. If one, then S is Hermitian tri-diagonal. [in] AD AD is DOUBLE PRECISION array, dimension (N) The diagonal of the original (unfactored) matrix A. A is assumed to be Hermitian tridiagonal. [in] AE AE is DOUBLE PRECISION array, dimension (N) The off-diagonal of the original (unfactored) matrix A. A is assumed to be Hermitian tridiagonal. AE(1) is ignored, AE(2) is the (1,2) and (2,1) element, etc. [in] SD SD is DOUBLE PRECISION array, dimension (N) The diagonal of the (Hermitian tri-) diagonal matrix S. [in] SE SE is DOUBLE PRECISION array, dimension (N) The off-diagonal of the (Hermitian tri-) diagonal matrix S. Not referenced if KBSND=0. If KBAND=1, then AE(1) is ignored, SE(2) is the (1,2) and (2,1) element, etc. [in] U U is DOUBLE PRECISION array, dimension (LDU, N) The unitary matrix in the decomposition. [in] LDU LDU is INTEGER The leading dimension of U. LDU must be at least N. [out] WORK WORK is COMPLEX*16 array, dimension (LDWORK, M+1) [in] LDWORK LDWORK is INTEGER The leading dimension of WORK. LDWORK must be at least max(1,M). [out] RWORK RWORK is DOUBLE PRECISION array, dimension (N) [out] RESULT RESULT is DOUBLE PRECISION array, dimension (2) The values computed by the two tests described above. The values are currently limited to 1/ulp, to avoid overflow.
Date
November 2011

Definition at line 147 of file zstt22.f.

147 *
148 * -- LAPACK test routine (version 3.4.0) --
149 * -- LAPACK is a software package provided by Univ. of Tennessee, --
150 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
151 * November 2011
152 *
153 * .. Scalar Arguments ..
154  INTEGER kband, ldu, ldwork, m, n
155 * ..
156 * .. Array Arguments ..
157  DOUBLE PRECISION ad( * ), ae( * ), result( 2 ), rwork( * ),
158  \$ sd( * ), se( * )
159  COMPLEX*16 u( ldu, * ), work( ldwork, * )
160 * ..
161 *
162 * =====================================================================
163 *
164 * .. Parameters ..
165  DOUBLE PRECISION zero, one
166  parameter ( zero = 0.0d0, one = 1.0d0 )
167  COMPLEX*16 czero, cone
168  parameter ( czero = ( 0.0d+0, 0.0d+0 ),
169  \$ cone = ( 1.0d+0, 0.0d+0 ) )
170 * ..
171 * .. Local Scalars ..
172  INTEGER i, j, k
173  DOUBLE PRECISION anorm, ulp, unfl, wnorm
174  COMPLEX*16 aukj
175 * ..
176 * .. External Functions ..
177  DOUBLE PRECISION dlamch, zlange, zlansy
178  EXTERNAL dlamch, zlange, zlansy
179 * ..
180 * .. External Subroutines ..
181  EXTERNAL zgemm
182 * ..
183 * .. Intrinsic Functions ..
184  INTRINSIC abs, dble, max, min
185 * ..
186 * .. Executable Statements ..
187 *
188  result( 1 ) = zero
189  result( 2 ) = zero
190  IF( n.LE.0 .OR. m.LE.0 )
191  \$ RETURN
192 *
193  unfl = dlamch( 'Safe minimum' )
194  ulp = dlamch( 'Epsilon' )
195 *
196 * Do Test 1
197 *
198 * Compute the 1-norm of A.
199 *
200  IF( n.GT.1 ) THEN
201  anorm = abs( ad( 1 ) ) + abs( ae( 1 ) )
202  DO 10 j = 2, n - 1
203  anorm = max( anorm, abs( ad( j ) )+abs( ae( j ) )+
204  \$ abs( ae( j-1 ) ) )
205  10 CONTINUE
206  anorm = max( anorm, abs( ad( n ) )+abs( ae( n-1 ) ) )
207  ELSE
208  anorm = abs( ad( 1 ) )
209  END IF
210  anorm = max( anorm, unfl )
211 *
212 * Norm of U*AU - S
213 *
214  DO 40 i = 1, m
215  DO 30 j = 1, m
216  work( i, j ) = czero
217  DO 20 k = 1, n
218  aukj = ad( k )*u( k, j )
219  IF( k.NE.n )
220  \$ aukj = aukj + ae( k )*u( k+1, j )
221  IF( k.NE.1 )
222  \$ aukj = aukj + ae( k-1 )*u( k-1, j )
223  work( i, j ) = work( i, j ) + u( k, i )*aukj
224  20 CONTINUE
225  30 CONTINUE
226  work( i, i ) = work( i, i ) - sd( i )
227  IF( kband.EQ.1 ) THEN
228  IF( i.NE.1 )
229  \$ work( i, i-1 ) = work( i, i-1 ) - se( i-1 )
230  IF( i.NE.n )
231  \$ work( i, i+1 ) = work( i, i+1 ) - se( i )
232  END IF
233  40 CONTINUE
234 *
235  wnorm = zlansy( '1', 'L', m, work, m, rwork )
236 *
237  IF( anorm.GT.wnorm ) THEN
238  result( 1 ) = ( wnorm / anorm ) / ( m*ulp )
239  ELSE
240  IF( anorm.LT.one ) THEN
241  result( 1 ) = ( min( wnorm, m*anorm ) / anorm ) / ( m*ulp )
242  ELSE
243  result( 1 ) = min( wnorm / anorm, dble( m ) ) / ( m*ulp )
244  END IF
245  END IF
246 *
247 * Do Test 2
248 *
249 * Compute U*U - I
250 *
251  CALL zgemm( 'T', 'N', m, m, n, cone, u, ldu, u, ldu, czero, work,
252  \$ m )
253 *
254  DO 50 j = 1, m
255  work( j, j ) = work( j, j ) - one
256  50 CONTINUE
257 *
258  result( 2 ) = min( dble( m ), zlange( '1', m, m, work, m,
259  \$ rwork ) ) / ( m*ulp )
260 *
261  RETURN
262 *
263 * End of ZSTT22
264 *
double precision function dlamch(CMACH)
DLAMCH
Definition: dlamch.f:65
subroutine zgemm(TRANSA, TRANSB, M, N, K, ALPHA, A, LDA, B, LDB, BETA, C, LDC)
ZGEMM
Definition: zgemm.f:189
double precision function zlange(NORM, M, N, A, LDA, WORK)
ZLANGE returns the value of the 1-norm, Frobenius norm, infinity-norm, or the largest absolute value ...
Definition: zlange.f:117
double precision function zlansy(NORM, UPLO, N, A, LDA, WORK)
ZLANSY returns the value of the 1-norm, or the Frobenius norm, or the infinity norm, or the element of largest absolute value of a complex symmetric matrix.
Definition: zlansy.f:125

Here is the call graph for this function:

Here is the caller graph for this function: