3 SUBROUTINE pzgsepchk( IBTYPE, MS, NV, A, IA, JA, DESCA, B, IB, JB,
4 $ DESCB, THRESH, Q, IQ, JQ, DESCQ, C, IC, JC,
5 $ DESCC, W, WORK, LWORK, TSTNRM, RESULT )
13 INTEGER IA, IB, IBTYPE, IC, IQ, JA, JB, JC, JQ, LWORK,
15 DOUBLE PRECISION THRESH, TSTNRM
19 INTEGER DESCA( * ), DESCB( * ), DESCC( * ), DESCQ( * )
20 DOUBLE PRECISION W( * ), WORK( * )
21 COMPLEX*16 A( * ), B( * ), C( * ), Q( * )
217 INTEGER I, INFO, MYCOL, MYROW, NPCOL, NPROW, NQ
218 DOUBLE PRECISION ANORM, ULP
221 INTEGER BLOCK_CYCLIC_2D, DLEN_, DTYPE_, CTXT_, M_, N_,
222 $ MB_, NB_, RSRC_, CSRC_, LLD_
223 parameter( block_cyclic_2d = 1, dlen_ = 9, dtype_ = 1,
224 $ ctxt_ = 2, m_ = 3, n_ = 4, mb_ = 5, nb_ = 6,
225 $ rsrc_ = 7, csrc_ = 8, lld_ = 9 )
226 DOUBLE PRECISION ONE, ZERO
227 PARAMETER ( ONE = 1.0d+0, zero = 0.0d+0 )
228 COMPLEX*16 CONE, CNEGONE, CZERO
229 parameter( cone = 1.0d+0, cnegone = -1.0d+0,
234 DOUBLE PRECISION DLAMCH, PZLANGE
235 EXTERNAL numroc, dlamch, pzlange
246 IF( block_cyclic_2d*csrc_*ctxt_*dlen_*dtype_*lld_*mb_*m_*nb_*n_*
251 CALL blacs_gridinfo( desca( ctxt_ ), nprow, npcol, myrow, mycol )
254 CALL chk1mat( ms, 1, ms, 2, ia, ja, desca, 7, info )
255 CALL chk1mat( ms, 1, ms, 2, ib, jb, descb, 11, info )
256 CALL chk1mat( ms, 1, nv, 2, iq, jq, descq, 16, info )
257 CALL chk1mat( ms, 1, nv, 2, ib, jb, descb, 20, info )
261 nq = numroc( nv, desca( nb_ ), mycol, 0, npcol )
265 ELSE IF( jq.NE.1 )
THEN
267 ELSE IF( ia.NE.1 )
THEN
269 ELSE IF( ja.NE.1 )
THEN
271 ELSE IF( ib.NE.1 )
THEN
273 ELSE IF( jb.NE.1 )
THEN
275 ELSE IF( lwork.LT.nq )
THEN
281 CALL pxerbla( desca( ctxt_ ),
'PZGSEPCHK', -info )
286 ulp = dlamch(
'Epsilon' )
290 anorm = pzlange(
'M', ms, ms, a, ia, ja, desca, work )*
291 $ pzlange(
'M', ms, nv, q, iq, jq, descq, work )
295 IF( ibtype.EQ.1 )
THEN
301 CALL pzgemm(
'N',
'N', ms, nv, ms, cone, a, ia, ja, desca, q,
302 $ iq, jq, descq, czero, c, ic, jc, descc )
307 CALL pzdscal( ms, w( i ), q, iq, jq+i-1, descq, 1 )
312 CALL pzgemm(
'N',
'N', ms, nv, ms, cone, b, ib, jb, descb, q,
313 $ iq, jq, descq, cnegone, c, ic, jc, descc )
315 tstnrm = ( pzlange(
'M', ms, nv, c, ic, jc, descc, work ) /
316 $ anorm ) / (
max( ms, 1 )*ulp )
319 ELSE IF( ibtype.EQ.2 )
THEN
326 CALL pzgemm(
'N',
'N', ms, nv, ms, cone, b, ib, jb, descb, q,
327 $ iq, jq, descq, czero, c, ic, jc, descc )
332 CALL pzdscal( ms, w( i ), q, iq, jq+i-1, descq, 1 )
337 CALL pzgemm(
'N',
'N', ms, nv, ms, cone, a, ia, ja, desca, c,
338 $ ic, jc, descc, cnegone, q, iq, jq, descq )
340 tstnrm = ( pzlange(
'M', ms, nv, q, iq, jq, descq, work ) /
341 $ anorm ) / (
max( ms, 1 )*ulp )
343 ELSE IF( ibtype.EQ.3 )
THEN
350 CALL pzgemm(
'N',
'N', ms, nv, ms, cone, a, ia, ja, desca, q,
351 $ iq, jq, descq, czero, c, ic, jc, descc )
356 CALL pzdscal( ms, w( i ), q, iq, jq+i-1, descq, 1 )
361 CALL pzgemm(
'N',
'N', ms, nv, ms, cone, b, ib, jb, descb, c,
362 $ ic, jc, descc, cnegone, q, iq, jq, descq )
364 tstnrm = ( pzlange(
'M', ms, nv, q, iq, jq, descq, work ) /
365 $ anorm ) / (
max( ms, 1 )*ulp )
369 IF( tstnrm.GT.thresh .OR. ( tstnrm-tstnrm.NE.0.0d0 ) )
THEN