LAPACK  3.6.1
LAPACK: Linear Algebra PACKage
subroutine ssbt21 ( character  UPLO,
integer  N,
integer  KA,
integer  KS,
real, dimension( lda, * )  A,
integer  LDA,
real, dimension( * )  D,
real, dimension( * )  E,
real, dimension( ldu, * )  U,
integer  LDU,
real, dimension( * )  WORK,
real, dimension( 2 )  RESULT 
)

SSBT21

Purpose:
 SSBT21  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, SSBT21 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 REAL 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 REAL array, dimension (N)
          The diagonal of the (symmetric tri-) diagonal matrix S.
[in]E
          E is REAL 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 REAL 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 REAL array, dimension (N**2+N)
[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
November 2011

Definition at line 148 of file ssbt21.f.

148 *
149 * -- LAPACK test routine (version 3.4.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 * November 2011
153 *
154 * .. Scalar Arguments ..
155  CHARACTER uplo
156  INTEGER ka, ks, lda, ldu, n
157 * ..
158 * .. Array Arguments ..
159  REAL a( lda, * ), d( * ), e( * ), result( 2 ),
160  $ u( ldu, * ), work( * )
161 * ..
162 *
163 * =====================================================================
164 *
165 * .. Parameters ..
166  REAL zero, one
167  parameter ( zero = 0.0e0, one = 1.0e0 )
168 * ..
169 * .. Local Scalars ..
170  LOGICAL lower
171  CHARACTER cuplo
172  INTEGER ika, j, jc, jr, lw
173  REAL anorm, ulp, unfl, wnorm
174 * ..
175 * .. External Functions ..
176  LOGICAL lsame
177  REAL slamch, slange, slansb, slansp
178  EXTERNAL lsame, slamch, slange, slansb, slansp
179 * ..
180 * .. External Subroutines ..
181  EXTERNAL sgemm, sspr, sspr2
182 * ..
183 * .. Intrinsic Functions ..
184  INTRINSIC max, min, real
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 = slamch( 'Safe minimum' )
207  ulp = slamch( 'Epsilon' )*slamch( 'Base' )
208 *
209 * Some Error Checks
210 *
211 * Do Test 1
212 *
213 * Norm of A:
214 *
215  anorm = max( slansb( '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 sspr( 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 sspr2( cuplo, n, -e( j ), u( 1, j ), 1, u( 1, j+1 ), 1,
251  $ work )
252  70 CONTINUE
253  END IF
254  wnorm = slansp( '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, REAL( N ) ) / ( n*ulp )
263  END IF
264  END IF
265 *
266 * Do Test 2
267 *
268 * Compute UU' - I
269 *
270  CALL sgemm( '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( slange( '1', n, n, work, n, work( n**2+1 ) ),
278  $ REAL( N ) ) / ( n*ulp )
279 *
280  RETURN
281 *
282 * End of SSBT21
283 *
subroutine sspr2(UPLO, N, ALPHA, X, INCX, Y, INCY, AP)
SSPR2
Definition: sspr2.f:144
subroutine sgemm(TRANSA, TRANSB, M, N, K, ALPHA, A, LDA, B, LDB, BETA, C, LDC)
SGEMM
Definition: sgemm.f:189
real function slansb(NORM, UPLO, N, K, AB, LDAB, WORK)
SLANSB 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: slansb.f:131
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 slansp(NORM, UPLO, N, AP, WORK)
SLANSP 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: slansp.f:116
real function slamch(CMACH)
SLAMCH
Definition: slamch.f:69
subroutine sspr(UPLO, N, ALPHA, X, INCX, AP)
SSPR
Definition: sspr.f:129
logical function lsame(CA, CB)
LSAME
Definition: lsame.f:55

Here is the call graph for this function:

Here is the caller graph for this function: