22 float * A,
int * IA,
int * JA,
int * DESCA,
23 float * X,
int * IX,
int * JX,
int * DESCX,
24 int * INCX,
float * BETA,
25 float * Y,
int * IY,
int * JY,
int * DESCY,
28 void psatrmv_( 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 float * ALPHA, * BETA;
40 int * DESCA, * DESCX, * DESCY;
279 char DiagA, TranOp, UploA, Yroc, * one, top;
280 int Acol, Ai, Aii, Aimb1, Ainb1, Aj, Ajj, Akp, Akq, Ald, Amb,
281 Amp, Amp0, Anb, Anq, Anq0, Arow, XAfr, XAld, Xi, Xj, YAfr,
282 YAld, YApbY, YAsum, Ycol, Yi, Yii, Yj, Yjj, Yld, Ynp, Ynq,
283 Yrow, ctxt, info, ione=1, k, kb, ktmp, mycol, myrow, nb,
284 notran, nounit, npcol, nprow, size, upper, usiz;
292 char * Aptr = NULL, * XA = NULL, * YA = NULL;
308 if( !( info = ( ( nprow == -1 ) ? -( 801 +
CTXT_ ) : 0 ) ) )
310 if( ( !upper ) && ( UploA !=
CLOWER ) )
312 PB_Cwarn( ctxt, __LINE__,
"PSATRMV",
"Illegal UPLO = %c\n", UploA );
315 else if( ( !notran ) && ( TranOp !=
CTRAN ) && ( TranOp !=
CCOTRAN ) )
317 PB_Cwarn( ctxt, __LINE__,
"PSATRMV",
"Illegal TRANS = %c\n", TranOp );
320 else if( ( !nounit ) && ( DiagA !=
CUNIT ) )
322 PB_Cwarn( ctxt, __LINE__,
"PSATRMV",
"Illegal DIAG = %c\n", DiagA );
325 PB_Cchkmat( ctxt,
"PSATRMV",
"A", *N, 4, *N, 4, Ai, Aj, Ad, 9, &info );
326 PB_Cchkvec( ctxt,
"PSATRMV",
"X", *N, 4, Xi, Xj, Xd, *INCX, 13, &info );
327 PB_Cchkvec( ctxt,
"PSATRMV",
"Y", *N, 4, Yi, Yj, Yd, *INCY, 19, &info );
329 if( info ) {
PB_Cabort( ctxt,
"PSATRMV", info );
return; }
346 size = usiz = type->
size;
355 PB_Cinfog2l( Yi, Yj, Yd, nprow, npcol, myrow, mycol, &Yii, &Yjj,
358 if( *INCY == Yd[
M_] )
363 if( ( myrow == Yrow ) || ( Yrow < 0 ) )
373 sascal_( &Ynq, ((
char *) BETA),
Mptr( ((
char *) Y), Yii,
374 Yjj, Yld, usiz ), &Yld );
383 if( ( mycol == Ycol ) || ( Ycol < 0 ) )
392 sascal_( &Ynp, ((
char *) BETA),
Mptr( ((
char *) Y), Yii,
393 Yjj, Yd[
LLD_], usiz ), INCY );
402 PB_Cdescribe( *N, *N, Ai, Aj, Ad, nprow, npcol, myrow, mycol, &Aii, &Ajj,
403 &Ald, &Aimb1, &Ainb1, &Amb, &Anb, &Arow, &Acol, Ad0 );
413 Yi, Yj, Yd, &Yroc, ((
char**)(&tbeta)), &YA, YAd, &YAfr,
418 PB_CInV( type,
NOCONJG,
ROW, *N, *N, Ad0, 1, ((
char *) X), Xi, Xj, Xd,
419 ( *INCX == Xd[
M_] ?
ROW :
COLUMN ), &XA, XAd, &XAfr );
426 PB_CInOutV( utyp,
ROW, *N, *N, Ad0, 1, ((
char *) BETA), ((
char *) Y),
427 Yi, Yj, Yd, &Yroc, ((
char**)(&tbeta)), &YA, YAd, &YAfr,
432 PB_CInV( type,
NOCONJG,
COLUMN, *N, *N, Ad0, 1, ((
char *) X), Xi, Xj, Xd,
433 ( *INCX == Xd[
M_] ?
ROW :
COLUMN ), &XA, XAd, &XAfr );
440 Aimb1 = Ad0[
IMB_ ]; Ainb1 = Ad0[
INB_ ]; Amb = Ad0[
MB_]; Anb = Ad0[
NB_];
442 Amp =
PB_Cnumroc( *N, 0, Aimb1, Amb, myrow, Arow, nprow );
443 Anq =
PB_Cnumroc( *N, 0, Ainb1, Anb, mycol, Acol, npcol );
445 if( ( Amp > 0 ) && ( Anq > 0 ) )
447 Aptr =
Mptr( ((
char *) A), Aii, Ajj, Ald, size );
453 if( notran && !( YApbY ) )
458 if( ( mycol == YAd[
CSRC_] ) || ( YAd[
CSRC_] < 0 ) )
464 sascal_( &Amp, ((
char *) tbeta), YA, &ione );
467 else if( !( notran ) && !( YApbY ) )
472 if( ( myrow == YAd[
RSRC_] ) || ( YAd[
RSRC_] < 0 ) )
478 sascal_( &Anq, ((
char *) tbeta), YA, &YAld );
486 PB_Clcm( ( Arow >= 0 ? nprow : 1 ), ( Acol >= 0 ? npcol : 1 ) );
492 for( k = 0; k < *N; k += nb )
494 kb = *N - k; kb =
MIN( kb, nb );
495 Akp =
PB_Cnumroc( k, 0, Aimb1, Amb, myrow, Arow, nprow );
496 Akq =
PB_Cnumroc( k, 0, Ainb1, Anb, mycol, Acol, npcol );
497 Anq0 =
PB_Cnumroc( kb, k, Ainb1, Anb, mycol, Acol, npcol );
498 if( Akp > 0 && Anq0 > 0 )
500 sagemv_( TRANS, &Akp, &Anq0, ((
char *) ALPHA),
501 Mptr( Aptr, 0, Akq, Ald, size ), &Ald,
502 Mptr( XA, 0, Akq, XAld, size ), &XAld, one,
506 ((
char *) ALPHA), Aptr, k, k, Ad0,
507 Mptr( XA, 0, Akq, XAld, size ), XAld,
513 for( k = 0; k < *N; k += nb )
515 kb = *N - k; kb =
MIN( kb, nb );
516 Akp =
PB_Cnumroc( k, 0, Aimb1, Amb, myrow, Arow, nprow );
517 Akq =
PB_Cnumroc( k, 0, Ainb1, Anb, mycol, Acol, npcol );
518 Anq0 =
PB_Cnumroc( kb, k, Ainb1, Anb, mycol, Acol, npcol );
519 if( Akp > 0 && Anq0 > 0 )
521 sagemv_( TRANS, &Akp, &Anq0, ((
char *) ALPHA),
522 Mptr( Aptr, 0, Akq, Ald, size ), &Ald, XA, &ione,
523 one,
Mptr( YA, 0, Akq, YAld, usiz ), &YAld );
526 ((
char *) ALPHA), Aptr, k, k, Ad0,
527 Mptr( XA, Akp, 0, XAld, size ), XAld,
536 for( k = 0; k < *N; k += nb )
538 kb = *N - k; ktmp = k + ( kb =
MIN( kb, nb ) );
539 Akp =
PB_Cnumroc( k, 0, Aimb1, Amb, myrow, Arow, nprow );
540 Akq =
PB_Cnumroc( k, 0, Ainb1, Anb, mycol, Acol, npcol );
542 ((
char *) ALPHA), Aptr, k, k, Ad0,
543 Mptr( XA, 0, Akq, XAld, size ), XAld,
545 Akp =
PB_Cnumroc( ktmp, 0, Aimb1, Amb, myrow, Arow, nprow );
547 Anq0 =
PB_Cnumroc( kb, k, Ainb1, Anb, mycol, Acol, npcol );
548 if( Amp0 > 0 && Anq0 > 0 )
550 sagemv_( TRANS, &Amp0, &Anq0, ((
char *) ALPHA),
551 Mptr( Aptr, Akp, Akq, Ald, size ), &Ald,
552 Mptr( XA, 0, Akq, XAld, size ), &XAld, one,
553 Mptr( YA, Akp, 0, YAld, usiz ), &ione );
559 for( k = 0; k < *N; k += nb )
561 kb = *N - k; ktmp = k + ( kb =
MIN( kb, nb ) );
562 Akp =
PB_Cnumroc( k, 0, Aimb1, Amb, myrow, Arow, nprow );
563 Akq =
PB_Cnumroc( k, 0, Ainb1, Anb, mycol, Acol, npcol );
565 ((
char *) ALPHA), Aptr, k, k, Ad0,
566 Mptr( XA, Akp, 0, XAld, size ), XAld,
568 Akp =
PB_Cnumroc( ktmp, 0, Aimb1, Amb, myrow, Arow, nprow );
570 Anq0 =
PB_Cnumroc( kb, k, Ainb1, Anb, mycol, Acol, npcol );
571 if( Amp0 > 0 && Anq0 > 0 )
573 sagemv_( TRANS, &Amp0, &Anq0, one,
574 Mptr( Aptr, Akp, Akq, Ald, size ), &Ald,
575 Mptr( XA, Akp, 0, XAld, size ), &ione, one,
576 Mptr( YA, 0, Akq, YAld, usiz ), &YAld );
582 if( XAfr ) free( XA );
589 if( YAsum && ( Amp > 0 ) )
601 if( YAsum && ( Anq > 0 ) )
616 PB_Cinfog2l( Yi, Yj, Yd, nprow, npcol, myrow, mycol, &Yii, &Yjj, &Yrow,
619 if( *INCY == Yd[
M_] )
624 if( ( myrow == Yrow ) || ( Yrow < 0 ) )
634 sascal_( &Ynq, ((
char *) BETA),
Mptr( ((
char *) Y), Yii,
635 Yjj, Yld, usiz ), &Yld );
644 if( ( mycol == Ycol ) || ( Ycol < 0 ) )
653 sascal_( &Ynp, ((
char *) BETA),
Mptr( ((
char *) Y), Yii,
654 Yjj, Yd[
LLD_], usiz ), INCY );
661 PB_Cpaxpby( utyp,
NOCONJG, *N, 1, one, YA, 0, 0, YAd,
COLUMN, one,
662 ((
char *) Y), Yi, Yj, Yd, &Yroc );
666 PB_Cpaxpby( utyp,
NOCONJG, 1, *N, one, YA, 0, 0, YAd,
ROW, one,
667 ((
char *) Y), Yi, Yj, Yd, &Yroc );
670 if( YAfr ) free( YA );