21 float * A,
int * IA,
int * JA,
int * DESCA,
22 float * X,
int * IX,
int * JX,
int * DESCX,
int * INCX,
24 float * Y,
int * IY,
int * JY,
int * DESCY,
int * INCY )
26 void psagemv_( TRANS, M, N, ALPHA, A, IA, JA, DESCA, X, IX, JX, DESCX,
27 INCX, BETA, Y, IY, JY, DESCY, INCY )
32 int * IA, * INCX, * INCY, * IX, * IY, * JA, * JX, * JY,
34 float * ALPHA, * BETA;
38 int * DESCA, * DESCX, * DESCY;
257 char TrA, Yroc, * one, * tbeta, top;
258 int Acol, Ai, Aii, Aimb1, Ainb1, Aj, Ajj, Ald, Amb, Amp, Anb,
259 Anq, Arow, XAfr, Xi, Xj, YAfr, YApbY, YAsum, Ycol, Yi, Yii,
260 Yj, Yjj, Yld, Ynp, Ynq, Yrow, ctxt, info, ione=1, mycol,
261 myrow, nota, npcol, nprow;
268 char * XA = NULL, * YA = NULL;
282 if( !( info = ( ( nprow == -1 ) ? -( 801 +
CTXT_ ) : 0 ) ) )
284 if( ( !nota ) && ( TrA !=
CTRAN ) && ( TrA !=
CCOTRAN ) )
286 PB_Cwarn( ctxt, __LINE__,
"PSAGEMV",
"Illegal TRANS=%c\n", TrA );
289 PB_Cchkmat( ctxt,
"PSAGEMV",
"A", *M, 2, *N, 3, Ai, Aj, Ad, 8,
293 PB_Cchkvec( ctxt,
"PSAGEMV",
"X", *N, 3, Xi, Xj, Xd, *INCX, 12,
295 PB_Cchkvec( ctxt,
"PSAGEMV",
"Y", *M, 2, Yi, Yj, Yd, *INCY, 18,
300 PB_Cchkvec( ctxt,
"PSAGEMV",
"X", *M, 2, Xi, Xj, Xd, *INCX, 12,
302 PB_Cchkvec( ctxt,
"PSAGEMV",
"Y", *N, 3, Yi, Yj, Yd, *INCY, 18,
306 if( info ) {
PB_Cabort( ctxt,
"PSAGEMV", info );
return; }
311 if( ( *M == 0 ) || ( *N == 0 ) ||
332 PB_Cinfog2l( Yi, Yj, Yd, nprow, npcol, myrow, mycol, &Yii, &Yjj,
335 if( *INCY == Yd[
M_] )
340 if( ( myrow == Yrow ) || ( Yrow < 0 ) )
350 sascal_( &Ynq, ((
char *) BETA),
Mptr( ((
char *) Y), Yii,
351 Yjj, Yld, utyp->
size ), &Yld );
360 if( ( mycol == Ycol ) || ( Ycol < 0 ) )
369 sascal_( &Ynp, ((
char *) BETA),
Mptr( ((
char *) Y), Yii,
370 Yjj, Yd[
LLD_], utyp->
size ), INCY );
379 PB_Cdescribe( *M, *N, Ai, Aj, Ad, nprow, npcol, myrow, mycol, &Aii, &Ajj,
380 &Ald, &Aimb1, &Ainb1, &Amb, &Anb, &Arow, &Acol, Ad0 );
390 Yi, Yj, Yd, &Yroc, &tbeta, &YA, YAd, &YAfr, &YAsum, &YApbY );
394 PB_CInV( type,
NOCONJG,
ROW, *M, *N, Ad0, 1, ((
char *) X), Xi, Xj, Xd,
395 ( *INCX == Xd[
M_] ?
ROW :
COLUMN ), &XA, XAd, &XAfr );
401 if( ( Amp > 0 ) && ( Anq > 0 ) )
403 sagemv_( TRANS, &Amp, &Anq, ((
char *) ALPHA),
Mptr( ((
char *) A),
404 Aii, Ajj, Ald, type->
size), &Ald, XA, &XAd[
LLD_], tbeta,
407 if( XAfr ) free( XA );
411 if( YAsum && ( Amp > 0 ) )
423 PB_CInOutV( utyp,
ROW, *M, *N, Ad0, 1, ((
char *) BETA), ((
char *) Y), Yi,
424 Yj, Yd, &Yroc, &tbeta, &YA, YAd, &YAfr, &YAsum, &YApbY );
428 PB_CInV( type,
NOCONJG,
COLUMN, *M, *N, Ad0, 1, ((
char *) X), Xi, Xj, Xd,
429 ( *INCX == Xd[
M_] ?
ROW :
COLUMN ), &XA, XAd, &XAfr );
435 if( ( Amp > 0 ) && ( Anq > 0 ) )
437 sagemv_( TRANS, &Amp, &Anq, ((
char *) ALPHA),
Mptr( ((
char *) A),
438 Aii, Ajj, Ald, type->
size ), &Ald, XA, &ione, tbeta, YA,
441 if( XAfr ) free( XA );
445 if( YAsum && ( Anq > 0 ) )
460 PB_Cinfog2l( Yi, Yj, Yd, nprow, npcol, myrow, mycol, &Yii, &Yjj, &Yrow,
463 if( *INCY == Yd[
M_] )
468 if( ( myrow == Yrow ) || ( Yrow < 0 ) )
478 sascal_( &Ynq, ((
char *) BETA),
Mptr( ((
char *) Y), Yii,
479 Yjj, Yld, utyp->
size ), &Yld );
488 if( ( mycol == Ycol ) || ( Ycol < 0 ) )
497 sascal_( &Ynp, ((
char *) BETA),
Mptr( ((
char *) Y), Yii,
498 Yjj, Yd[
LLD_], utyp->
size ), INCY );
507 PB_Cpaxpby( utyp,
NOCONJG, *M, 1, one, YA, 0, 0, YAd,
COLUMN, one,
508 ((
char *) Y), Yi, Yj, Yd, &Yroc );
512 PB_Cpaxpby( utyp,
NOCONJG, 1, *N, one, YA, 0, 0, YAd,
ROW, one,
513 ((
char *) Y), Yi, Yj, Yd, &Yroc );
516 if( YAfr ) free( YA );