3 * =========== DOCUMENTATION ===========
5 * Online html documentation available at
6 * http://www.netlib.org/lapack/explore-html/
11 * SUBROUTINE DPOT02( UPLO, N, NRHS, A, LDA, X, LDX, B, LDB, RWORK,
14 * .. Scalar Arguments ..
16 * INTEGER LDA, LDB, LDX, N, NRHS
17 * DOUBLE PRECISION RESID
19 * .. Array Arguments ..
20 * DOUBLE PRECISION A( LDA, * ), B( LDB, * ), RWORK( * ),
30 *> DPOT02 computes the residual for the solution of a symmetric system
31 *> of linear equations A*x = b:
33 *> RESID = norm(B - A*X) / ( norm(A) * norm(X) * EPS ),
35 *> where EPS is the machine epsilon.
43 *> UPLO is CHARACTER*1
44 *> Specifies whether the upper or lower triangular part of the
45 *> symmetric matrix A is stored:
46 *> = 'U': Upper triangular
47 *> = 'L': Lower triangular
53 *> The number of rows and columns of the matrix A. N >= 0.
59 *> The number of columns of B, the matrix of right hand sides.
65 *> A is DOUBLE PRECISION array, dimension (LDA,N)
66 *> The original symmetric matrix A.
72 *> The leading dimension of the array A. LDA >= max(1,N)
77 *> X is DOUBLE PRECISION array, dimension (LDX,NRHS)
78 *> The computed solution vectors for the system of linear
85 *> The leading dimension of the array X. LDX >= max(1,N).
90 *> B is DOUBLE PRECISION array, dimension (LDB,NRHS)
91 *> On entry, the right hand side vectors for the system of
93 *> On exit, B is overwritten with the difference B - A*X.
99 *> The leading dimension of the array B. LDB >= max(1,N).
104 *> RWORK is DOUBLE PRECISION array, dimension (N)
109 *> RESID is DOUBLE PRECISION
110 *> The maximum over the number of right hand sides of
111 *> norm(B - A*X) / ( norm(A) * norm(X) * EPS ).
117 *> \author Univ. of Tennessee
118 *> \author Univ. of California Berkeley
119 *> \author Univ. of Colorado Denver
122 *> \date November 2011
124 *> \ingroup double_lin
126 * =====================================================================
127 SUBROUTINE DPOT02( UPLO, N, NRHS, A, LDA, X, LDX, B, LDB, RWORK,
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..--
135 * .. Scalar Arguments ..
137 INTEGER LDA, LDB, LDX, N, NRHS
138 DOUBLE PRECISION RESID
140 * .. Array Arguments ..
141 DOUBLE PRECISION A( LDA, * ), B( LDB, * ), RWORK( * ),
145 * =====================================================================
148 DOUBLE PRECISION ZERO, ONE
149 PARAMETER ( ZERO = 0.0D+0, ONE = 1.0D+0 )
151 * .. Local Scalars ..
153 DOUBLE PRECISION ANORM, BNORM, EPS, XNORM
155 * .. External Functions ..
156 DOUBLE PRECISION DASUM, DLAMCH, DLANSY
157 EXTERNAL DASUM, DLAMCH, DLANSY
159 * .. External Subroutines ..
162 * .. Intrinsic Functions ..
165 * .. Executable Statements ..
167 * Quick exit if N = 0 or NRHS = 0.
169 IF( N.LE.0 .OR. NRHS.LE.0 ) THEN
174 * Exit with RESID = 1/EPS if ANORM = 0.
176 EPS = DLAMCH( 'Epsilon' )
177 ANORM = DLANSY( '1', UPLO, N, A, LDA, RWORK )
178 IF( ANORM.LE.ZERO ) THEN
185 CALL DSYMM( 'Left', UPLO, N, NRHS, -ONE, A, LDA, X, LDX, ONE, B,
188 * Compute the maximum over the number of right hand sides of
189 * norm( B - A*X ) / ( norm(A) * norm(X) * EPS ) .
193 BNORM = DASUM( N, B( 1, J ), 1 )
194 XNORM = DASUM( N, X( 1, J ), 1 )
195 IF( XNORM.LE.ZERO ) THEN
198 RESID = MAX( RESID, ( ( BNORM / ANORM ) / XNORM ) / EPS )