15 void pzaxpy_( n, alpha, 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 int ictxt, info, iix, iiy, ixcol, ixrow, iycol, iyrow, jjx,
175 jjy, lcm, lcmp, lcmq, mycol, myrow, nn, np, np0, nprow,
176 npcol, nq, nq0, nz, ione=1, tmp1, wksz;
201 ictxt = desc_X[
CTXT_];
208 info = -(600+
CTXT_+1);
211 pbchkvect( *n, 1, *ix, *jx, desc_X, *incx, 6, &iix, &jjx,
212 &ixrow, &ixcol, nprow, npcol, myrow, mycol, &info );
213 pbchkvect( *n, 1, *iy, *jy, desc_Y, *incy, 11, &iiy, &jjy,
214 &iyrow, &iycol, nprow, npcol, myrow, mycol, &info );
220 if( *incx == desc_X[
M_] )
222 if( *incy == desc_Y[
M_] )
224 if( ( ixcol != iycol ) ||
225 ( ( (*jx-1) % desc_X[
NB_] ) !=
226 ( (*jy-1) % desc_Y[
NB_] ) ) )
228 else if( desc_Y[
NB_] != desc_X[
NB_] )
229 info = -(1100+
NB_+1);
231 else if( ( *incy == 1 ) && ( *incy != desc_Y[
M_] ) )
233 if( ( (*jx-1) % desc_X[
NB_] ) != ( (*iy-1) % desc_Y[
MB_] ) )
235 else if( desc_Y[
MB_] != desc_X[
NB_] )
236 info = -(1100+
MB_+1);
243 else if( ( *incx == 1 ) && ( *incx != desc_X[
M_] ) )
245 if( *incy == desc_Y[
M_] )
247 if( ( (*ix-1) % desc_X[
MB_] ) != ( (*jy-1) % desc_Y[
NB_] ) )
249 else if( desc_Y[
NB_] != desc_X[
MB_] )
250 info = -(1100+
NB_+1);
252 else if( ( *incy == 1 ) && ( *incy != desc_Y[
M_] ) )
254 if( ( ixrow != iyrow ) ||
255 ( ( (*ix-1) % desc_X[
MB_] ) !=
256 ( (*iy-1) % desc_Y[
MB_] ) ) )
258 else if( desc_Y[
MB_] != desc_X[
MB_] )
259 info = -(1100+
MB_+1);
271 if( ictxt != desc_Y[
CTXT_] )
272 info = -(1100+
CTXT_+1);
277 pberror_( &ictxt,
"PZAXPY", &info );
290 if( ( myrow == iyrow ) && ( mycol == iycol ) )
292 if( ( myrow != ixrow ) || ( mycol != ixcol ) )
293 zgerv2d_( &ictxt, n, n, &tmp, n, &ixrow, &ixcol );
295 tmp = X[iix-1+(jjx-1)*desc_X[
LLD_]];
296 zaxpy_( n, alpha, &tmp, n, &Y[iiy-1+(jjy-1)*desc_Y[
LLD_]], n );
298 else if( ( myrow == ixrow ) && ( mycol == ixcol ) )
299 zgesd2d_( &ictxt, n, n, &X[iix-1+(jjx-1)*desc_X[
LLD_]], n,
306 if( ( *incx == desc_X[
M_] ) && ( *incy == desc_Y[
M_] ) )
308 nz = (*jx-1) % desc_Y[
NB_];
310 nq = numroc_( &nn, &desc_X[
NB_], &mycol, &ixcol, &npcol );
317 &X[iix-1+(jjx-1)*desc_X[
LLD_]], &desc_X[
LLD_],
318 &Y[iiy-1+(jjy-1)*desc_Y[
LLD_]], &desc_Y[
LLD_] );
324 &X[iix-1+(jjx-1)*desc_X[
LLD_]], &desc_X[
LLD_],
326 else if( myrow == iyrow )
329 zgerv2d_( &ictxt, &nq, &ione, buff, &ione, &ixrow,
331 zaxpy_( &nq, alpha, buff, &ione,
332 &Y[iiy-1+(jjy-1)*desc_Y[
LLD_]], &desc_Y[
LLD_] );
336 else if( ( *incx == 1 ) && ( *incx != desc_X[
M_] ) &&
337 ( *incy == 1 ) && ( *incy != desc_Y[
M_] ) )
339 nz = (*ix-1) % desc_X[
MB_];
341 np = numroc_( &nn, &desc_X[
MB_], &myrow, &ixrow, &nprow );
348 &X[iix-1+(jjx-1)*desc_X[
LLD_]], incx,
349 &Y[iiy-1+(jjy-1)*desc_Y[
LLD_]], incy );
355 &X[iix-1+(jjx-1)*desc_X[
LLD_]], &desc_X[
LLD_],
357 else if( mycol == iycol )
360 zgerv2d_( &ictxt, &np, &ione, buff, &ione, &myrow,
362 zaxpy_( &np, alpha, buff, &ione,
363 &Y[iiy-1+(jjy-1)*desc_Y[
LLD_]], incy );
369 lcm = ilcm_( &nprow, &npcol );
370 if( ( *incx == 1 ) && ( *incx != desc_X[
M_] ) )
373 nz = (*ix-1) % desc_X[
MB_];
375 np = numroc_( &nn, &desc_X[
MB_], &myrow, &ixrow, &nprow );
376 nz = (*jy-1) % desc_Y[
NB_];
378 tmp1 = nn / desc_Y[
NB_];
379 nq0 =
MYROC0( tmp1, nn, desc_Y[
NB_], npcol );
380 tmp1 = nq0 / desc_Y[
NB_];
381 wksz = np +
MYROC0( tmp1, nq0, desc_Y[
NB_], lcmq );
390 zcopy_( &np, &X[iix-1+(jjx-1)*desc_X[
LLD_]], incx,
392 zscal_( &np, alpha, buff, incx );
395 &desc_X[
MB_], &nz, buff, incx, &one,
396 &Y[iiy-1+(jjy-1)*desc_Y[
LLD_]], &desc_Y[
LLD_],
397 &ixrow, &ixcol, &iyrow, &iycol, buff+np );
402 nz = (*iy-1) % desc_Y[
MB_];
404 tmp1 = nn / desc_Y[
MB_];
405 np = numroc_( &nn, &desc_Y[
MB_], &myrow, &iyrow, &nprow );
406 np0 =
MYROC0( tmp1, nn, desc_Y[
MB_], nprow );
407 tmp1 = np0 / desc_Y[
MB_];
408 wksz =
MYROC0( tmp1, np0, desc_Y[
MB_], lcmp );
414 &desc_X[
NB_], &nz, &X[iix-1+(jjx-1)*desc_X[
LLD_]],
415 &desc_X[
LLD_], &zero, buff, &ione, &ixrow, &ixcol,
416 &iyrow, &iycol, buff+np );
421 zaxpy_( &np, alpha, buff, &ione,
422 &Y[iiy-1+(jjy-1)*desc_Y[
LLD_]], incy );