15 void pzdotc_( n, dotc, X, ix, jx, desc_X, incx, Y, iy, jy, desc_Y,
20 int * incx, * incy, * ix, * iy, * jx, * jy, * n;
25 int desc_X[], desc_Y[];
174 char * cbtop, * cctop, * rbtop, * rctop;
175 int ictxt, iix, iiy, info, ixcol, ixrow, iycol, iyrow, jjx,
176 jjy, lcm, lcmp, mone=-1, mycol, myrow, nn, np, np0,
177 nprow, npcol, nq, nz, ione=1, tmp1, wksz;
204 ictxt = desc_X[
CTXT_];
211 info = -(600+
CTXT_+1);
214 pbchkvect( *n, 1, *ix, *jx, desc_X, *incx, 6, &iix, &jjx,
215 &ixrow, &ixcol, nprow, npcol, myrow, mycol, &info );
216 pbchkvect( *n, 1, *iy, *jy, desc_Y, *incy, 11, &iiy, &jjy,
217 &iyrow, &iycol, nprow, npcol, myrow, mycol, &info );
223 if( *incx == desc_X[
M_] )
225 if( *incy == desc_Y[
M_] )
227 if( ( ixcol != iycol ) ||
228 ( ( (*jx-1) % desc_X[
NB_] ) !=
229 ( (*jy-1) % desc_Y[
NB_] ) ) )
231 else if( desc_Y[
NB_] != desc_X[
NB_] )
232 info = -(1100+
NB_+1);
234 else if( ( *incy == 1 ) && ( *incy != desc_Y[
M_] ) )
236 if( ( (*jx-1) % desc_X[
NB_] ) != ( (*iy-1) % desc_Y[
MB_] ) )
238 else if( desc_Y[
MB_] != desc_X[
NB_] )
239 info = -(1100+
MB_+1);
246 else if( ( *incx == 1 ) && ( *incx != desc_X[
M_] ) )
248 if( *incy == desc_Y[
M_] )
250 if( ( (*ix-1) % desc_X[
MB_] ) != ( (*jy-1) % desc_Y[
NB_] ) )
252 else if( desc_Y[
NB_] != desc_X[
MB_] )
253 info = -(1100+
NB_+1);
255 else if( ( *incy == 1 ) && ( *incy != desc_Y[
M_] ) )
257 if( ( ixrow != iyrow ) ||
258 ( ( (*ix-1) % desc_X[
MB_] ) !=
259 ( (*iy-1) % desc_Y[
MB_] ) ) )
261 else if( desc_Y[
MB_] != desc_X[
MB_] )
262 info = -(1100+
MB_+1);
274 if( ictxt != desc_Y[
CTXT_] )
275 info = -(1100+
CTXT_+1);
280 pberror_( &ictxt,
"PZDOTC", &info );
290 if( *n == 0 )
return;
296 if( ( myrow == ixrow ) && ( mycol == ixcol ) )
298 buff = &X[iix-1+(jjx-1)*desc_X[
LLD_]];
299 if( ( myrow != iyrow ) || ( mycol != iycol ) )
301 zgesd2d_( &ictxt, n, n, buff, n, &iyrow, &iycol );
302 zgerv2d_( &ictxt, n, n, ywork, n, &iyrow, &iycol );
305 *ywork = Y[iiy-1+(jjy-1)*desc_Y[
LLD_]];
306 zzdotc_( n, dotc, buff, n, ywork, n );
308 else if( ( myrow == iyrow ) && ( mycol == iycol ) )
310 zgesd2d_( &ictxt, n, n, &Y[iiy-1+(jjy-1)*desc_Y[
LLD_]], n,
312 zgerv2d_( &ictxt, n, n, xwork, n, &ixrow, &ixcol );
313 zzdotc_( n, dotc, xwork, n,
314 &Y[iiy-1+(jjy-1)*desc_Y[
LLD_]], n );
317 if( ( *incx == desc_X[
M_] ) && ( desc_X[
M_] != 1 ) )
325 &ione, &ione, dotc, &ione );
330 &ione, &ione, dotc, &ione, &myrow, &ixcol );
334 else if( ( *incx == 1 ) && ( desc_X[
M_] != 1 ) )
342 &ione, &ione, dotc, &ione );
347 &ione, &ione, dotc, &ione, &ixrow, &mycol );
352 if( ( *incy == desc_Y[
M_] ) && ( desc_Y[
M_] != 1 ) )
360 &ione, &ione, dotc, &ione );
365 &ione, &ione, dotc, &ione, &myrow, &iycol );
369 else if( ( *incy == 1 ) && ( desc_Y[
M_] != 1 ) )
377 &ione, &ione, dotc, &ione );
382 &ione, &ione, dotc, &ione, &iyrow, &mycol );
389 if( ( *incx == desc_X[
M_] ) && ( *incy == desc_Y[
M_] ) )
391 nz = (*jx-1) % desc_Y[
NB_];
393 nq = numroc_( &nn, &desc_X[
NB_], &mycol, &ixcol, &npcol );
402 &X[iix-1+(jjx-1)*desc_X[
LLD_]], &desc_X[
LLD_],
403 &Y[iiy-1+(jjy-1)*desc_Y[
LLD_]], &desc_Y[
LLD_] );
405 &ione, dotc, &ione, &mone, &mycol );
414 &X[iix-1+(jjx-1)*desc_X[
LLD_]], &desc_X[
LLD_],
417 zgerv2d_( &ictxt, &nq, &ione, buff, &ione,
419 zzdotc_( &nq, dotc, &X[iix-1+(jjx-1)*desc_X[
LLD_]],
420 &desc_X[
LLD_], buff, &ione );
422 &ione, dotc, &ione, &mone, &mycol );
424 else if( myrow == iyrow )
428 &Y[iiy-1+(jjy-1)*desc_Y[
LLD_]], &desc_Y[
LLD_],
431 zgerv2d_( &ictxt, &nq, &ione, buff, &ione, &ixrow,
435 &Y[iiy-1+(jjy-1)*desc_Y[
LLD_]], &desc_Y[
LLD_] );
437 &ione, dotc, &ione, &mone, &mycol );
441 else if( ( *incx == 1 ) && ( *incx != desc_X[
M_] ) &&
442 ( *incy == 1 ) && ( *incy != desc_Y[
M_] ) )
444 nz = (*ix-1) % desc_X[
MB_];
446 np = numroc_( &nn, &desc_X[
MB_], &myrow, &ixrow, &nprow );
455 &X[iix-1+(jjx-1)*desc_X[
LLD_]], incx,
456 &Y[iiy-1+(jjy-1)*desc_Y[
LLD_]], incy );
458 &ione, &ione, dotc, &ione, &mone, &mycol );
467 &X[iix-1+(jjx-1)*desc_X[
LLD_]], &desc_X[
LLD_],
470 zgerv2d_( &ictxt, &np, &ione, buff, &ione,
473 &X[iix-1+(jjx-1)*desc_X[
LLD_]], incx,
476 &ione, &ione, dotc, &ione, &mone, &mycol );
478 else if( mycol == iycol )
482 zgerv2d_( &ictxt, &np, &ione, buff, &ione,
485 &Y[iiy-1+(jjy-1)*desc_Y[
LLD_]], &desc_Y[
LLD_],
489 &Y[iiy-1+(jjy-1)*desc_Y[
LLD_]], incy );
491 &ione, &ione, dotc, &ione, &mone, &mycol );
497 lcm = ilcm_( &nprow, &npcol );
498 if( ( *incx == 1 ) && ( *incx != desc_X[
M_] ) )
501 nz = (*jy-1) % desc_Y[
NB_];
503 tmp1 = nn / desc_Y[
MB_];
504 np = numroc_( &nn, &desc_X[
MB_], &myrow, &ixrow, &nprow );
505 np0 =
MYROC0( tmp1, nn, desc_X[
MB_], nprow );
506 tmp1 = np0 / desc_X[
MB_];
507 wksz =
MYROC0( tmp1, np0, desc_X[
MB_], lcmp );
517 &desc_Y[
NB_], &nz, &Y[iiy-1+(jjy-1)*desc_Y[
LLD_]],
518 &desc_Y[
LLD_], &zero, buff, &ione, &iyrow, &iycol,
519 &ixrow, &ixcol, buff+np );
523 zzdotc_( &np, dotc, &X[iix-1+(jjx-1)*desc_X[
LLD_]],
526 &ione, &ione, dotc, &ione, &mone, &mycol );
533 &ione, &ione, dotc, &ione );
536 &ione, &ione, dotc, &ione, &myrow, &ixcol );
542 nz = (*jx-1) % desc_X[
NB_];
544 tmp1 = nn / desc_X[
MB_];
545 np = numroc_( &nn, desc_Y+
MB_, &myrow, &iyrow, &nprow );
546 np0 =
MYROC0( tmp1, nn, desc_Y[
MB_], nprow );
547 tmp1 = np0 / desc_Y[
MB_];
548 wksz =
MYROC0( tmp1, np0, desc_Y[
MB_], lcmp );
556 &desc_X[
NB_], &nz, &X[iix-1+(jjx-1)*desc_X[
LLD_]],
557 &desc_X[
LLD_], &zero, buff, &ione, &ixrow, &ixcol,
558 &iyrow, &iycol, buff+np );
562 zzdotc_( &np, dotc, buff, &ione,
563 &Y[iiy-1+(jjy-1)*desc_Y[
LLD_]], incy );
565 &ione, &ione, dotc, &ione, &mone, &mycol );
572 &ione, &ione, dotc, &ione );
575 &ione, &ione, dotc, &ione, &myrow, &iycol );