LAPACK  3.6.1
LAPACK: Linear Algebra PACKage
subroutine zstt21 ( integer  N,
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( * )  WORK,
double precision, dimension( * )  RWORK,
double precision, dimension( 2 )  RESULT 
)

ZSTT21

Purpose:
 ZSTT21  checks a decomposition of the form

    A = U S UC>
 where * means conjugate transpose, A is real symmetric tridiagonal,
 U is unitary, and S is real and diagonal (if KBAND=0) or symmetric
 tridiagonal (if KBAND=1).  Two tests are performed:

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

    RESULT(2) = | I - UU* | / ( n ulp )
Parameters
[in]N
          N is INTEGER
          The size of the matrix.  If it is zero, ZSTT21 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 symmetric tri-diagonal.
[in]AD
          AD is DOUBLE PRECISION array, dimension (N)
          The diagonal of the original (unfactored) matrix A.  A is
          assumed to be real symmetric tridiagonal.
[in]AE
          AE is DOUBLE PRECISION array, dimension (N-1)
          The off-diagonal of the original (unfactored) matrix A.  A
          is assumed to be symmetric tridiagonal.  AE(1) is the (1,2)
          and (2,1) element, AE(2) is the (2,3) and (3,2) element, etc.
[in]SD
          SD is DOUBLE PRECISION array, dimension (N)
          The diagonal of the real (symmetric tri-) diagonal matrix S.
[in]SE
          SE is DOUBLE PRECISION array, dimension (N-1)
          The off-diagonal of the (symmetric tri-) diagonal matrix S.
          Not referenced if KBSND=0.  If KBAND=1, then AE(1) is the
          (1,2) and (2,1) element, SE(2) is the (2,3) and (3,2)
          element, etc.
[in]U
          U is COMPLEX*16 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 (N**2)
[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.
          RESULT(1) is always modified.
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Date
November 2011

Definition at line 134 of file zstt21.f.

134 *
135 * -- LAPACK test routine (version 3.4.0) --
136 * -- LAPACK is a software package provided by Univ. of Tennessee, --
137 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
138 * November 2011
139 *
140 * .. Scalar Arguments ..
141  INTEGER kband, ldu, n
142 * ..
143 * .. Array Arguments ..
144  DOUBLE PRECISION ad( * ), ae( * ), result( 2 ), rwork( * ),
145  $ sd( * ), se( * )
146  COMPLEX*16 u( ldu, * ), work( * )
147 * ..
148 *
149 * =====================================================================
150 *
151 * .. Parameters ..
152  DOUBLE PRECISION zero, one
153  parameter ( zero = 0.0d+0, one = 1.0d+0 )
154  COMPLEX*16 czero, cone
155  parameter ( czero = ( 0.0d+0, 0.0d+0 ),
156  $ cone = ( 1.0d+0, 0.0d+0 ) )
157 * ..
158 * .. Local Scalars ..
159  INTEGER j
160  DOUBLE PRECISION anorm, temp1, temp2, ulp, unfl, wnorm
161 * ..
162 * .. External Functions ..
163  DOUBLE PRECISION dlamch, zlange, zlanhe
164  EXTERNAL dlamch, zlange, zlanhe
165 * ..
166 * .. External Subroutines ..
167  EXTERNAL zgemm, zher, zher2, zlaset
168 * ..
169 * .. Intrinsic Functions ..
170  INTRINSIC abs, dble, dcmplx, max, min
171 * ..
172 * .. Executable Statements ..
173 *
174 * 1) Constants
175 *
176  result( 1 ) = zero
177  result( 2 ) = zero
178  IF( n.LE.0 )
179  $ RETURN
180 *
181  unfl = dlamch( 'Safe minimum' )
182  ulp = dlamch( 'Precision' )
183 *
184 * Do Test 1
185 *
186 * Copy A & Compute its 1-Norm:
187 *
188  CALL zlaset( 'Full', n, n, czero, czero, work, n )
189 *
190  anorm = zero
191  temp1 = zero
192 *
193  DO 10 j = 1, n - 1
194  work( ( n+1 )*( j-1 )+1 ) = ad( j )
195  work( ( n+1 )*( j-1 )+2 ) = ae( j )
196  temp2 = abs( ae( j ) )
197  anorm = max( anorm, abs( ad( j ) )+temp1+temp2 )
198  temp1 = temp2
199  10 CONTINUE
200 *
201  work( n**2 ) = ad( n )
202  anorm = max( anorm, abs( ad( n ) )+temp1, unfl )
203 *
204 * Norm of A - USU*
205 *
206  DO 20 j = 1, n
207  CALL zher( 'L', n, -sd( j ), u( 1, j ), 1, work, n )
208  20 CONTINUE
209 *
210  IF( n.GT.1 .AND. kband.EQ.1 ) THEN
211  DO 30 j = 1, n - 1
212  CALL zher2( 'L', n, -dcmplx( se( j ) ), u( 1, j ), 1,
213  $ u( 1, j+1 ), 1, work, n )
214  30 CONTINUE
215  END IF
216 *
217  wnorm = zlanhe( '1', 'L', n, work, n, rwork )
218 *
219  IF( anorm.GT.wnorm ) THEN
220  result( 1 ) = ( wnorm / anorm ) / ( n*ulp )
221  ELSE
222  IF( anorm.LT.one ) THEN
223  result( 1 ) = ( min( wnorm, n*anorm ) / anorm ) / ( n*ulp )
224  ELSE
225  result( 1 ) = min( wnorm / anorm, dble( n ) ) / ( n*ulp )
226  END IF
227  END IF
228 *
229 * Do Test 2
230 *
231 * Compute UU* - I
232 *
233  CALL zgemm( 'N', 'C', n, n, n, cone, u, ldu, u, ldu, czero, work,
234  $ n )
235 *
236  DO 40 j = 1, n
237  work( ( n+1 )*( j-1 )+1 ) = work( ( n+1 )*( j-1 )+1 ) - cone
238  40 CONTINUE
239 *
240  result( 2 ) = min( dble( n ), zlange( '1', n, n, work, n,
241  $ rwork ) ) / ( n*ulp )
242 *
243  RETURN
244 *
245 * End of ZSTT21
246 *
double precision function dlamch(CMACH)
DLAMCH
Definition: dlamch.f:65
double precision function zlanhe(NORM, UPLO, N, A, LDA, WORK)
ZLANHE 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 Hermitian matrix.
Definition: zlanhe.f:126
subroutine zgemm(TRANSA, TRANSB, M, N, K, ALPHA, A, LDA, B, LDB, BETA, C, LDC)
ZGEMM
Definition: zgemm.f:189
subroutine zlaset(UPLO, M, N, ALPHA, BETA, A, LDA)
ZLASET initializes the off-diagonal elements and the diagonal elements of a matrix to given values...
Definition: zlaset.f:108
subroutine zher2(UPLO, N, ALPHA, X, INCX, Y, INCY, A, LDA)
ZHER2
Definition: zher2.f:152
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
subroutine zher(UPLO, N, ALPHA, X, INCX, A, LDA)
ZHER
Definition: zher.f:137

Here is the call graph for this function:

Here is the caller graph for this function: