LAPACK  3.8.0
LAPACK: Linear Algebra PACKage

◆ sstt22()

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

SSTT22

Purpose:
 SSTT22  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, SSTT22 does nothing.
          It must be at least zero.
[in]M
          M is INTEGER
          The number of eigenpairs to check.  If it is zero, SSTT22
          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 REAL array, dimension (N)
          The diagonal of the original (unfactored) matrix A.  A is
          assumed to be symmetric tridiagonal.
[in]AE
          AE is REAL 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 REAL array, dimension (N)
          The diagonal of the (symmetric tri-) diagonal matrix S.
[in]SE
          SE is REAL 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 REAL 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 REAL 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 REAL array, dimension (2)
          The values computed by the two tests described above.  The
          values are currently limited to 1/ulp, to avoid overflow.
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Date
December 2016

Definition at line 141 of file sstt22.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  REAL ad( * ), ae( * ), result( 2 ), sd( * ),
152  $ se( * ), u( ldu, * ), work( ldwork, * )
153 * ..
154 *
155 * =====================================================================
156 *
157 * .. Parameters ..
158  REAL zero, one
159  parameter( zero = 0.0e0, one = 1.0e0 )
160 * ..
161 * .. Local Scalars ..
162  INTEGER i, j, k
163  REAL anorm, aukj, ulp, unfl, wnorm
164 * ..
165 * .. External Functions ..
166  REAL slamch, slange, slansy
167  EXTERNAL slamch, slange, slansy
168 * ..
169 * .. External Subroutines ..
170  EXTERNAL sgemm
171 * ..
172 * .. Intrinsic Functions ..
173  INTRINSIC abs, max, min, real
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 = slamch( 'Safe minimum' )
183  ulp = slamch( '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 = slansy( '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, REAL( M ) ) / ( m*ulp )
233  END IF
234  END IF
235 *
236 * Do Test 2
237 *
238 * Compute U'U - I
239 *
240  CALL sgemm( '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( REAL( M ), slange( '1', m, m, work, m, work( 1,
248  $ m+1 ) ) ) / ( m*ulp )
249 *
250  RETURN
251 *
252 * End of SSTT22
253 *
subroutine sgemm(TRANSA, TRANSB, M, N, K, ALPHA, A, LDA, B, LDB, BETA, C, LDC)
SGEMM
Definition: sgemm.f:189
real function slange(NORM, M, N, A, LDA, WORK)
SLANGE returns the value of the 1-norm, Frobenius norm, infinity-norm, or the largest absolute value ...
Definition: slange.f:116
real function slamch(CMACH)
SLAMCH
Definition: slamch.f:69
real function slansy(NORM, UPLO, N, A, LDA, WORK)
SLANSY 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: slansy.f:124
Here is the call graph for this function:
Here is the caller graph for this function: