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

◆ zpot06()

subroutine zpot06 ( character  uplo,
integer  n,
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 
)

ZPOT06

Purpose:
 ZPOT06 computes the residual for a solution of a system of linear
 equations  A*x = b :
    RESID = norm(B - A*X,inf) / ( norm(A,inf) * norm(X,inf) * EPS ),
 where EPS is the machine epsilon.
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]NRHS
          NRHS is INTEGER
          The number of columns of B, the matrix of right hand sides.
          NRHS >= 0.
[in]A
          A is COMPLEX*16 array, dimension (LDA,N)
          The original M x N matrix A.
[in]LDA
          LDA is INTEGER
          The leading dimension of the array A.  LDA >= max(1,N).
[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.  If TRANS = 'N',
          LDX >= max(1,N); if TRANS = 'T' or 'C', 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.  IF TRANS = 'N',
          LDB >= max(1,M); if TRANS = 'T' or 'C', 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 125 of file zpot06.f.

127*
128* -- LAPACK test routine --
129* -- LAPACK is a software package provided by Univ. of Tennessee, --
130* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
131*
132* .. Scalar Arguments ..
133 CHARACTER UPLO
134 INTEGER LDA, LDB, LDX, N, NRHS
135 DOUBLE PRECISION RESID
136* ..
137* .. Array Arguments ..
138 DOUBLE PRECISION RWORK( * )
139 COMPLEX*16 A( LDA, * ), B( LDB, * ), X( LDX, * )
140* ..
141*
142* =====================================================================
143*
144* .. Parameters ..
145 DOUBLE PRECISION ZERO, ONE
146 parameter( zero = 0.0d+0, one = 1.0d+0 )
147 COMPLEX*16 CONE, NEGCONE
148 parameter( cone = ( 1.0d+0, 0.0d+0 ) )
149 parameter( negcone = ( -1.0d+0, 0.0d+0 ) )
150* ..
151* .. Local Scalars ..
152 INTEGER IFAIL, J
153 DOUBLE PRECISION ANORM, BNORM, EPS, XNORM
154 COMPLEX*16 ZDUM
155* ..
156* .. External Functions ..
157 LOGICAL LSAME
158 INTEGER IZAMAX
159 DOUBLE PRECISION DLAMCH, ZLANSY
160 EXTERNAL lsame, izamax, dlamch, zlansy
161* ..
162* .. External Subroutines ..
163 EXTERNAL zhemm
164* ..
165* .. Intrinsic Functions ..
166 INTRINSIC abs, dble, dimag, max
167* ..
168* .. Statement Functions ..
169 DOUBLE PRECISION CABS1
170* ..
171* .. Statement Function definitions ..
172 cabs1( zdum ) = abs( dble( zdum ) ) + abs( dimag( zdum ) )
173* ..
174* ..
175* .. Executable Statements ..
176*
177* Quick exit if N = 0 or NRHS = 0
178*
179 IF( n.LE.0 .OR. nrhs.EQ.0 ) THEN
180 resid = zero
181 RETURN
182 END IF
183*
184* Exit with RESID = 1/EPS if ANORM = 0.
185*
186 eps = dlamch( 'Epsilon' )
187 anorm = zlansy( 'I', uplo, n, a, lda, rwork )
188 IF( anorm.LE.zero ) THEN
189 resid = one / eps
190 RETURN
191 END IF
192*
193* Compute B - A*X and store in B.
194 ifail=0
195*
196 CALL zhemm( 'Left', uplo, n, nrhs, negcone, a, lda, x,
197 $ ldx, cone, b, ldb )
198*
199* Compute the maximum over the number of right hand sides of
200* norm(B - A*X) / ( norm(A) * norm(X) * EPS ) .
201*
202 resid = zero
203 DO 10 j = 1, nrhs
204 bnorm = cabs1(b(izamax( n, b( 1, j ), 1 ),j))
205 xnorm = cabs1(x(izamax( n, x( 1, j ), 1 ),j))
206 IF( xnorm.LE.zero ) THEN
207 resid = one / eps
208 ELSE
209 resid = max( resid, ( ( bnorm / anorm ) / xnorm ) / eps )
210 END IF
211 10 CONTINUE
212*
213 RETURN
214*
215* End of ZPOT06
216*
subroutine zhemm(side, uplo, m, n, alpha, a, lda, b, ldb, beta, c, ldc)
ZHEMM
Definition zhemm.f:191
integer function izamax(n, zx, incx)
IZAMAX
Definition izamax.f:71
double precision function dlamch(cmach)
DLAMCH
Definition dlamch.f:69
double precision function zlansy(norm, uplo, n, a, lda, work)
ZLANSY returns the value of the 1-norm, or the Frobenius norm, or the infinity norm,...
Definition zlansy.f:123
logical function lsame(ca, cb)
LSAME
Definition lsame.f:48
Here is the call graph for this function:
Here is the caller graph for this function: