22 double * A,
int * IA,
int * JA,
int * DESCA,
23 double * X,
int * IX,
int * JX,
int * DESCX,
24 int * INCX,
double * BETA,
25 double * Y,
int * IY,
int * JY,
int * DESCY,
28 void pzatrmv_( UPLO, TRANS, DIAG, N, ALPHA, A, IA, JA, DESCA, X, IX,
29 JX, DESCX, INCX, BETA, Y, IY, JY, DESCY, INCY )
34 int * IA, * INCX, * INCY, * IX, * IY, * JA, * JX, * JY,
36 double * ALPHA, * BETA;
40 int * DESCA, * DESCX, * DESCY;
283 char DiagA, TranOp, UploA, Yroc, * one, top;
284 int Acol, Ai, Aii, Aimb1, Ainb1, Aj, Ajj, Akp, Akq, Ald, Amb,
285 Amp, Amp0, Anb, Anq, Anq0, Arow, XAfr, XAld, Xi, Xj, YAfr,
286 YAld, YApbY, YAsum, Ycol, Yi, Yii, Yj, Yjj, Yld, Ynp, Ynq,
287 Yrow, ctxt, info, ione=1, k, kb, ktmp, mycol, myrow, nb,
288 notran, nounit, npcol, nprow, size, upper, usiz;
296 char * Aptr = NULL, * XA = NULL, * YA = NULL;
312 if( !( info = ( ( nprow == -1 ) ? -( 801 +
CTXT_ ) : 0 ) ) )
314 if( ( !upper ) && ( UploA !=
CLOWER ) )
316 PB_Cwarn( ctxt, __LINE__,
"PZATRMV",
"Illegal UPLO = %c\n", UploA );
319 else if( ( !notran ) && ( TranOp !=
CTRAN ) && ( TranOp !=
CCOTRAN ) )
321 PB_Cwarn( ctxt, __LINE__,
"PZATRMV",
"Illegal TRANS = %c\n", TranOp );
324 else if( ( !nounit ) && ( DiagA !=
CUNIT ) )
326 PB_Cwarn( ctxt, __LINE__,
"PZATRMV",
"Illegal DIAG = %c\n", DiagA );
329 PB_Cchkmat( ctxt,
"PZATRMV",
"A", *N, 4, *N, 4, Ai, Aj, Ad, 9, &info );
330 PB_Cchkvec( ctxt,
"PZATRMV",
"X", *N, 4, Xi, Xj, Xd, *INCX, 13, &info );
331 PB_Cchkvec( ctxt,
"PZATRMV",
"Y", *N, 4, Yi, Yj, Yd, *INCY, 19, &info );
333 if( info ) {
PB_Cabort( ctxt,
"PZATRMV", info );
return; }
359 PB_Cinfog2l( Yi, Yj, Yd, nprow, npcol, myrow, mycol, &Yii, &Yjj,
362 if( *INCY == Yd[
M_] )
367 if( ( myrow == Yrow ) || ( Yrow < 0 ) )
377 dascal_( &Ynq, ((
char *) BETA),
Mptr( ((
char *) Y), Yii,
378 Yjj, Yld, usiz ), &Yld );
387 if( ( mycol == Ycol ) || ( Ycol < 0 ) )
396 dascal_( &Ynp, ((
char *) BETA),
Mptr( ((
char *) Y), Yii,
397 Yjj, Yd[
LLD_], usiz ), INCY );
406 PB_Cdescribe( *N, *N, Ai, Aj, Ad, nprow, npcol, myrow, mycol, &Aii, &Ajj,
407 &Ald, &Aimb1, &Ainb1, &Amb, &Anb, &Arow, &Acol, Ad0 );
417 Yi, Yj, Yd, &Yroc, ((
char**)(&tbeta)), &YA, YAd, &YAfr,
422 PB_CInV( type,
NOCONJG,
ROW, *N, *N, Ad0, 1, ((
char *) X), Xi, Xj, Xd,
423 ( *INCX == Xd[
M_] ?
ROW :
COLUMN ), &XA, XAd, &XAfr );
430 PB_CInOutV( utyp,
ROW, *N, *N, Ad0, 1, ((
char *) BETA), ((
char *) Y),
431 Yi, Yj, Yd, &Yroc, ((
char**)(&tbeta)), &YA, YAd, &YAfr,
436 PB_CInV( type,
NOCONJG,
COLUMN, *N, *N, Ad0, 1, ((
char *) X), Xi, Xj, Xd,
437 ( *INCX == Xd[
M_] ?
ROW :
COLUMN ), &XA, XAd, &XAfr );
444 Aimb1 = Ad0[
IMB_ ]; Ainb1 = Ad0[
INB_ ]; Amb = Ad0[
MB_]; Anb = Ad0[
NB_];
446 Amp =
PB_Cnumroc( *N, 0, Aimb1, Amb, myrow, Arow, nprow );
447 Anq =
PB_Cnumroc( *N, 0, Ainb1, Anb, mycol, Acol, npcol );
449 if( ( Amp > 0 ) && ( Anq > 0 ) )
451 Aptr =
Mptr( ((
char *) A), Aii, Ajj, Ald, size );
457 if( notran && !( YApbY ) )
462 if( ( mycol == YAd[
CSRC_] ) || ( YAd[
CSRC_] < 0 ) )
468 dascal_( &Amp, ((
char *) tbeta), YA, &ione );
471 else if( !( notran ) && !( YApbY ) )
476 if( ( myrow == YAd[
RSRC_] ) || ( YAd[
RSRC_] < 0 ) )
482 dascal_( &Anq, ((
char *) tbeta), YA, &YAld );
490 PB_Clcm( ( Arow >= 0 ? nprow : 1 ), ( Acol >= 0 ? npcol : 1 ) );
496 for( k = 0; k < *N; k += nb )
498 kb = *N - k; kb =
MIN( kb, nb );
499 Akp =
PB_Cnumroc( k, 0, Aimb1, Amb, myrow, Arow, nprow );
500 Akq =
PB_Cnumroc( k, 0, Ainb1, Anb, mycol, Acol, npcol );
501 Anq0 =
PB_Cnumroc( kb, k, Ainb1, Anb, mycol, Acol, npcol );
502 if( Akp > 0 && Anq0 > 0 )
504 zagemv_( TRANS, &Akp, &Anq0, ((
char *) ALPHA),
505 Mptr( Aptr, 0, Akq, Ald, size ), &Ald,
506 Mptr( XA, 0, Akq, XAld, size ), &XAld, one,
510 ((
char *) ALPHA), Aptr, k, k, Ad0,
511 Mptr( XA, 0, Akq, XAld, size ), XAld,
517 for( k = 0; k < *N; k += nb )
519 kb = *N - k; kb =
MIN( kb, nb );
520 Akp =
PB_Cnumroc( k, 0, Aimb1, Amb, myrow, Arow, nprow );
521 Akq =
PB_Cnumroc( k, 0, Ainb1, Anb, mycol, Acol, npcol );
522 Anq0 =
PB_Cnumroc( kb, k, Ainb1, Anb, mycol, Acol, npcol );
523 if( Akp > 0 && Anq0 > 0 )
525 zagemv_( TRANS, &Akp, &Anq0, ((
char *) ALPHA),
526 Mptr( Aptr, 0, Akq, Ald, size ), &Ald, XA, &ione,
527 one,
Mptr( YA, 0, Akq, YAld, usiz ), &YAld );
530 ((
char *) ALPHA), Aptr, k, k, Ad0,
531 Mptr( XA, Akp, 0, XAld, size ), XAld,
540 for( k = 0; k < *N; k += nb )
542 kb = *N - k; ktmp = k + ( kb =
MIN( kb, nb ) );
543 Akp =
PB_Cnumroc( k, 0, Aimb1, Amb, myrow, Arow, nprow );
544 Akq =
PB_Cnumroc( k, 0, Ainb1, Anb, mycol, Acol, npcol );
546 ((
char *) ALPHA), Aptr, k, k, Ad0,
547 Mptr( XA, 0, Akq, XAld, size ), XAld,
549 Akp =
PB_Cnumroc( ktmp, 0, Aimb1, Amb, myrow, Arow, nprow );
551 Anq0 =
PB_Cnumroc( kb, k, Ainb1, Anb, mycol, Acol, npcol );
552 if( Amp0 > 0 && Anq0 > 0 )
554 zagemv_( TRANS, &Amp0, &Anq0, ((
char *) ALPHA),
555 Mptr( Aptr, Akp, Akq, Ald, size ), &Ald,
556 Mptr( XA, 0, Akq, XAld, size ), &XAld, one,
557 Mptr( YA, Akp, 0, YAld, usiz ), &ione );
563 for( k = 0; k < *N; k += nb )
565 kb = *N - k; ktmp = k + ( kb =
MIN( kb, nb ) );
566 Akp =
PB_Cnumroc( k, 0, Aimb1, Amb, myrow, Arow, nprow );
567 Akq =
PB_Cnumroc( k, 0, Ainb1, Anb, mycol, Acol, npcol );
569 ((
char *) ALPHA), Aptr, k, k, Ad0,
570 Mptr( XA, Akp, 0, XAld, size ), XAld,
572 Akp =
PB_Cnumroc( ktmp, 0, Aimb1, Amb, myrow, Arow, nprow );
574 Anq0 =
PB_Cnumroc( kb, k, Ainb1, Anb, mycol, Acol, npcol );
575 if( Amp0 > 0 && Anq0 > 0 )
577 zagemv_( TRANS, &Amp0, &Anq0, one,
578 Mptr( Aptr, Akp, Akq, Ald, size ), &Ald,
579 Mptr( XA, Akp, 0, XAld, size ), &ione, one,
580 Mptr( YA, 0, Akq, YAld, usiz ), &YAld );
586 if( XAfr ) free( XA );
593 if( YAsum && ( Amp > 0 ) )
605 if( YAsum && ( Anq > 0 ) )
620 PB_Cinfog2l( Yi, Yj, Yd, nprow, npcol, myrow, mycol, &Yii, &Yjj, &Yrow,
623 if( *INCY == Yd[
M_] )
628 if( ( myrow == Yrow ) || ( Yrow < 0 ) )
638 dascal_( &Ynq, ((
char *) BETA),
Mptr( ((
char *) Y), Yii,
639 Yjj, Yld, usiz ), &Yld );
648 if( ( mycol == Ycol ) || ( Ycol < 0 ) )
657 dascal_( &Ynp, ((
char *) BETA),
Mptr( ((
char *) Y), Yii,
658 Yjj, Yd[
LLD_], usiz ), INCY );
665 PB_Cpaxpby( utyp,
NOCONJG, *N, 1, one, YA, 0, 0, YAd,
COLUMN, one,
666 ((
char *) Y), Yi, Yj, Yd, &Yroc );
670 PB_Cpaxpby( utyp,
NOCONJG, 1, *N, one, YA, 0, 0, YAd,
ROW, one,
671 ((
char *) Y), Yi, Yj, Yd, &Yroc );
674 if( YAfr ) free( YA );