 LAPACK  3.8.0 LAPACK: Linear Algebra PACKage

## ◆ dstt22()

 subroutine dstt22 ( integer N, integer M, integer KBAND, double precision, dimension( * ) AD, double precision, dimension( * ) AE, double precision, dimension( * ) SD, double precision, dimension( * ) SE, double precision, dimension( ldu, * ) U, integer LDU, double precision, dimension( ldwork, * ) WORK, integer LDWORK, double precision, dimension( 2 ) RESULT )

DSTT22

Purpose:
``` DSTT22  checks a set of M eigenvalues and eigenvectors,

A U = U S

where A is symmetric tridiagonal, the columns of U are orthogonal,
and S is diagonal (if KBAND=0) or symmetric 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, DSTT22 does nothing. It must be at least zero.``` [in] M ``` M is INTEGER The number of eigenpairs to check. If it is zero, DSTT22 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 symmetric tridiagonal.``` [in] AE ``` AE is DOUBLE PRECISION array, dimension (N) The off-diagonal of the original (unfactored) matrix A. A is assumed to be symmetric 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 (symmetric tri-) diagonal matrix S.``` [in] SE ``` SE is DOUBLE PRECISION array, dimension (N) The off-diagonal of the (symmetric 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 orthogonal matrix in the decomposition.``` [in] LDU ``` LDU is INTEGER The leading dimension of U. LDU must be at least N.``` [out] WORK ` WORK is DOUBLE PRECISION array, dimension (LDWORK, M+1)` [in] LDWORK ``` LDWORK is INTEGER The leading dimension of WORK. LDWORK must be at least max(1,M).``` [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
December 2016

Definition at line 141 of file dstt22.f.

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