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

◆ dppt02()

subroutine dppt02 ( character uplo,
integer n,
integer nrhs,
double precision, dimension( * ) a,
double precision, dimension( ldx, * ) x,
integer ldx,
double precision, dimension( ldb, * ) b,
integer ldb,
double precision, dimension( * ) rwork,
double precision resid )

DPPT02

Purpose:
!>
!> DPPT02 computes the residual in the solution of a symmetric system
!> of linear equations  A*x = b  when packed storage is used for the
!> coefficient matrix.  The ratio computed is
!>
!>    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
!>          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 (N*(N+1)/2)
!>          The original symmetric matrix A, stored as a packed
!>          triangular matrix.
!> 
[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.   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.  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 120 of file dppt02.f.

122*
123* -- LAPACK test routine --
124* -- LAPACK is a software package provided by Univ. of Tennessee, --
125* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
126*
127* .. Scalar Arguments ..
128 CHARACTER UPLO
129 INTEGER LDB, LDX, N, NRHS
130 DOUBLE PRECISION RESID
131* ..
132* .. Array Arguments ..
133 DOUBLE PRECISION A( * ), B( LDB, * ), RWORK( * ), X( LDX, * )
134* ..
135*
136* =====================================================================
137*
138* .. Parameters ..
139 DOUBLE PRECISION ZERO, ONE
140 parameter( zero = 0.0d+0, one = 1.0d+0 )
141* ..
142* .. Local Scalars ..
143 INTEGER J
144 DOUBLE PRECISION ANORM, BNORM, EPS, XNORM
145* ..
146* .. External Functions ..
147 DOUBLE PRECISION DASUM, DLAMCH, DLANSP
148 EXTERNAL dasum, dlamch, dlansp
149* ..
150* .. External Subroutines ..
151 EXTERNAL dspmv
152* ..
153* .. Intrinsic Functions ..
154 INTRINSIC max
155* ..
156* .. Executable Statements ..
157*
158* Quick exit if N = 0 or NRHS = 0.
159*
160 IF( n.LE.0 .OR. nrhs.LE.0 ) THEN
161 resid = zero
162 RETURN
163 END IF
164*
165* Exit with RESID = 1/EPS if ANORM = 0.
166*
167 eps = dlamch( 'Epsilon' )
168 anorm = dlansp( '1', uplo, n, a, rwork )
169 IF( anorm.LE.zero ) THEN
170 resid = one / eps
171 RETURN
172 END IF
173*
174* Compute B - A*X for the matrix of right hand sides B.
175*
176 DO 10 j = 1, nrhs
177 CALL dspmv( uplo, n, -one, a, x( 1, j ), 1, one, b( 1, j ), 1 )
178 10 CONTINUE
179*
180* Compute the maximum over the number of right hand sides of
181* norm( B - A*X ) / ( norm(A) * norm(X) * EPS ) .
182*
183 resid = zero
184 DO 20 j = 1, nrhs
185 bnorm = dasum( n, b( 1, j ), 1 )
186 xnorm = dasum( n, x( 1, j ), 1 )
187 IF( xnorm.LE.zero ) THEN
188 resid = one / eps
189 ELSE
190 resid = max( resid, ( ( bnorm / anorm ) / xnorm ) / eps )
191 END IF
192 20 CONTINUE
193*
194 RETURN
195*
196* End of DPPT02
197*
double precision function dasum(n, dx, incx)
DASUM
Definition dasum.f:71
subroutine dspmv(uplo, n, alpha, ap, x, incx, beta, y, incy)
DSPMV
Definition dspmv.f:147
double precision function dlamch(cmach)
DLAMCH
Definition dlamch.f:69
double precision function dlansp(norm, uplo, n, ap, work)
DLANSP returns the value of the 1-norm, or the Frobenius norm, or the infinity norm,...
Definition dlansp.f:112
Here is the call graph for this function:
Here is the caller graph for this function: