21 float * A,
int * IA,
int * JA,
int * DESCA,
22 float * X,
int * IX,
int * JX,
int * DESCX,
25 void pstrmv_( UPLO, TRANS, DIAG, N, A, IA, JA, DESCA, X, IX, JX,
31 int * IA, * INCX, * IX, * JA, * JX, * N;
221 char DiagA, TranOp, UploA, Xroc, * one, * tbeta, top, *zero;
222 int Acol, Ai, Aii, Aimb1, Ainb1, Aj, Ajj, Akp, Akq, Ald, Amb,
223 Amp, Amp0, Anb, Anq, Anq0, Arow, XAfr, XAld, Xcol, Xi, Xii,
224 Xj, Xjj, Xld, Xnp, Xnq, Xrow, YAfr, YAld, YApbY, YAsum,
225 ctxt, info, ione=1, k, kb, ktmp, mycol, myrow, nb, notran,
226 nounit, npcol, nprow, size, upper;
232 char * Aptr = NULL, * XA = NULL, * YA = NULL;
247 if( !( info = ( ( nprow == -1 ) ? -( 801 +
CTXT_ ) : 0 ) ) )
249 if( ( !upper ) && ( UploA !=
CLOWER ) )
251 PB_Cwarn( ctxt, __LINE__,
"PSTRMV",
"Illegal UPLO = %c\n", UploA );
254 else if( ( !notran ) && ( TranOp !=
CTRAN ) && ( TranOp !=
CCOTRAN ) )
256 PB_Cwarn( ctxt, __LINE__,
"PSTRMV",
"Illegal TRANS = %c\n", TranOp );
259 else if( ( !nounit ) && ( DiagA !=
CUNIT ) )
261 PB_Cwarn( ctxt, __LINE__,
"PSTRMV",
"Illegal DIAG = %c\n", DiagA );
264 PB_Cchkmat( ctxt,
"PSTRMV",
"A", *N, 4, *N, 4, Ai, Aj, Ad, 8, &info );
265 PB_Cchkvec( ctxt,
"PSTRMV",
"X", *N, 4, Xi, Xj, Xd, *INCX, 12, &info );
267 if( info ) {
PB_Cabort( ctxt,
"PSTRMV", info );
return; }
272 if( *N == 0 )
return;
283 size = type->
size; one = type->
one; zero = type->
zero;
287 PB_Cdescribe( *N, *N, Ai, Aj, Ad, nprow, npcol, myrow, mycol, &Aii, &Ajj,
288 &Ald, &Aimb1, &Ainb1, &Amb, &Anb, &Arow, &Acol, Ad0 );
297 PB_CInV( type,
NOCONJG,
ROW, *N, *N, Ad0, 1, ((
char *) X), Xi, Xj, Xd,
298 &Xroc, &XA, XAd, &XAfr );
302 PB_CInOutV( type,
COLUMN, *N, *N, Ad0, 1, one, ((
char *) X), Xi, Xj, Xd,
303 &Xroc, &tbeta, &YA, YAd, &YAfr, &YAsum, &YApbY );
312 PB_Cinfog2l( Xi, Xj, Xd, nprow, npcol, myrow, mycol, &Xii, &Xjj, &Xrow,
317 if( ( mycol == Xcol ) || ( Xcol < 0 ) )
337 PB_CInV( type,
NOCONJG,
COLUMN, *N, *N, Ad0, 1, ((
char *) X), Xi, Xj, Xd,
338 &Xroc, &XA, XAd, &XAfr );
342 PB_CInOutV( type,
ROW, *N, *N, Ad0, 1, one, ((
char *) X), Xi, Xj, Xd,
343 &Xroc, &tbeta, &YA, YAd, &YAfr, &YAsum, &YApbY );
352 PB_Cinfog2l( Xi, Xj, Xd, nprow, npcol, myrow, mycol, &Xii, &Xjj, &Xrow,
357 if( ( myrow == Xrow ) || ( Xrow < 0 ) )
367 sset_( &Xnq, zero,
Mptr( ((
char *) X), Xii, Xjj, Xld,
376 Aimb1 = Ad0[
IMB_ ]; Ainb1 = Ad0[
INB_ ]; Amb = Ad0[
MB_]; Anb = Ad0[
NB_];
378 Amp =
PB_Cnumroc( *N, 0, Aimb1, Amb, myrow, Arow, nprow );
379 Anq =
PB_Cnumroc( *N, 0, Ainb1, Anb, mycol, Acol, npcol );
381 if( ( Amp > 0 ) && ( Anq > 0 ) )
383 Aptr =
Mptr( ((
char *) A), Aii, Ajj, Ald, size );
391 PB_Clcm( ( Arow >= 0 ? nprow : 1 ), ( Acol >= 0 ? npcol : 1 ) );
397 for( k = 0; k < *N; k += nb )
399 kb = *N - k; kb =
MIN( kb, nb );
400 Akp =
PB_Cnumroc( k, 0, Aimb1, Amb, myrow, Arow, nprow );
401 Akq =
PB_Cnumroc( k, 0, Ainb1, Anb, mycol, Acol, npcol );
402 Anq0 =
PB_Cnumroc( kb, k, Ainb1, Anb, mycol, Acol, npcol );
403 if( Akp > 0 && Anq0 > 0 )
405 sgemv_( TRANS, &Akp, &Anq0, one,
Mptr( Aptr, 0, Akq, Ald,
406 size ), &Ald,
Mptr( XA, 0, Akq, XAld, size ),
407 &XAld, one, YA, &ione );
410 Aptr, k, k, Ad0,
Mptr( XA, 0, Akq, XAld, size ), XAld,
416 for( k = 0; k < *N; k += nb )
418 kb = *N - k; kb =
MIN( kb, nb );
419 Akp =
PB_Cnumroc( k, 0, Aimb1, Amb, myrow, Arow, nprow );
420 Akq =
PB_Cnumroc( k, 0, Ainb1, Anb, mycol, Acol, npcol );
421 Anq0 =
PB_Cnumroc( kb, k, Ainb1, Anb, mycol, Acol, npcol );
422 if( Akp > 0 && Anq0 > 0 )
424 sgemv_( TRANS, &Akp, &Anq0, one,
Mptr( Aptr, 0, Akq, Ald,
425 size ), &Ald, XA, &ione, one,
Mptr( YA, 0, Akq, YAld,
429 Aptr, k, k, Ad0,
Mptr( XA, Akp, 0, XAld, size ), XAld,
438 for( k = 0; k < *N; k += nb )
440 kb = *N - k; ktmp = k + ( kb =
MIN( kb, nb ) );
441 Akp =
PB_Cnumroc( k, 0, Aimb1, Amb, myrow, Arow, nprow );
442 Akq =
PB_Cnumroc( k, 0, Ainb1, Anb, mycol, Acol, npcol );
444 Aptr, k, k, Ad0,
Mptr( XA, 0, Akq, XAld, size ), XAld,
446 Akp =
PB_Cnumroc( ktmp, 0, Aimb1, Amb, myrow, Arow, nprow );
448 Anq0 =
PB_Cnumroc( kb, k, Ainb1, Anb, mycol, Acol, npcol );
449 if( Amp0 > 0 && Anq0 > 0 )
451 sgemv_( TRANS, &Amp0, &Anq0, one,
452 Mptr( Aptr, Akp, Akq, Ald, size ), &Ald,
453 Mptr( XA, 0, Akq, XAld, size ), &XAld, one,
454 Mptr( YA, Akp, 0, YAld, size ), &ione );
460 for( k = 0; k < *N; k += nb )
462 kb = *N - k; ktmp = k + ( kb =
MIN( kb, nb ) );
463 Akp =
PB_Cnumroc( k, 0, Aimb1, Amb, myrow, Arow, nprow );
464 Akq =
PB_Cnumroc( k, 0, Ainb1, Anb, mycol, Acol, npcol );
466 Aptr, k, k, Ad0,
Mptr( XA, Akp, 0, XAld, size ), XAld,
468 Akp =
PB_Cnumroc( ktmp, 0, Aimb1, Amb, myrow, Arow, nprow );
470 Anq0 =
PB_Cnumroc( kb, k, Ainb1, Anb, mycol, Acol, npcol );
471 if( Amp0 > 0 && Anq0 > 0 )
473 sgemv_( TRANS, &Amp0, &Anq0, one,
474 Mptr( Aptr, Akp, Akq, Ald, size ), &Ald,
475 Mptr( XA, Akp, 0, XAld, size ), &ione, one,
476 Mptr( YA, 0, Akq, YAld, size ), &YAld );
482 if( XAfr ) free( XA );
489 if( YAsum && ( Amp > 0 ) )
500 PB_Cpaxpby( type,
NOCONJG, *N, 1, one, YA, 0, 0, YAd,
COLUMN, zero,
501 ((
char *) X), Xi, Xj, Xd, &Xroc );
509 if( YAsum && ( Anq > 0 ) )
520 PB_Cpaxpby( type,
NOCONJG, 1, *N, one, YA, 0, 0, YAd,
ROW, zero,
521 ((
char *) X), Xi, Xj, Xd, &Xroc );
524 if( YAfr ) free( YA );