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

DPBT01

Purpose:
``` DPBT01 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 DOUBLE PRECISION 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 DPBTRF for further details.``` [in] LDA ``` LDA is INTEGER. The leading dimension of the array A. LDA >= max(1,KD+1).``` [in] AFAC ``` AFAC is DOUBLE PRECISION 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 DPBTRF.``` [in] LDAFAC ``` LDAFAC is INTEGER The leading dimension of the array AFAC. LDAFAC >= max(1,KD+1).``` [out] RWORK ` RWORK is DOUBLE PRECISION array, dimension (N)` [out] RESID ``` RESID is DOUBLE PRECISION If UPLO = 'L', norm(L*L' - A) / ( N * norm(A) * EPS ) If UPLO = 'U', norm(U'*U - A) / ( N * norm(A) * EPS )```
Date
November 2011

Definition at line 121 of file dpbt01.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  DOUBLE PRECISION resid
131 * ..
132 * .. Array Arguments ..
133  DOUBLE PRECISION a( lda, * ), afac( ldafac, * ), rwork( * )
134 * ..
135 *
136 * =====================================================================
137 *
138 *
139 * .. Parameters ..
140  DOUBLE PRECISION zero, one
141  parameter ( zero = 0.0d+0, one = 1.0d+0 )
142 * ..
143 * .. Local Scalars ..
144  INTEGER i, j, k, kc, klen, ml, mu
145  DOUBLE PRECISION anorm, eps, t
146 * ..
147 * .. External Functions ..
148  LOGICAL lsame
149  DOUBLE PRECISION ddot, dlamch, dlansb
150  EXTERNAL lsame, ddot, dlamch, dlansb
151 * ..
152 * .. External Subroutines ..
153  EXTERNAL dscal, dsyr, dtrmv
154 * ..
155 * .. Intrinsic Functions ..
156  INTRINSIC dble, max, min
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 = dlamch( 'Epsilon' )
170  anorm = dlansb( '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 = ddot( 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 dtrmv( '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 dsyr( '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 dscal( 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 = dlansb( 'I', uplo, n, kd, afac, ldafac, rwork )
239 *
240  resid = ( ( resid / dble( n ) ) / anorm ) / eps
241 *
242  RETURN
243 *
244 * End of DPBT01
245 *
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
double precision function dlamch(CMACH)
DLAMCH
Definition: dlamch.f:65
double precision function ddot(N, DX, INCX, DY, INCY)
DDOT
Definition: ddot.f:53
subroutine dsyr(UPLO, N, ALPHA, X, INCX, A, LDA)
DSYR
Definition: dsyr.f:134
subroutine dscal(N, DA, DX, INCX)
DSCAL
Definition: dscal.f:55
subroutine dtrmv(UPLO, TRANS, DIAG, N, A, LDA, X, INCX)
DTRMV
Definition: dtrmv.f:149
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: