LAPACK  3.6.1
LAPACK: Linear Algebra PACKage
subroutine spbt01 ( character  UPLO,
integer  N,
integer  KD,
real, dimension( lda, * )  A,
integer  LDA,
real, dimension( ldafac, * )  AFAC,
integer  LDAFAC,
real, dimension( * )  RWORK,
real  RESID 
)

SPBT01

Purpose:
 SPBT01 reconstructs a symmetric positive definite band matrix A from
 its L*L' or U'*U factorization and computes the residual
    norm( L*L' - A ) / ( N * norm(A) * EPS ) or
    norm( U'*U - A ) / ( N * norm(A) * EPS ),
 where EPS is the machine epsilon, L' is the conjugate transpose of
 L, and U' is the conjugate transpose of U.
Parameters
[in]UPLO
          UPLO is CHARACTER*1
          Specifies whether the upper or lower triangular part of the
          symmetric matrix A is stored:
          = 'U':  Upper triangular
          = 'L':  Lower triangular
[in]N
          N is INTEGER
          The number of rows and columns of the matrix A.  N >= 0.
[in]KD
          KD is INTEGER
          The number of super-diagonals of the matrix A if UPLO = 'U',
          or the number of sub-diagonals if UPLO = 'L'.  KD >= 0.
[in]A
          A is REAL array, dimension (LDA,N)
          The original symmetric band matrix A.  If UPLO = 'U', the
          upper triangular part of A is stored as a band matrix; if
          UPLO = 'L', the lower triangular part of A is stored.  The
          columns of the appropriate triangle are stored in the columns
          of A and the diagonals of the triangle are stored in the rows
          of A.  See SPBTRF for further details.
[in]LDA
          LDA is INTEGER.
          The leading dimension of the array A.  LDA >= max(1,KD+1).
[in]AFAC
          AFAC is REAL array, dimension (LDAFAC,N)
          The factored form of the matrix A.  AFAC contains the factor
          L or U from the L*L' or U'*U factorization in band storage
          format, as computed by SPBTRF.
[in]LDAFAC
          LDAFAC is INTEGER
          The leading dimension of the array AFAC.
          LDAFAC >= max(1,KD+1).
[out]RWORK
          RWORK is REAL array, dimension (N)
[out]RESID
          RESID is REAL
          If UPLO = 'L', norm(L*L' - A) / ( N * norm(A) * EPS )
          If UPLO = 'U', norm(U'*U - A) / ( N * norm(A) * EPS )
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Date
November 2011

Definition at line 121 of file spbt01.f.

121 *
122 * -- LAPACK test routine (version 3.4.0) --
123 * -- LAPACK is a software package provided by Univ. of Tennessee, --
124 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
125 * November 2011
126 *
127 * .. Scalar Arguments ..
128  CHARACTER uplo
129  INTEGER kd, lda, ldafac, n
130  REAL resid
131 * ..
132 * .. Array Arguments ..
133  REAL a( lda, * ), afac( ldafac, * ), rwork( * )
134 * ..
135 *
136 * =====================================================================
137 *
138 *
139 * .. Parameters ..
140  REAL zero, one
141  parameter ( zero = 0.0e+0, one = 1.0e+0 )
142 * ..
143 * .. Local Scalars ..
144  INTEGER i, j, k, kc, klen, ml, mu
145  REAL anorm, eps, t
146 * ..
147 * .. External Functions ..
148  LOGICAL lsame
149  REAL sdot, slamch, slansb
150  EXTERNAL lsame, sdot, slamch, slansb
151 * ..
152 * .. External Subroutines ..
153  EXTERNAL sscal, ssyr, strmv
154 * ..
155 * .. Intrinsic Functions ..
156  INTRINSIC max, min, real
157 * ..
158 * .. Executable Statements ..
159 *
160 * Quick exit if N = 0.
161 *
162  IF( n.LE.0 ) THEN
163  resid = zero
164  RETURN
165  END IF
166 *
167 * Exit with RESID = 1/EPS if ANORM = 0.
168 *
169  eps = slamch( 'Epsilon' )
170  anorm = slansb( '1', uplo, n, kd, a, lda, rwork )
171  IF( anorm.LE.zero ) THEN
172  resid = one / eps
173  RETURN
174  END IF
175 *
176 * Compute the product U'*U, overwriting U.
177 *
178  IF( lsame( uplo, 'U' ) ) THEN
179  DO 10 k = n, 1, -1
180  kc = max( 1, kd+2-k )
181  klen = kd + 1 - kc
182 *
183 * Compute the (K,K) element of the result.
184 *
185  t = sdot( klen+1, afac( kc, k ), 1, afac( kc, k ), 1 )
186  afac( kd+1, k ) = t
187 *
188 * Compute the rest of column K.
189 *
190  IF( klen.GT.0 )
191  $ CALL strmv( 'Upper', 'Transpose', 'Non-unit', klen,
192  $ afac( kd+1, k-klen ), ldafac-1,
193  $ afac( kc, k ), 1 )
194 *
195  10 CONTINUE
196 *
197 * UPLO = 'L': Compute the product L*L', overwriting L.
198 *
199  ELSE
200  DO 20 k = n, 1, -1
201  klen = min( kd, n-k )
202 *
203 * Add a multiple of column K of the factor L to each of
204 * columns K+1 through N.
205 *
206  IF( klen.GT.0 )
207  $ CALL ssyr( 'Lower', klen, one, afac( 2, k ), 1,
208  $ afac( 1, k+1 ), ldafac-1 )
209 *
210 * Scale column K by the diagonal element.
211 *
212  t = afac( 1, k )
213  CALL sscal( klen+1, t, afac( 1, k ), 1 )
214 *
215  20 CONTINUE
216  END IF
217 *
218 * Compute the difference L*L' - A or U'*U - A.
219 *
220  IF( lsame( uplo, 'U' ) ) THEN
221  DO 40 j = 1, n
222  mu = max( 1, kd+2-j )
223  DO 30 i = mu, kd + 1
224  afac( i, j ) = afac( i, j ) - a( i, j )
225  30 CONTINUE
226  40 CONTINUE
227  ELSE
228  DO 60 j = 1, n
229  ml = min( kd+1, n-j+1 )
230  DO 50 i = 1, ml
231  afac( i, j ) = afac( i, j ) - a( i, j )
232  50 CONTINUE
233  60 CONTINUE
234  END IF
235 *
236 * Compute norm( L*L' - A ) / ( N * norm(A) * EPS )
237 *
238  resid = slansb( 'I', uplo, n, kd, afac, ldafac, rwork )
239 *
240  resid = ( ( resid / REAL( N ) ) / anorm ) / eps
241 *
242  RETURN
243 *
244 * End of SPBT01
245 *
real function sdot(N, SX, INCX, SY, INCY)
SDOT
Definition: sdot.f:53
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
subroutine strmv(UPLO, TRANS, DIAG, N, A, LDA, X, INCX)
STRMV
Definition: strmv.f:149
subroutine sscal(N, SA, SX, INCX)
SSCAL
Definition: sscal.f:55
real function slamch(CMACH)
SLAMCH
Definition: slamch.f:69
subroutine ssyr(UPLO, N, ALPHA, X, INCX, A, LDA)
SSYR
Definition: ssyr.f:134
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: