15 void pzdotu_( n, dotu, 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,
"PZDOTU", &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 zzdotu_( n, dotu, 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 zzdotu_( n, dotu, xwork, n,
314 &Y[iiy-1+(jjx-1)*desc_X[
LLD_]], n );
317 if( ( *incx == desc_X[
M_] ) && ( desc_X[
M_] != 1 ) )
325 &ione, &ione, dotu, &ione );
330 &ione, &ione, dotu, &ione, &myrow, &ixcol );
334 else if( ( *incx == 1 ) && ( desc_X[
M_] != 1 ) )
342 &ione, &ione, dotu, &ione );
347 &ione, &ione, dotu, &ione, &ixrow, &mycol );
352 if( ( *incy == desc_Y[
M_] ) && ( desc_Y[
M_] != 1 ) )
360 &ione, &ione, dotu, &ione );
365 &ione, &ione, dotu, &ione, &myrow, &iycol );
369 else if( ( *incy == 1 ) && ( desc_Y[
M_] != 1 ) )
377 &ione, &ione, dotu, &ione );
382 &ione, &ione, dotu, &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, dotu, &ione, &mone, &mycol );
414 &X[iix-1+(jjx-1)*desc_X[
LLD_]], &desc_X[
LLD_],
417 zgerv2d_( &ictxt, &nq, &ione, buff, &ione, &ixrow,
420 &X[iix-1+(jjx-1)*desc_X[
LLD_]], &desc_X[
LLD_],
423 &ione, dotu, &ione, &mone, &mycol );
425 else if( myrow == iyrow )
429 &Y[iiy-1+(jjy-1)*desc_Y[
LLD_]], &desc_Y[
LLD_],
432 zgerv2d_( &ictxt, &nq, &ione, buff, &ione, &ixrow,
436 &Y[iiy-1+(jjy-1)*desc_Y[
LLD_]], &desc_Y[
LLD_] );
438 &ione, dotu, &ione, &mone, &mycol );
442 else if( ( *incx == 1 ) && ( *incx != desc_X[
M_] ) &&
443 ( *incy == 1 ) && ( *incy != desc_Y[
M_] ) )
445 nz = (*ix-1) % desc_X[
MB_];
447 np = numroc_( &nn, &desc_X[
MB_], &myrow, &ixrow, &nprow );
456 &X[iix-1+(jjx-1)*desc_X[
LLD_]], incx,
457 &Y[iiy-1+(jjy-1)*desc_Y[
LLD_]], incy );
459 &ione, &ione, dotu, &ione, &mone, &mycol );
468 &X[iix-1+(jjx-1)*desc_X[
LLD_]], &desc_X[
LLD_],
471 zgerv2d_( &ictxt, &np, &ione, buff, &ione,
474 &X[iix-1+(jjx-1)*desc_X[
LLD_]], incx,
477 &ione, &ione, dotu, &ione, &mone, &mycol );
479 else if( mycol == iycol )
483 &Y[iiy-1+(jjy-1)*desc_Y[
LLD_]], &desc_Y[
LLD_],
486 zgerv2d_( &ictxt, &np, &ione, buff, &ione,
490 &Y[iiy-1+(jjy-1)*desc_Y[
LLD_]], incy );
492 &ione, &ione, dotu, &ione, &mone, &mycol );
498 lcm = ilcm_( &nprow, &npcol );
499 if( ( *incx == 1 ) && ( *incx != desc_X[
M_] ) )
502 nz = (*jy-1) % desc_Y[
NB_];
504 tmp1 = nn / desc_Y[
MB_];
505 np = numroc_( &nn, &desc_X[
MB_], &myrow, &ixrow, &nprow );
506 np0 =
MYROC0( tmp1, nn, desc_X[
MB_], nprow );
507 tmp1 = np0 / desc_X[
MB_];
508 wksz =
MYROC0( tmp1, np0, desc_X[
MB_], lcmp );
518 &desc_Y[
NB_], &nz, &Y[iiy-1+(jjy-1)*desc_Y[
LLD_]],
519 &desc_Y[
LLD_], &zero, buff, &ione, &iyrow, &iycol,
520 &ixrow, &ixcol, buff+np );
524 zzdotu_( &np, dotu, &X[iix-1+(jjx-1)*desc_X[
LLD_]],
527 &ione, &ione, dotu, &ione, &mone, &mycol );
534 &ione, &ione, dotu, &ione );
537 &ione, &ione, dotu, &ione, &myrow, &ixcol );
543 nz = (*jx-1) % desc_X[
NB_];
545 tmp1 = nn / desc_X[
MB_];
546 np = numroc_( &nn, desc_Y+
MB_, &myrow, &iyrow, &nprow );
547 np0 =
MYROC0( tmp1, nn, desc_Y[
MB_], nprow );
548 tmp1 = np0 / desc_Y[
MB_];
549 wksz =
MYROC0( tmp1, np0, desc_Y[
MB_], lcmp );
557 &desc_X[
NB_], &nz, &X[iix-1+(jjx-1)*desc_X[
LLD_]],
558 &desc_X[
LLD_], &zero, buff, &ione, &ixrow, &ixcol,
559 &iyrow, &iycol, buff+np );
563 zzdotu_( &np, dotu, buff, &ione,
564 &Y[iiy-1+(jjy-1)*desc_Y[
LLD_]], incy );
566 &ione, &ione, dotu, &ione, &mone, &mycol );
573 &ione, &ione, dotu, &ione );
576 &ione, &ione, dotu, &ione, &myrow, &iycol );