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

◆ cspt02()

subroutine cspt02 ( character  uplo,
integer  n,
integer  nrhs,
complex, dimension( * )  a,
complex, dimension( ldx, * )  x,
integer  ldx,
complex, dimension( ldb, * )  b,
integer  ldb,
real, dimension( * )  rwork,
real  resid 
)

CSPT02

Purpose:
 CSPT02 computes the residual in the solution of a complex 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
          complex 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 array, dimension (N*(N+1)/2)
          The original complex symmetric matrix A, stored as a packed
          triangular matrix.
[in]X
          X is COMPLEX 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 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 REAL array, dimension (N)
[out]RESID
          RESID is REAL
          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 121 of file cspt02.f.

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