LAPACK 3.12.0
LAPACK: Linear Algebra PACKage
Loading...
Searching...
No Matches

◆ 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 ).
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.

Definition at line 134 of file zpbt02.f.

136*
137* -- LAPACK test routine --
138* -- LAPACK is a software package provided by Univ. of Tennessee, --
139* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
140*
141* .. Scalar Arguments ..
142 CHARACTER UPLO
143 INTEGER KD, LDA, LDB, LDX, N, NRHS
144 DOUBLE PRECISION RESID
145* ..
146* .. Array Arguments ..
147 DOUBLE PRECISION RWORK( * )
148 COMPLEX*16 A( LDA, * ), B( LDB, * ), X( LDX, * )
149* ..
150*
151* =====================================================================
152*
153* .. Parameters ..
154 DOUBLE PRECISION ZERO, ONE
155 parameter( zero = 0.0d+0, one = 1.0d+0 )
156 COMPLEX*16 CONE
157 parameter( cone = ( 1.0d+0, 0.0d+0 ) )
158* ..
159* .. Local Scalars ..
160 INTEGER J
161 DOUBLE PRECISION ANORM, BNORM, EPS, XNORM
162* ..
163* .. External Functions ..
164 DOUBLE PRECISION DLAMCH, DZASUM, ZLANHB
165 EXTERNAL dlamch, dzasum, zlanhb
166* ..
167* .. External Subroutines ..
168 EXTERNAL zhbmv
169* ..
170* .. Intrinsic Functions ..
171 INTRINSIC max
172* ..
173* .. Executable Statements ..
174*
175* Quick exit if N = 0 or NRHS = 0.
176*
177 IF( n.LE.0 .OR. nrhs.LE.0 ) THEN
178 resid = zero
179 RETURN
180 END IF
181*
182* Exit with RESID = 1/EPS if ANORM = 0.
183*
184 eps = dlamch( 'Epsilon' )
185 anorm = zlanhb( '1', uplo, n, kd, a, lda, rwork )
186 IF( anorm.LE.zero ) THEN
187 resid = one / eps
188 RETURN
189 END IF
190*
191* Compute B - A*X
192*
193 DO 10 j = 1, nrhs
194 CALL zhbmv( uplo, n, kd, -cone, a, lda, x( 1, j ), 1, cone,
195 $ b( 1, j ), 1 )
196 10 CONTINUE
197*
198* Compute the maximum over the number of right hand sides of
199* norm( B - A*X ) / ( norm(A) * norm(X) * EPS )
200*
201 resid = zero
202 DO 20 j = 1, nrhs
203 bnorm = dzasum( n, b( 1, j ), 1 )
204 xnorm = dzasum( n, x( 1, j ), 1 )
205 IF( xnorm.LE.zero ) THEN
206 resid = one / eps
207 ELSE
208 resid = max( resid, ( ( bnorm / anorm ) / xnorm ) / eps )
209 END IF
210 20 CONTINUE
211*
212 RETURN
213*
214* End of ZPBT02
215*
double precision function dzasum(n, zx, incx)
DZASUM
Definition dzasum.f:72
subroutine zhbmv(uplo, n, k, alpha, a, lda, x, incx, beta, y, incy)
ZHBMV
Definition zhbmv.f:187
double precision function dlamch(cmach)
DLAMCH
Definition dlamch.f:69
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,...
Definition zlanhb.f:132
Here is the call graph for this function:
Here is the caller graph for this function: