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 pcahemv_( 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;
250 char UploA, * one, top;
251 int Acol, Ai, Aii, Aimb1, Ainb1, Aj, Ajj, Akp, Akq, Ald, Amb, Amp,
252 Amp0, Anb, Anq, Anq0, Arow, XCfr, XCld, XRfr, XRld, Xi, Xj,
253 YCfr, YCpbY, YCsum, YCld, YRfr, YRpbY, YRsum, YRld, Ycol, Yi,
254 Yii, YisRow, Yj, Yjj, Yld, Ynp, Ynq, Yrow, ctxt, info, ione=1,
255 k, kb, ktmp, mycol, myrow, nb, npcol, nprow, size, upper,
264 char * Aptr = NULL, * XC = NULL, * XR = NULL, * YC = NULL,
279 if( !( info = ( ( nprow == -1 ) ? -( 701 +
CTXT_ ) : 0 ) ) )
281 if( ( !upper ) && ( UploA !=
CLOWER ) )
283 PB_Cwarn( ctxt, __LINE__, __FILE__,
"Illegal UPLO = %c\n", UploA );
286 PB_Cchkmat( ctxt,
"PCAHEMV",
"A", *N, 2, *N, 2, Ai, Aj, Ad, 7, &info );
287 PB_Cchkvec( ctxt,
"PCAHEMV",
"X", *N, 2, Xi, Xj, Xd, *INCX, 11, &info );
288 PB_Cchkvec( ctxt,
"PCAHEMV",
"Y", *N, 2, Yi, Yj, Yd, *INCY, 17, &info );
290 if( info ) {
PB_Cabort( ctxt,
"PCAHEMV", info );
return; }
317 PB_Cinfog2l( Yi, Yj, Yd, nprow, npcol, myrow, mycol, &Yii, &Yjj,
320 if( *INCY == Yd[
M_] )
325 if( ( myrow == Yrow ) || ( Yrow < 0 ) )
335 sascal_( &Ynq, ((
char *) BETA),
Mptr( ((
char *) Y), Yii,
336 Yjj, Yld, usiz ), &Yld );
345 if( ( mycol == Ycol ) || ( Ycol < 0 ) )
354 sascal_( &Ynp, ((
char *) BETA),
Mptr( ((
char *) Y), Yii,
355 Yjj, Yd[
LLD_], usiz ), INCY );
364 PB_Cdescribe( *N, *N, Ai, Aj, Ad, nprow, npcol, myrow, mycol, &Aii, &Ajj,
365 &Ald, &Aimb1, &Ainb1, &Amb, &Anb, &Arow, &Acol, Ad0 );
370 if( ( YisRow = ( *INCY == Yd[
M_] ) ) != 0 )
372 PB_CInOutV( utyp,
ROW, *N, *N, Ad0, 1, ((
char *)BETA), ((
char *) Y),
373 Yi, Yj, Yd,
ROW, ((
char**)(&tbeta)), &YR, YRd, &YRfr,
375 PB_COutV( utyp,
COLUMN,
INIT, *N, *N, Ad0, 1, &YC, YCd, &YCfr, &YCsum );
380 Yi, Yj, Yd,
COLUMN, ((
char**)(&tbeta)), &YC, YCd, &YCfr,
382 PB_COutV( utyp,
ROW,
INIT, *N, *N, Ad0, 1, &YR, YRd, &YRfr, &YRsum );
388 if( *INCX == Xd[
M_] )
390 PB_CInV( type,
NOCONJG,
ROW, *N, *N, Ad0, 1, ((
char *) X), Xi, Xj, Xd,
391 ROW, &XR, XRd, &XRfr );
392 PB_CInV( type,
NOCONJG,
COLUMN, *N, *N, Ad0, 1, XR, 0, 0, XRd,
393 ROW, &XC, XCd, &XCfr );
397 PB_CInV( type,
NOCONJG,
COLUMN, *N, *N, Ad0, 1, ((
char *) X), Xi, Xj, Xd,
398 COLUMN, &XC, XCd, &XCfr );
399 PB_CInV( type,
NOCONJG,
ROW, *N, *N, Ad0, 1, XC, 0, 0, XCd,
400 COLUMN, &XR, XRd, &XRfr );
406 Aimb1 = Ad0[
IMB_ ]; Ainb1 = Ad0[
INB_ ]; Amb = Ad0[
MB_]; Anb = Ad0[
NB_];
408 Amp =
PB_Cnumroc( *N, 0, Aimb1, Amb, myrow, Arow, nprow );
409 Anq =
PB_Cnumroc( *N, 0, Ainb1, Anb, mycol, Acol, npcol );
411 if( ( Amp > 0 ) && ( Anq > 0 ) )
413 Aptr =
Mptr( ((
char *) A), Aii, Ajj, Ald, size );
426 if( ( myrow == YRd[
RSRC_] ) || ( YRd[
RSRC_] < 0 ) )
432 sascal_( &Anq, ((
char *) tbeta), YR, &YRld );
443 if( ( mycol == YCd[
CSRC_] ) || ( YCd[
CSRC_] < 0 ) )
449 sascal_( &Amp, ((
char *) tbeta), YC, &ione );
458 PB_Clcm( ( Arow >= 0 ? nprow : 1 ), ( Acol >= 0 ? npcol : 1 ) );
462 for( k = 0; k < *N; k += nb )
464 kb = *N - k; kb =
MIN( kb, nb );
465 Akp =
PB_Cnumroc( k, 0, Aimb1, Amb, myrow, Arow, nprow );
466 Akq =
PB_Cnumroc( k, 0, Ainb1, Anb, mycol, Acol, npcol );
467 Anq0 =
PB_Cnumroc( kb, k, Ainb1, Anb, mycol, Acol, npcol );
468 if( Akp > 0 && Anq0 > 0 )
471 Mptr( Aptr, 0, Akq, Ald, size ), &Ald,
Mptr( XR, 0, Akq,
472 XRld, size ), &XRld, one, YC, &ione );
474 Mptr( Aptr, 0, Akq, Ald, size ), &Ald, XC, &ione, one,
475 Mptr( YR, 0, Akq, YRld, usiz ), &YRld );
478 k, Ad0,
Mptr( XC, Akp, 0, XCld, size ), XCld,
Mptr( XR, 0,
479 Akq, XRld, size ), XRld,
Mptr( YC, Akp, 0, YCld, usiz ),
485 for( k = 0; k < *N; k += nb )
487 kb = *N - k; ktmp = k + ( kb =
MIN( kb, nb ) );
488 Akp =
PB_Cnumroc( k, 0, Aimb1, Amb, myrow, Arow, nprow );
489 Akq =
PB_Cnumroc( k, 0, Ainb1, Anb, mycol, Acol, npcol );
491 k, Ad0,
Mptr( XC, Akp, 0, XCld, size ), XCld,
Mptr( XR, 0,
492 Akq, XRld, size ), XRld,
Mptr( YC, Akp, 0, YCld, usiz ),
494 Akp =
PB_Cnumroc( ktmp, 0, Aimb1, Amb, myrow, Arow, nprow );
496 Anq0 =
PB_Cnumroc( kb, k, Ainb1, Anb, mycol, Acol, npcol );
497 if( Amp0 > 0 && Anq0 > 0 )
500 Mptr( Aptr, Akp, Akq, Ald, size ), &Ald,
Mptr( XR, 0,
501 Akq, XRld, size ), &XRld, one,
Mptr( YC, Akp, 0, YCld,
504 Mptr( Aptr, Akp, Akq, Ald, size ), &Ald,
Mptr( XC, Akp,
505 0, XCld, size ), &ione, one,
Mptr( YR, 0, Akq, YRld,
511 if( XCfr ) free( XC );
512 if( XRfr ) free( XR );
531 if( YRsum && ( Anq > 0 ) )
540 PB_Cpaxpby( utyp,
NOCONJG, *N, 1, one, YC, 0, 0, YCd,
COLUMN, one,
541 YR, 0, 0, YRd,
ROW );
550 PB_Cinfog2l( Yi, Yj, Yd, nprow, npcol, myrow, mycol, &Yii, &Yjj, &Yrow,
555 if( ( myrow == Yrow ) || Yrow < 0 )
565 sascal_( &Ynq, ((
char *) BETA),
Mptr( ((
char *) Y), Yii,
566 Yjj, Yld, usiz ), &Yld );
569 PB_Cpaxpby( utyp,
NOCONJG, 1, *N, one, YR, 0, 0, YRd,
ROW, one,
570 ((
char *) Y), Yi, Yj, Yd,
ROW );
591 if( YCsum && ( Amp > 0 ) )
600 PB_Cpaxpby( utyp,
NOCONJG, 1, *N, one, YR, 0, 0, YRd,
ROW, one,
610 PB_Cinfog2l( Yi, Yj, Yd, nprow, npcol, myrow, mycol, &Yii, &Yjj, &Yrow,
615 if( ( mycol == Ycol ) || Ycol < 0 )
624 sascal_( &Ynp, ((
char *) BETA),
Mptr( ((
char *) Y), Yii,
625 Yjj, Yd[
LLD_], usiz ), INCY );
628 PB_Cpaxpby( utyp,
NOCONJG, *N, 1, one, YC, 0, 0, YCd,
COLUMN, one,
629 ((
char *) Y), Yi, Yj, Yd,
COLUMN );
632 if( YCfr ) free( YC );
633 if( YRfr ) free( YR );