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 psasymv_( UPLO, 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;
247 char UploA, * one, top;
248 int Acol, Ai, Aii, Aimb1, Ainb1, Aj, Ajj, Akp, Akq, Ald, Amb, Amp,
249 Amp0, Anb, Anq, Anq0, Arow, XCfr, XCld, XRfr, XRld, Xi, Xj,
250 YCfr, YCpbY, YCsum, YCld, YRfr, YRpbY, YRsum, YRld, Ycol, Yi,
251 Yii, YisRow, Yj, Yjj, Yld, Ynp, Ynq, Yrow, ctxt, info, ione=1,
252 k, kb, ktmp, mycol, myrow, nb, npcol, nprow, size, upper,
261 char * Aptr = NULL, * XC = NULL, * XR = NULL, * YC = NULL,
276 if( !( info = ( ( nprow == -1 ) ? -( 701 +
CTXT_ ) : 0 ) ) )
278 if( ( !upper ) && ( UploA !=
CLOWER ) )
280 PB_Cwarn( ctxt, __LINE__, __FILE__,
"Illegal UPLO = %c\n", UploA );
283 PB_Cchkmat( ctxt,
"PSASYMV",
"A", *N, 2, *N, 2, Ai, Aj, Ad, 7, &info );
284 PB_Cchkvec( ctxt,
"PSASYMV",
"X", *N, 2, Xi, Xj, Xd, *INCX, 11, &info );
285 PB_Cchkvec( ctxt,
"PSASYMV",
"Y", *N, 2, Yi, Yj, Yd, *INCY, 17, &info );
287 if( info ) {
PB_Cabort( ctxt,
"PSASYMV", info );
return; }
305 size = usiz = type->
size;
314 PB_Cinfog2l( Yi, Yj, Yd, nprow, npcol, myrow, mycol, &Yii, &Yjj,
317 if( *INCY == Yd[
M_] )
322 if( ( myrow == Yrow ) || ( Yrow < 0 ) )
332 sascal_( &Ynq, ((
char *) BETA),
Mptr( ((
char *) Y), Yii,
333 Yjj, Yld, usiz ), &Yld );
342 if( ( mycol == Ycol ) || ( Ycol < 0 ) )
351 sascal_( &Ynp, ((
char *) BETA),
Mptr( ((
char *) Y), Yii,
352 Yjj, Yd[
LLD_], usiz ), INCY );
361 PB_Cdescribe( *N, *N, Ai, Aj, Ad, nprow, npcol, myrow, mycol, &Aii, &Ajj,
362 &Ald, &Aimb1, &Ainb1, &Amb, &Anb, &Arow, &Acol, Ad0 );
367 if( ( YisRow = ( *INCY == Yd[
M_] ) ) != 0 )
369 PB_CInOutV( utyp,
ROW, *N, *N, Ad0, 1, ((
char *)BETA), ((
char *) Y),
370 Yi, Yj, Yd,
ROW, ((
char**)(&tbeta)), &YR, YRd, &YRfr,
372 PB_COutV( utyp,
COLUMN,
INIT, *N, *N, Ad0, 1, &YC, YCd, &YCfr, &YCsum );
377 Yi, Yj, Yd,
COLUMN, ((
char**)(&tbeta)), &YC, YCd, &YCfr,
379 PB_COutV( utyp,
ROW,
INIT, *N, *N, Ad0, 1, &YR, YRd, &YRfr, &YRsum );
385 if( *INCX == Xd[
M_] )
387 PB_CInV( type,
NOCONJG,
ROW, *N, *N, Ad0, 1, ((
char *) X), Xi, Xj, Xd,
388 ROW, &XR, XRd, &XRfr );
389 PB_CInV( type,
NOCONJG,
COLUMN, *N, *N, Ad0, 1, XR, 0, 0, XRd,
390 ROW, &XC, XCd, &XCfr );
394 PB_CInV( type,
NOCONJG,
COLUMN, *N, *N, Ad0, 1, ((
char *) X), Xi, Xj, Xd,
395 COLUMN, &XC, XCd, &XCfr );
396 PB_CInV( type,
NOCONJG,
ROW, *N, *N, Ad0, 1, XC, 0, 0, XCd,
397 COLUMN, &XR, XRd, &XRfr );
403 Aimb1 = Ad0[
IMB_ ]; Ainb1 = Ad0[
INB_ ]; Amb = Ad0[
MB_]; Anb = Ad0[
NB_];
405 Amp =
PB_Cnumroc( *N, 0, Aimb1, Amb, myrow, Arow, nprow );
406 Anq =
PB_Cnumroc( *N, 0, Ainb1, Anb, mycol, Acol, npcol );
408 if( ( Amp > 0 ) && ( Anq > 0 ) )
410 Aptr =
Mptr( ((
char *) A), Aii, Ajj, Ald, size );
423 if( ( myrow == YRd[
RSRC_] ) || ( YRd[
RSRC_] < 0 ) )
429 sascal_( &Anq, ((
char *) tbeta), YR, &YRld );
440 if( ( mycol == YCd[
CSRC_] ) || ( YCd[
CSRC_] < 0 ) )
446 sascal_( &Amp, ((
char *) tbeta), YC, &ione );
455 PB_Clcm( ( Arow >= 0 ? nprow : 1 ), ( Acol >= 0 ? npcol : 1 ) );
459 for( k = 0; k < *N; k += nb )
461 kb = *N - k; kb =
MIN( kb, nb );
462 Akp =
PB_Cnumroc( k, 0, Aimb1, Amb, myrow, Arow, nprow );
463 Akq =
PB_Cnumroc( k, 0, Ainb1, Anb, mycol, Acol, npcol );
464 Anq0 =
PB_Cnumroc( kb, k, Ainb1, Anb, mycol, Acol, npcol );
465 if( Akp > 0 && Anq0 > 0 )
468 Mptr( Aptr, 0, Akq, Ald, size ), &Ald,
Mptr( XR, 0, Akq,
469 XRld, size ), &XRld, one, YC, &ione );
471 Mptr( Aptr, 0, Akq, Ald, size ), &Ald, XC, &ione, one,
472 Mptr( YR, 0, Akq, YRld, usiz ), &YRld );
475 k, Ad0,
Mptr( XC, Akp, 0, XCld, size ), XCld,
Mptr( XR, 0,
476 Akq, XRld, size ), XRld,
Mptr( YC, Akp, 0, YCld, usiz ),
482 for( k = 0; k < *N; k += nb )
484 kb = *N - k; ktmp = k + ( kb =
MIN( kb, nb ) );
485 Akp =
PB_Cnumroc( k, 0, Aimb1, Amb, myrow, Arow, nprow );
486 Akq =
PB_Cnumroc( k, 0, Ainb1, Anb, mycol, Acol, npcol );
488 k, Ad0,
Mptr( XC, Akp, 0, XCld, size ), XCld,
Mptr( XR, 0,
489 Akq, XRld, size ), XRld,
Mptr( YC, Akp, 0, YCld, usiz ),
491 Akp =
PB_Cnumroc( ktmp, 0, Aimb1, Amb, myrow, Arow, nprow );
493 Anq0 =
PB_Cnumroc( kb, k, Ainb1, Anb, mycol, Acol, npcol );
494 if( Amp0 > 0 && Anq0 > 0 )
497 Mptr( Aptr, Akp, Akq, Ald, size ), &Ald,
Mptr( XR, 0,
498 Akq, XRld, size ), &XRld, one,
Mptr( YC, Akp, 0, YCld,
501 Mptr( Aptr, Akp, Akq, Ald, size ), &Ald,
Mptr( XC, Akp,
502 0, XCld, size ), &ione, one,
Mptr( YR, 0, Akq, YRld,
508 if( XCfr ) free( XC );
509 if( XRfr ) free( XR );
528 if( YRsum && ( Anq > 0 ) )
537 PB_Cpaxpby( utyp,
NOCONJG, *N, 1, one, YC, 0, 0, YCd,
COLUMN, one,
538 YR, 0, 0, YRd,
ROW );
547 PB_Cinfog2l( Yi, Yj, Yd, nprow, npcol, myrow, mycol, &Yii, &Yjj, &Yrow,
552 if( ( myrow == Yrow ) || Yrow < 0 )
562 sascal_( &Ynq, ((
char *) BETA),
Mptr( ((
char *) Y), Yii,
563 Yjj, Yld, usiz ), &Yld );
566 PB_Cpaxpby( utyp,
NOCONJG, 1, *N, one, YR, 0, 0, YRd,
ROW, one,
567 ((
char *) Y), Yi, Yj, Yd,
ROW );
588 if( YCsum && ( Amp > 0 ) )
597 PB_Cpaxpby( utyp,
NOCONJG, 1, *N, one, YR, 0, 0, YRd,
ROW, one,
607 PB_Cinfog2l( Yi, Yj, Yd, nprow, npcol, myrow, mycol, &Yii, &Yjj, &Yrow,
612 if( ( mycol == Ycol ) || Ycol < 0 )
621 sascal_( &Ynp, ((
char *) BETA),
Mptr( ((
char *) Y), Yii,
622 Yjj, Yd[
LLD_], usiz ), INCY );
625 PB_Cpaxpby( utyp,
NOCONJG, *N, 1, one, YC, 0, 0, YCd,
COLUMN, one,
626 ((
char *) Y), Yi, Yj, Yd,
COLUMN );
629 if( YCfr ) free( YC );
630 if( YRfr ) free( YR );