LAPACK  3.8.0 LAPACK: Linear Algebra PACKage

## ◆ dsbt21()

 subroutine dsbt21 ( character UPLO, integer N, integer KA, integer KS, double precision, dimension( lda, * ) A, integer LDA, double precision, dimension( * ) D, double precision, dimension( * ) E, double precision, dimension( ldu, * ) U, integer LDU, double precision, dimension( * ) WORK, double precision, dimension( 2 ) RESULT )

DSBT21

Purpose:
``` DSBT21  generally checks a decomposition of the form

A = U S U'

where ' means transpose, A is symmetric banded, U is
orthogonal, and S is diagonal (if KS=0) or symmetric
tridiagonal (if KS=1).

Specifically:

RESULT(1) = | A - U S U' | / ( |A| n ulp ) *andC>         RESULT(2) = | I - UU' | / ( n ulp )```
Parameters
 [in] UPLO ``` UPLO is CHARACTER If UPLO='U', the upper triangle of A and V will be used and the (strictly) lower triangle will not be referenced. If UPLO='L', the lower triangle of A and V will be used and the (strictly) upper triangle will not be referenced.``` [in] N ``` N is INTEGER The size of the matrix. If it is zero, DSBT21 does nothing. It must be at least zero.``` [in] KA ``` KA is INTEGER The bandwidth of the matrix A. It must be at least zero. If it is larger than N-1, then max( 0, N-1 ) will be used.``` [in] KS ``` KS is INTEGER The bandwidth of the matrix S. It may only be zero or one. If zero, then S is diagonal, and E is not referenced. If one, then S is symmetric tri-diagonal.``` [in] A ``` A is DOUBLE PRECISION array, dimension (LDA, N) The original (unfactored) matrix. It is assumed to be symmetric, and only the upper (UPLO='U') or only the lower (UPLO='L') will be referenced.``` [in] LDA ``` LDA is INTEGER The leading dimension of A. It must be at least 1 and at least min( KA, N-1 ).``` [in] D ``` D is DOUBLE PRECISION array, dimension (N) The diagonal of the (symmetric tri-) diagonal matrix S.``` [in] E ``` E is DOUBLE PRECISION array, dimension (N-1) The off-diagonal of the (symmetric tri-) diagonal matrix S. E(1) is the (1,2) and (2,1) element, E(2) is the (2,3) and (3,2) element, etc. Not referenced if KS=0.``` [in] U ``` U is DOUBLE PRECISION array, dimension (LDU, N) The orthogonal matrix in the decomposition, expressed as a dense matrix (i.e., not as a product of Householder transformations, Givens transformations, etc.)``` [in] LDU ``` LDU is INTEGER The leading dimension of U. LDU must be at least N and at least 1.``` [out] WORK ` WORK is DOUBLE PRECISION array, dimension (N**2+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
December 2016

Definition at line 148 of file dsbt21.f.

148 *
149 * -- LAPACK test routine (version 3.7.0) --
150 * -- LAPACK is a software package provided by Univ. of Tennessee, --
151 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
152 * December 2016
153 *
154 * .. Scalar Arguments ..
155  CHARACTER uplo
156  INTEGER ka, ks, lda, ldu, n
157 * ..
158 * .. Array Arguments ..
159  DOUBLE PRECISION a( lda, * ), d( * ), e( * ), result( 2 ),
160  \$ u( ldu, * ), work( * )
161 * ..
162 *
163 * =====================================================================
164 *
165 * .. Parameters ..
166  DOUBLE PRECISION zero, one
167  parameter( zero = 0.0d0, one = 1.0d0 )
168 * ..
169 * .. Local Scalars ..
170  LOGICAL lower
171  CHARACTER cuplo
172  INTEGER ika, j, jc, jr, lw
173  DOUBLE PRECISION anorm, ulp, unfl, wnorm
174 * ..
175 * .. External Functions ..
176  LOGICAL lsame
177  DOUBLE PRECISION dlamch, dlange, dlansb, dlansp
178  EXTERNAL lsame, dlamch, dlange, dlansb, dlansp
179 * ..
180 * .. External Subroutines ..
181  EXTERNAL dgemm, dspr, dspr2
182 * ..
183 * .. Intrinsic Functions ..
184  INTRINSIC dble, max, min
185 * ..
186 * .. Executable Statements ..
187 *
188 * Constants
189 *
190  result( 1 ) = zero
191  result( 2 ) = zero
192  IF( n.LE.0 )
193  \$ RETURN
194 *
195  ika = max( 0, min( n-1, ka ) )
196  lw = ( n*( n+1 ) ) / 2
197 *
198  IF( lsame( uplo, 'U' ) ) THEN
199  lower = .false.
200  cuplo = 'U'
201  ELSE
202  lower = .true.
203  cuplo = 'L'
204  END IF
205 *
206  unfl = dlamch( 'Safe minimum' )
207  ulp = dlamch( 'Epsilon' )*dlamch( 'Base' )
208 *
209 * Some Error Checks
210 *
211 * Do Test 1
212 *
213 * Norm of A:
214 *
215  anorm = max( dlansb( '1', cuplo, n, ika, a, lda, work ), unfl )
216 *
217 * Compute error matrix: Error = A - U S U'
218 *
219 * Copy A from SB to SP storage format.
220 *
221  j = 0
222  DO 50 jc = 1, n
223  IF( lower ) THEN
224  DO 10 jr = 1, min( ika+1, n+1-jc )
225  j = j + 1
226  work( j ) = a( jr, jc )
227  10 CONTINUE
228  DO 20 jr = ika + 2, n + 1 - jc
229  j = j + 1
230  work( j ) = zero
231  20 CONTINUE
232  ELSE
233  DO 30 jr = ika + 2, jc
234  j = j + 1
235  work( j ) = zero
236  30 CONTINUE
237  DO 40 jr = min( ika, jc-1 ), 0, -1
238  j = j + 1
239  work( j ) = a( ika+1-jr, jc )
240  40 CONTINUE
241  END IF
242  50 CONTINUE
243 *
244  DO 60 j = 1, n
245  CALL dspr( cuplo, n, -d( j ), u( 1, j ), 1, work )
246  60 CONTINUE
247 *
248  IF( n.GT.1 .AND. ks.EQ.1 ) THEN
249  DO 70 j = 1, n - 1
250  CALL dspr2( cuplo, n, -e( j ), u( 1, j ), 1, u( 1, j+1 ), 1,
251  \$ work )
252  70 CONTINUE
253  END IF
254  wnorm = dlansp( '1', cuplo, n, work, work( lw+1 ) )
255 *
256  IF( anorm.GT.wnorm ) THEN
257  result( 1 ) = ( wnorm / anorm ) / ( n*ulp )
258  ELSE
259  IF( anorm.LT.one ) THEN
260  result( 1 ) = ( min( wnorm, n*anorm ) / anorm ) / ( n*ulp )
261  ELSE
262  result( 1 ) = min( wnorm / anorm, dble( n ) ) / ( n*ulp )
263  END IF
264  END IF
265 *
266 * Do Test 2
267 *
268 * Compute UU' - I
269 *
270  CALL dgemm( 'N', 'C', n, n, n, one, u, ldu, u, ldu, zero, work,
271  \$ n )
272 *
273  DO 80 j = 1, n
274  work( ( n+1 )*( j-1 )+1 ) = work( ( n+1 )*( j-1 )+1 ) - one
275  80 CONTINUE
276 *
277  result( 2 ) = min( dlange( '1', n, n, work, n, work( n**2+1 ) ),
278  \$ dble( n ) ) / ( n*ulp )
279 *
280  RETURN
281 *
282 * End of DSBT21
283 *
double precision function dlamch(CMACH)
DLAMCH
Definition: dlamch.f:65
double precision function dlansb(NORM, UPLO, N, K, AB, LDAB, WORK)
DLANSB returns the value of the 1-norm, or the Frobenius norm, or the infinity norm, or the element of largest absolute value of a symmetric band matrix.
Definition: dlansb.f:131
subroutine dgemm(TRANSA, TRANSB, M, N, K, ALPHA, A, LDA, B, LDB, BETA, C, LDC)
DGEMM
Definition: dgemm.f:189
double precision function dlansp(NORM, UPLO, N, AP, WORK)
DLANSP returns the value of the 1-norm, or the Frobenius norm, or the infinity norm, or the element of largest absolute value of a symmetric matrix supplied in packed form.
Definition: dlansp.f:116
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
logical function lsame(CA, CB)
LSAME
Definition: lsame.f:55
subroutine dspr(UPLO, N, ALPHA, X, INCX, AP)
DSPR
Definition: dspr.f:129
subroutine dspr2(UPLO, N, ALPHA, X, INCX, Y, INCY, AP)
DSPR2
Definition: dspr2.f:144
Here is the call graph for this function:
Here is the caller graph for this function: