LAPACK  3.6.1
LAPACK: Linear Algebra PACKage
subroutine dpot06 ( character  UPLO,
integer  N,
integer  NRHS,
double precision, dimension( lda, * )  A,
integer  LDA,
double precision, dimension( ldx, * )  X,
integer  LDX,
double precision, dimension( ldb, * )  B,
integer  LDB,
double precision, dimension( * )  RWORK,
double precision  RESID 
)

DPOT06

Purpose:
 DPOT06 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 DOUBLE PRECISION 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 DOUBLE PRECISION 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 DOUBLE PRECISION 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.
Date
November 2011

Definition at line 129 of file dpot06.f.

129 *
130 * -- LAPACK test routine (version 3.4.0) --
131 * -- LAPACK is a software package provided by Univ. of Tennessee, --
132 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
133 * November 2011
134 *
135 * .. Scalar Arguments ..
136  CHARACTER uplo
137  INTEGER lda, ldb, ldx, n, nrhs
138  DOUBLE PRECISION resid
139 * ..
140 * .. Array Arguments ..
141  DOUBLE PRECISION a( lda, * ), b( ldb, * ), rwork( * ),
142  $ x( ldx, * )
143 * ..
144 *
145 * =====================================================================
146 *
147 * .. Parameters ..
148  DOUBLE PRECISION zero, one, negone
149  parameter ( zero = 0.0d+0, one = 1.0d+0 )
150  parameter ( negone = -1.0d+0 )
151 * ..
152 * .. Local Scalars ..
153  INTEGER ifail, j
154  DOUBLE PRECISION anorm, bnorm, eps, xnorm
155 * ..
156 * .. External Functions ..
157  INTEGER idamax
158  DOUBLE PRECISION dlamch, dlansy
159  EXTERNAL idamax, dlamch, dlansy
160 * ..
161 * .. External Subroutines ..
162  EXTERNAL dsymm
163 * ..
164 * .. Intrinsic Functions ..
165  INTRINSIC max, abs
166 * ..
167 * .. Executable Statements ..
168 *
169 * Quick exit if N = 0 or NRHS = 0
170 *
171  IF( n.LE.0 .OR. nrhs.EQ.0 ) THEN
172  resid = zero
173  RETURN
174  END IF
175 *
176 * Exit with RESID = 1/EPS if ANORM = 0.
177 *
178  eps = dlamch( 'Epsilon' )
179  anorm = dlansy( 'I', uplo, n, a, lda, rwork )
180  IF( anorm.LE.zero ) THEN
181  resid = one / eps
182  RETURN
183  END IF
184 *
185 * Compute B - A*X and store in B.
186  ifail=0
187 *
188  CALL dsymm( 'Left', uplo, n, nrhs, negone, a, lda, x,
189  $ ldx, one, b, ldb )
190 *
191 * Compute the maximum over the number of right hand sides of
192 * norm(B - A*X) / ( norm(A) * norm(X) * EPS ) .
193 *
194  resid = zero
195  DO 10 j = 1, nrhs
196  bnorm = abs(b(idamax( n, b( 1, j ), 1 ),j))
197  xnorm = abs(x(idamax( n, x( 1, j ), 1 ),j))
198  IF( xnorm.LE.zero ) THEN
199  resid = one / eps
200  ELSE
201  resid = max( resid, ( ( bnorm / anorm ) / xnorm ) / eps )
202  END IF
203  10 CONTINUE
204 *
205  RETURN
206 *
207 * End of DPOT06
208 *
double precision function dlansy(NORM, UPLO, N, A, LDA, WORK)
DLANSY returns the value of the 1-norm, or the Frobenius norm, or the infinity norm, or the element of largest absolute value of a real symmetric matrix.
Definition: dlansy.f:124
integer function idamax(N, DX, INCX)
IDAMAX
Definition: idamax.f:53
double precision function dlamch(CMACH)
DLAMCH
Definition: dlamch.f:65
subroutine dsymm(SIDE, UPLO, M, N, ALPHA, A, LDA, B, LDB, BETA, C, LDC)
DSYMM
Definition: dsymm.f:191

Here is the call graph for this function:

Here is the caller graph for this function: