 LAPACK  3.8.0 LAPACK: Linear Algebra PACKage

## ◆ zpbt02()

 subroutine zpbt02 ( character UPLO, integer N, integer KD, integer NRHS, complex*16, dimension( lda, * ) A, integer LDA, complex*16, dimension( ldx, * ) X, integer LDX, complex*16, dimension( ldb, * ) B, integer LDB, double precision, dimension( * ) RWORK, double precision RESID )

ZPBT02

Purpose:
``` ZPBT02 computes the residual for a solution of a Hermitian banded
system of equations  A*x = b:
RESID = norm( B - A*X ) / ( norm(A) * norm(X) * EPS)
where EPS is the machine precision.```
Parameters
 [in] UPLO ``` UPLO is CHARACTER*1 Specifies whether the upper or lower triangular part of the Hermitian 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] NRHS ``` NRHS is INTEGER The number of right hand sides. NRHS >= 0.``` [in] A ``` A is COMPLEX*16 array, dimension (LDA,N) The original Hermitian 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 ZPBTRF for further details.``` [in] LDA ``` LDA is INTEGER. The leading dimension of the array A. LDA >= max(1,KD+1).``` [in] X ``` X is COMPLEX*16 array, dimension (LDX,NRHS) The computed solution vectors for the system of linear equations.``` [in] LDX ``` LDX is INTEGER The leading dimension of the array X. LDX >= max(1,N).``` [in,out] B ``` B is COMPLEX*16 array, dimension (LDB,NRHS) On entry, the right hand side vectors for the system of linear equations. On exit, B is overwritten with the difference B - A*X.``` [in] LDB ``` LDB is INTEGER The leading dimension of the array B. LDB >= max(1,N).``` [out] RWORK ` RWORK is DOUBLE PRECISION array, dimension (N)` [out] RESID ``` RESID is DOUBLE PRECISION The maximum over the number of right hand sides of norm(B - A*X) / ( norm(A) * norm(X) * EPS ).```
Date
December 2016

Definition at line 138 of file zpbt02.f.

138 *
139 * -- LAPACK test routine (version 3.7.0) --
140 * -- LAPACK is a software package provided by Univ. of Tennessee, --
141 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
142 * December 2016
143 *
144 * .. Scalar Arguments ..
145  CHARACTER uplo
146  INTEGER kd, lda, ldb, ldx, n, nrhs
147  DOUBLE PRECISION resid
148 * ..
149 * .. Array Arguments ..
150  DOUBLE PRECISION rwork( * )
151  COMPLEX*16 a( lda, * ), b( ldb, * ), x( ldx, * )
152 * ..
153 *
154 * =====================================================================
155 *
156 * .. Parameters ..
157  DOUBLE PRECISION zero, one
158  parameter( zero = 0.0d+0, one = 1.0d+0 )
159  COMPLEX*16 cone
160  parameter( cone = ( 1.0d+0, 0.0d+0 ) )
161 * ..
162 * .. Local Scalars ..
163  INTEGER j
164  DOUBLE PRECISION anorm, bnorm, eps, xnorm
165 * ..
166 * .. External Functions ..
167  DOUBLE PRECISION dlamch, dzasum, zlanhb
168  EXTERNAL dlamch, dzasum, zlanhb
169 * ..
170 * .. External Subroutines ..
171  EXTERNAL zhbmv
172 * ..
173 * .. Intrinsic Functions ..
174  INTRINSIC max
175 * ..
176 * .. Executable Statements ..
177 *
178 * Quick exit if N = 0 or NRHS = 0.
179 *
180  IF( n.LE.0 .OR. nrhs.LE.0 ) THEN
181  resid = zero
182  RETURN
183  END IF
184 *
185 * Exit with RESID = 1/EPS if ANORM = 0.
186 *
187  eps = dlamch( 'Epsilon' )
188  anorm = zlanhb( '1', uplo, n, kd, a, lda, rwork )
189  IF( anorm.LE.zero ) THEN
190  resid = one / eps
191  RETURN
192  END IF
193 *
194 * Compute B - A*X
195 *
196  DO 10 j = 1, nrhs
197  CALL zhbmv( uplo, n, kd, -cone, a, lda, x( 1, j ), 1, cone,
198  \$ b( 1, j ), 1 )
199  10 CONTINUE
200 *
201 * Compute the maximum over the number of right hand sides of
202 * norm( B - A*X ) / ( norm(A) * norm(X) * EPS )
203 *
204  resid = zero
205  DO 20 j = 1, nrhs
206  bnorm = dzasum( n, b( 1, j ), 1 )
207  xnorm = dzasum( n, x( 1, j ), 1 )
208  IF( xnorm.LE.zero ) THEN
209  resid = one / eps
210  ELSE
211  resid = max( resid, ( ( bnorm / anorm ) / xnorm ) / eps )
212  END IF
213  20 CONTINUE
214 *
215  RETURN
216 *
217 * End of ZPBT02
218 *
double precision function dzasum(N, ZX, INCX)
DZASUM
Definition: dzasum.f:74
subroutine zhbmv(UPLO, N, K, ALPHA, A, LDA, X, INCX, BETA, Y, INCY)
ZHBMV
Definition: zhbmv.f:189
double precision function dlamch(CMACH)
DLAMCH
Definition: dlamch.f:65
double precision function zlanhb(NORM, UPLO, N, K, AB, LDAB, WORK)
ZLANHB returns the value of the 1-norm, or the Frobenius norm, or the infinity norm, or the element of largest absolute value of a Hermitian band matrix.
Definition: zlanhb.f:134
Here is the call graph for this function:
Here is the caller graph for this function: