21 float * A,
int * IA,
int * JA,
int * DESCA,
22 float * X,
int * IX,
int * JX,
int * DESCX,
25 void pctrmv_( UPLO, TRANS, DIAG, N, A, IA, JA, DESCA, X, IX, JX,
31 int * IA, * INCX, * IX, * JA, * JX, * N;
226 char DiagA, TranOp, UploA, Xroc, * one, * tbeta, top, *zero;
227 int Acol, Ai, Aii, Aimb1, Ainb1, Aj, Ajj, Akp, Akq, Ald, Amb,
228 Amp, Amp0, Anb, Anq, Anq0, Arow, XAfr, XAld, Xcol, Xi, Xii,
229 Xj, Xjj, Xld, Xnp, Xnq, Xrow, YAfr, YAld, YApbY, YAsum,
230 ctxt, info, ione=1, k, kb, ktmp, mycol, myrow, nb, notran,
231 nounit, npcol, nprow, size, upper;
237 char * Aptr = NULL, * XA = NULL, * YA = NULL;
252 if( !( info = ( ( nprow == -1 ) ? -( 801 +
CTXT_ ) : 0 ) ) )
254 if( ( !upper ) && ( UploA !=
CLOWER ) )
256 PB_Cwarn( ctxt, __LINE__,
"PCTRMV",
"Illegal UPLO = %c\n", UploA );
259 else if( ( !notran ) && ( TranOp !=
CTRAN ) && ( TranOp !=
CCOTRAN ) )
261 PB_Cwarn( ctxt, __LINE__,
"PCTRMV",
"Illegal TRANS = %c\n", TranOp );
264 else if( ( !nounit ) && ( DiagA !=
CUNIT ) )
266 PB_Cwarn( ctxt, __LINE__,
"PCTRMV",
"Illegal DIAG = %c\n", DiagA );
269 PB_Cchkmat( ctxt,
"PCTRMV",
"A", *N, 4, *N, 4, Ai, Aj, Ad, 8, &info );
270 PB_Cchkvec( ctxt,
"PCTRMV",
"X", *N, 4, Xi, Xj, Xd, *INCX, 12, &info );
272 if( info ) {
PB_Cabort( ctxt,
"PCTRMV", info );
return; }
277 if( *N == 0 )
return;
288 size = type->
size; one = type->
one; zero = type->
zero;
292 PB_Cdescribe( *N, *N, Ai, Aj, Ad, nprow, npcol, myrow, mycol, &Aii, &Ajj,
293 &Ald, &Aimb1, &Ainb1, &Amb, &Anb, &Arow, &Acol, Ad0 );
302 PB_CInV( type,
NOCONJG,
ROW, *N, *N, Ad0, 1, ((
char *) X), Xi, Xj, Xd,
303 &Xroc, &XA, XAd, &XAfr );
307 PB_CInOutV( type,
COLUMN, *N, *N, Ad0, 1, one, ((
char *) X), Xi, Xj, Xd,
308 &Xroc, &tbeta, &YA, YAd, &YAfr, &YAsum, &YApbY );
317 PB_Cinfog2l( Xi, Xj, Xd, nprow, npcol, myrow, mycol, &Xii, &Xjj, &Xrow,
322 if( ( mycol == Xcol ) || ( Xcol < 0 ) )
342 PB_CInV( type,
NOCONJG,
COLUMN, *N, *N, Ad0, 1, ((
char *) X), Xi, Xj, Xd,
343 &Xroc, &XA, XAd, &XAfr );
347 PB_CInOutV( type,
ROW, *N, *N, Ad0, 1, one, ((
char *) X), Xi, Xj, Xd,
348 &Xroc, &tbeta, &YA, YAd, &YAfr, &YAsum, &YApbY );
357 PB_Cinfog2l( Xi, Xj, Xd, nprow, npcol, myrow, mycol, &Xii, &Xjj, &Xrow,
362 if( ( myrow == Xrow ) || ( Xrow < 0 ) )
372 cset_( &Xnq, zero,
Mptr( ((
char *) X), Xii, Xjj, Xld,
381 Aimb1 = Ad0[
IMB_ ]; Ainb1 = Ad0[
INB_ ]; Amb = Ad0[
MB_]; Anb = Ad0[
NB_];
383 Amp =
PB_Cnumroc( *N, 0, Aimb1, Amb, myrow, Arow, nprow );
384 Anq =
PB_Cnumroc( *N, 0, Ainb1, Anb, mycol, Acol, npcol );
386 if( ( Amp > 0 ) && ( Anq > 0 ) )
388 Aptr =
Mptr( ((
char *) A), Aii, Ajj, Ald, size );
396 PB_Clcm( ( Arow >= 0 ? nprow : 1 ), ( Acol >= 0 ? npcol : 1 ) );
402 for( k = 0; k < *N; k += nb )
404 kb = *N - k; kb =
MIN( kb, nb );
405 Akp =
PB_Cnumroc( k, 0, Aimb1, Amb, myrow, Arow, nprow );
406 Akq =
PB_Cnumroc( k, 0, Ainb1, Anb, mycol, Acol, npcol );
407 Anq0 =
PB_Cnumroc( kb, k, Ainb1, Anb, mycol, Acol, npcol );
408 if( Akp > 0 && Anq0 > 0 )
410 cgemv_( TRANS, &Akp, &Anq0, one,
Mptr( Aptr, 0, Akq, Ald,
411 size ), &Ald,
Mptr( XA, 0, Akq, XAld, size ),
412 &XAld, one, YA, &ione );
415 Aptr, k, k, Ad0,
Mptr( XA, 0, Akq, XAld, size ), XAld,
421 for( k = 0; k < *N; k += nb )
423 kb = *N - k; kb =
MIN( kb, nb );
424 Akp =
PB_Cnumroc( k, 0, Aimb1, Amb, myrow, Arow, nprow );
425 Akq =
PB_Cnumroc( k, 0, Ainb1, Anb, mycol, Acol, npcol );
426 Anq0 =
PB_Cnumroc( kb, k, Ainb1, Anb, mycol, Acol, npcol );
427 if( Akp > 0 && Anq0 > 0 )
429 cgemv_( TRANS, &Akp, &Anq0, one,
Mptr( Aptr, 0, Akq, Ald,
430 size ), &Ald, XA, &ione, one,
Mptr( YA, 0, Akq, YAld,
434 Aptr, k, k, Ad0,
Mptr( XA, Akp, 0, XAld, size ), XAld,
443 for( k = 0; k < *N; k += nb )
445 kb = *N - k; ktmp = k + ( kb =
MIN( kb, nb ) );
446 Akp =
PB_Cnumroc( k, 0, Aimb1, Amb, myrow, Arow, nprow );
447 Akq =
PB_Cnumroc( k, 0, Ainb1, Anb, mycol, Acol, npcol );
449 Aptr, k, k, Ad0,
Mptr( XA, 0, Akq, XAld, size ), XAld,
451 Akp =
PB_Cnumroc( ktmp, 0, Aimb1, Amb, myrow, Arow, nprow );
453 Anq0 =
PB_Cnumroc( kb, k, Ainb1, Anb, mycol, Acol, npcol );
454 if( Amp0 > 0 && Anq0 > 0 )
456 cgemv_( TRANS, &Amp0, &Anq0, one,
457 Mptr( Aptr, Akp, Akq, Ald, size ), &Ald,
458 Mptr( XA, 0, Akq, XAld, size ), &XAld, one,
459 Mptr( YA, Akp, 0, YAld, size ), &ione );
465 for( k = 0; k < *N; k += nb )
467 kb = *N - k; ktmp = k + ( kb =
MIN( kb, nb ) );
468 Akp =
PB_Cnumroc( k, 0, Aimb1, Amb, myrow, Arow, nprow );
469 Akq =
PB_Cnumroc( k, 0, Ainb1, Anb, mycol, Acol, npcol );
471 Aptr, k, k, Ad0,
Mptr( XA, Akp, 0, XAld, size ), XAld,
473 Akp =
PB_Cnumroc( ktmp, 0, Aimb1, Amb, myrow, Arow, nprow );
475 Anq0 =
PB_Cnumroc( kb, k, Ainb1, Anb, mycol, Acol, npcol );
476 if( Amp0 > 0 && Anq0 > 0 )
478 cgemv_( TRANS, &Amp0, &Anq0, one,
479 Mptr( Aptr, Akp, Akq, Ald, size ), &Ald,
480 Mptr( XA, Akp, 0, XAld, size ), &ione, one,
481 Mptr( YA, 0, Akq, YAld, size ), &YAld );
487 if( XAfr ) free( XA );
494 if( YAsum && ( Amp > 0 ) )
505 PB_Cpaxpby( type,
NOCONJG, *N, 1, one, YA, 0, 0, YAd,
COLUMN, zero,
506 ((
char *) X), Xi, Xj, Xd, &Xroc );
514 if( YAsum && ( Anq > 0 ) )
525 PB_Cpaxpby( type,
NOCONJG, 1, *N, one, YA, 0, 0, YAd,
ROW, zero,
526 ((
char *) X), Xi, Xj, Xd, &Xroc );
529 if( YAfr ) free( YA );