21 double * A,
int * IA,
int * JA,
int * DESCA,
22 double * X,
int * IX,
int * JX,
int * DESCX,
int * INCX,
24 double * Y,
int * IY,
int * JY,
int * DESCY,
int * INCY )
26 void pzhemv_( 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 double * ALPHA, * BETA;
38 int * DESCA, * DESCX, * DESCY;
248 char UploA, * one, top;
249 int Acol, Ai, Aii, Aimb1, Ainb1, Aj, Ajj, Akp, Akq, Ald, Amb,
250 Amp, Amp0, Anb, Anq, Anq0, Arow, XCfr, XCld, XRfr, XRld,
251 Xi, Xj, YCfr, YCpbY, YCsum, YCld, YRfr, YRpbY, YRsum,
252 YRld, Ycol, Yi, Yii, YisRow, Yj, Yjj, Yld, Ynp, Ynq, Yrow,
253 ctxt, info, ione=1, k, kb, ktmp, mycol, myrow, nb, npcol,
262 char * Aptr = NULL, * XC = NULL, * XR = NULL, * YC = NULL,
277 if( !( info = ( ( nprow == -1 ) ? -( 701 +
CTXT_ ) : 0 ) ) )
279 if( ( !upper ) && ( UploA !=
CLOWER ) )
281 PB_Cwarn( ctxt, __LINE__, __FILE__,
"Illegal UPLO = %c\n", UploA );
284 PB_Cchkmat( ctxt,
"PZHEMV",
"A", *N, 2, *N, 2, Ai, Aj, Ad, 7, &info );
285 PB_Cchkvec( ctxt,
"PZHEMV",
"X", *N, 2, Xi, Xj, Xd, *INCX, 11, &info );
286 PB_Cchkvec( ctxt,
"PZHEMV",
"Y", *N, 2, Yi, Yj, Yd, *INCY, 17, &info );
288 if( info ) {
PB_Cabort( ctxt,
"PZHEMV", info );
return; }
315 PB_Cinfog2l( Yi, Yj, Yd, nprow, npcol, myrow, mycol, &Yii, &Yjj,
318 if( *INCY == Yd[
M_] )
323 if( ( myrow == Yrow ) || ( Yrow < 0 ) )
335 zset_( &Ynq, ((
char *) BETA),
Mptr( ((
char *) Y), Yii,
336 Yjj, Yld, type->
size ), &Yld );
340 zscal_( &Ynq, ((
char *) BETA),
Mptr( ((
char *) Y), Yii,
341 Yjj, Yld, type->
size ), &Yld );
351 if( ( mycol == Ycol ) || ( Ycol < 0 ) )
362 zset_( &Ynp, ((
char *) BETA),
Mptr( ((
char *) Y), Yii,
363 Yjj, Yd[
LLD_], type->
size ), INCY );
367 zscal_( &Ynp, ((
char *) BETA),
Mptr( ((
char *) Y), Yii,
368 Yjj, Yd[
LLD_], type->
size ), INCY );
378 PB_Cdescribe( *N, *N, Ai, Aj, Ad, nprow, npcol, myrow, mycol, &Aii, &Ajj,
379 &Ald, &Aimb1, &Ainb1, &Amb, &Anb, &Arow, &Acol, Ad0 );
384 if( ( YisRow = ( *INCY == Yd[
M_] ) ) != 0 )
386 PB_CInOutV( type,
ROW, *N, *N, Ad0, 1, ((
char *)BETA), ((
char *) Y),
387 Yi, Yj, Yd,
ROW, ((
char**)(&tbeta)), &YR, YRd, &YRfr,
389 PB_COutV( type,
COLUMN,
INIT, *N, *N, Ad0, 1, &YC, YCd, &YCfr, &YCsum );
394 Yi, Yj, Yd,
COLUMN, ((
char**)(&tbeta)), &YC, YCd, &YCfr,
396 PB_COutV( type,
ROW,
INIT, *N, *N, Ad0, 1, &YR, YRd, &YRfr, &YRsum );
402 if( *INCX == Xd[
M_] )
404 PB_CInV( type,
NOCONJG,
ROW, *N, *N, Ad0, 1, ((
char *) X), Xi, Xj, Xd,
405 ROW, &XR, XRd, &XRfr );
406 PB_CInV( type,
NOCONJG,
COLUMN, *N, *N, Ad0, 1, XR, 0, 0, XRd,
407 ROW, &XC, XCd, &XCfr );
411 PB_CInV( type,
NOCONJG,
COLUMN, *N, *N, Ad0, 1, ((
char *) X), Xi, Xj, Xd,
412 COLUMN, &XC, XCd, &XCfr );
413 PB_CInV( type,
NOCONJG,
ROW, *N, *N, Ad0, 1, XC, 0, 0, XCd,
414 COLUMN, &XR, XRd, &XRfr );
421 Aimb1 = Ad0[
IMB_ ]; Ainb1 = Ad0[
INB_ ]; Amb = Ad0[
MB_]; Anb = Ad0[
NB_];
423 Amp =
PB_Cnumroc( *N, 0, Aimb1, Amb, myrow, Arow, nprow );
424 Anq =
PB_Cnumroc( *N, 0, Ainb1, Anb, mycol, Acol, npcol );
426 if( ( Amp > 0 ) && ( Anq > 0 ) )
429 Aptr =
Mptr( ((
char *) A), Aii, Ajj, Ald, size );
442 if( ( myrow == YRd[
RSRC_] ) || ( YRd[
RSRC_] < 0 ) )
452 zset_( &Anq, ((
char *) tbeta), YR, &YRld );
456 zscal_( &Anq, ((
char *) tbeta), YR, &YRld );
469 if( ( mycol == YCd[
CSRC_] ) || ( YCd[
CSRC_] < 0 ) )
479 zset_( &Amp, ((
char *) tbeta), YC, &ione );
483 zscal_( &Amp, ((
char *) tbeta), YC, &ione );
494 PB_Clcm( ( Arow >= 0 ? nprow : 1 ), ( Acol >= 0 ? npcol : 1 ) );
498 for( k = 0; k < *N; k += nb )
500 kb = *N - k; kb =
MIN( kb, nb );
501 Akp =
PB_Cnumroc( k, 0, Aimb1, Amb, myrow, Arow, nprow );
502 Akq =
PB_Cnumroc( k, 0, Ainb1, Anb, mycol, Acol, npcol );
503 Anq0 =
PB_Cnumroc( kb, k, Ainb1, Anb, mycol, Acol, npcol );
504 if( Akp > 0 && Anq0 > 0 )
507 Mptr( Aptr, 0, Akq, Ald, size ), &Ald,
Mptr( XR, 0, Akq,
508 XRld, size ), &XRld, one, YC, &ione );
510 Mptr( Aptr, 0, Akq, Ald, size ), &Ald, XC, &ione, one,
511 Mptr( YR, 0, Akq, YRld, size ), &YRld );
514 Aptr, k, k, Ad0,
Mptr( XC, Akp, 0, XCld, size ), XCld,
515 Mptr( XR, 0, Akq, XRld, size ), XRld,
Mptr( YC, Akp, 0,
516 YCld, size ), YCld,
Mptr( YR, 0, Akq, YRld, size ), YRld,
522 for( k = 0; k < *N; k += nb )
524 kb = *N - k; ktmp = k + ( kb =
MIN( kb, nb ) );
525 Akp =
PB_Cnumroc( k, 0, Aimb1, Amb, myrow, Arow, nprow );
526 Akq =
PB_Cnumroc( k, 0, Ainb1, Anb, mycol, Acol, npcol );
528 Aptr, k, k, Ad0,
Mptr( XC, Akp, 0, XCld, size ), XCld,
529 Mptr( XR, 0, Akq, XRld, size ), XRld,
Mptr( YC, Akp, 0,
530 YCld, size ), YCld,
Mptr( YR, 0, Akq, YRld, size ), YRld,
532 Akp =
PB_Cnumroc( ktmp, 0, Aimb1, Amb, myrow, Arow, nprow );
534 Anq0 =
PB_Cnumroc( kb, k, Ainb1, Anb, mycol, Acol, npcol );
535 if( Amp0 > 0 && Anq0 > 0 )
538 Mptr( Aptr, Akp, Akq, Ald, size ), &Ald,
Mptr( XR, 0,
539 Akq, XRld, size ), &XRld, one,
Mptr( YC, Akp, 0, YCld,
542 Mptr( Aptr, Akp, Akq, Ald, size ), &Ald,
Mptr( XC, Akp,
543 0, XCld, size ), &ione, one,
Mptr( YR, 0, Akq, YRld,
549 if( XCfr ) free( XC );
550 if( XRfr ) free( XR );
569 if( YRsum && ( Anq > 0 ) )
579 PB_Cpaxpby( type,
NOCONJG, *N, 1, one, YC, 0, 0, YCd,
COLUMN, one,
580 YR, 0, 0, YRd,
ROW );
586 PB_Cpaxpby( type,
NOCONJG, 1, *N, one, YR, 0, 0, YRd,
ROW,
587 ((
char *)BETA), ((
char *) Y), Yi, Yj, Yd,
ROW );
608 if( YCsum && ( Amp > 0 ) )
617 PB_Cpaxpby( type,
NOCONJG, 1, *N, one, YR, 0, 0, YRd,
ROW, one,
625 COLUMN, ((
char *)BETA), ((
char *) Y), Yi, Yj, Yd,
629 if( YCfr ) free( YC );
630 if( YRfr ) free( YR );