1 SUBROUTINE pzptlaschk( SYMM, UPLO, N, BWL, BWU, NRHS, X, IX, JX,
2 $ DESCX, IASEED, A, IA, JA, DESCA, IBSEED,
3 $ ANORM, RESID, WORK, WORKSIZ )
13 INTEGER BWL, BWU, IA, IASEED, IBSEED,
14 $ ix, ja, jx, n, nrhs, worksiz
15 DOUBLE PRECISION ANORM, RESID
18 INTEGER DESCA( * ), DESCX( * )
19 COMPLEX*16 A( * ), WORK( * ), X( * )
162 PARAMETER ( ONE = ( 1.0d+0, 0.0d+0 ),
163 $ zero = ( 0.0d+0, 0.0d+0 ) )
164 INTEGER BLOCK_CYCLIC_2D, CSRC_, CTXT_, DLEN_, DTYPE_,
165 $ LLD_, MB_, M_, NB_, N_, RSRC_
166 parameter( block_cyclic_2d = 1, dlen_ = 9, dtype_ = 1,
167 $ ctxt_ = 2, m_ = 3, n_ = 4, mb_ = 5, nb_ = 6,
168 $ rsrc_ = 7, csrc_ = 8, lld_ = 9 )
170 PARAMETER ( INT_ONE = 1 )
173 INTEGER IACOL, IAROW, ICTXT,
174 $ IIA, IIX, IPB, IPW,
175 $ ixcol, ixrow, j, jja, jjx, lda,
176 $ mycol, myrow, nb, np, npcol, nprow, nq
178 INTEGER BW, INFO, IPPRODUCT, WORK_MIN
179 DOUBLE PRECISION DIVISOR, EPS, RESID1, NORMX
184 EXTERNAL blacs_gridinfo, dgebr2d, dgebs2d,
186 $
pzmatgen, zgamx2d, zgemm, zgsum2d,
190 INTEGER IZAMAX, NUMROC
191 DOUBLE PRECISION PDLAMCH
192 EXTERNAL izamax, numroc, pdlamch
195 INTRINSIC abs, dble,
max,
min, mod
201 ictxt = desca( ctxt_ )
204 IF( lsame( symm,
'H' ) )
THEN
207 work_min =
max(5,nb)+2*nb
210 IF( lsame( uplo,
'D' ))
THEN
215 work_min =
max(5,nb)+2*nb
218 IF ( worksiz .LT. work_min )
THEN
219 CALL pxerbla( ictxt,
'PZTLASCHK', -18 )
223 CALL blacs_gridinfo( ictxt, nprow, npcol, myrow, mycol )
225 eps = pdlamch( ictxt,
'eps' )
227 divisor = anorm * eps * dble( n )
229 CALL infog2l( ia, ja, desca, nprow, npcol, myrow, mycol, iia, jja,
231 CALL infog2l( ix, jx, descx, nprow, npcol, myrow, mycol, iix, jjx,
233 np = numroc( (2), desca( mb_ ), myrow, 0, nprow )
234 nq = numroc( n, desca( nb_ ), mycol, 0, npcol )
237 ipproduct = 1 + desca( nb_ )
238 ipw = 1 + 2*desca( nb_ )
244 IF( lsame( symm,
'H' ))
THEN
245 CALL pzbmatgen( ictxt, uplo,
'D', bw, bw, n, bw+1,
246 $ desca( nb_ ), a, desca( lld_ ), 0, 0,
247 $ iaseed, myrow, mycol, nprow, npcol )
250 CALL pzbmatgen( ictxt,
'N', uplo, bwl, bwu, n,
251 $ desca( mb_ ), desca( nb_ ), a,
252 $ desca( lld_ ), 0, 0, iaseed, myrow,
253 $ mycol, nprow, npcol )
255 IF( lsame( uplo,
'U' ) )
THEN
263 IF( mycol.LT.npcol-1 )
THEN
264 CALL zgesd2d( ictxt, 1, 1,
265 $ a( start+( desca( nb_ )-1 )*lda ),
266 $ lda, myrow, mycol+1 )
271 DO 230 i=desca( nb_ )-1,0,-1
272 a( start+(i+1)*lda ) = a( start+(i)*lda )
277 IF( mycol.GT.0 )
THEN
278 CALL zgerv2d( ictxt, 1, 1, a( start), lda,
293 CALL pzpbdcmv( bw+1, bw, uplo, n, a, 1, desca,
294 $ 1, x( 1 + (j-1)*descx( lld_ )), 1, descx,
295 $ work( ipproduct ), work( ipw ), (bw+2)*bw, info )
300 CALL pzmatgen( descx( ctxt_ ),
'No',
'No', descx( m_ ),
301 $ descx( n_ ), descx( mb_ ), descx( nb_ ),
302 $ work( ipb ), descx( lld_ ), descx( rsrc_ ),
303 $ descx( csrc_ ), ibseed, 0, nq, j-1, 1, mycol,
304 $ myrow, npcol, nprow )
308 CALL pzaxpy( n, -one, work( ipproduct ), 1, 1, descx, 1,
309 $ work( ipb ), 1, 1, descx, 1 )
311 CALL pdznrm2( n, normx,
312 $ x, 1, j, descx, 1 )
314 CALL pdznrm2( n, resid1,
315 $ work( ipb ), 1, 1, descx, 1 )
320 resid1 = resid1 / ( normx*divisor )
322 resid =
max( resid, resid1 )