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 pdsymv_( 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;
245 char UploA, * one, top;
246 int Acol, Ai, Aii, Aimb1, Ainb1, Aj, Ajj, Akp, Akq, Ald, Amb,
247 Amp, Amp0, Anb, Anq, Anq0, Arow, XCfr, XCld, XRfr, XRld,
248 Xi, Xj, YCfr, YCpbY, YCsum, YCld, YRfr, YRpbY, YRsum,
249 YRld, Ycol, Yi, Yii, YisRow, Yj, Yjj, Yld, Ynp, Ynq, Yrow,
250 ctxt, info, ione=1, k, kb, ktmp, mycol, myrow, nb, npcol,
259 char * Aptr = NULL, * XC = NULL, * XR = NULL, * YC = NULL,
274 if( !( info = ( ( nprow == -1 ) ? -( 701 +
CTXT_ ) : 0 ) ) )
276 if( ( !upper ) && ( UploA !=
CLOWER ) )
278 PB_Cwarn( ctxt, __LINE__, __FILE__,
"Illegal UPLO = %c\n", UploA );
281 PB_Cchkmat( ctxt,
"PDSYMV",
"A", *N, 2, *N, 2, Ai, Aj, Ad, 7, &info );
282 PB_Cchkvec( ctxt,
"PDSYMV",
"X", *N, 2, Xi, Xj, Xd, *INCX, 11, &info );
283 PB_Cchkvec( ctxt,
"PDSYMV",
"Y", *N, 2, Yi, Yj, Yd, *INCY, 17, &info );
285 if( info ) {
PB_Cabort( ctxt,
"PDSYMV", info );
return; }
311 PB_Cinfog2l( Yi, Yj, Yd, nprow, npcol, myrow, mycol, &Yii, &Yjj,
314 if( *INCY == Yd[
M_] )
319 if( ( myrow == Yrow ) || ( Yrow < 0 ) )
331 dset_( &Ynq, ((
char *) BETA),
Mptr( ((
char *) Y), Yii,
332 Yjj, Yld, type->
size ), &Yld );
336 dscal_( &Ynq, ((
char *) BETA),
Mptr( ((
char *) Y), Yii,
337 Yjj, Yld, type->
size ), &Yld );
347 if( ( mycol == Ycol ) || ( Ycol < 0 ) )
358 dset_( &Ynp, ((
char *) BETA),
Mptr( ((
char *) Y), Yii,
359 Yjj, Yd[
LLD_], type->
size ), INCY );
363 dscal_( &Ynp, ((
char *) BETA),
Mptr( ((
char *) Y), Yii,
364 Yjj, Yd[
LLD_], type->
size ), INCY );
374 PB_Cdescribe( *N, *N, Ai, Aj, Ad, nprow, npcol, myrow, mycol, &Aii, &Ajj,
375 &Ald, &Aimb1, &Ainb1, &Amb, &Anb, &Arow, &Acol, Ad0 );
380 if( ( YisRow = ( *INCY == Yd[
M_] ) ) != 0 )
382 PB_CInOutV( type,
ROW, *N, *N, Ad0, 1, ((
char *)BETA), ((
char *) Y),
383 Yi, Yj, Yd,
ROW, ((
char**)(&tbeta)), &YR, YRd, &YRfr,
385 PB_COutV( type,
COLUMN,
INIT, *N, *N, Ad0, 1, &YC, YCd, &YCfr, &YCsum );
390 Yi, Yj, Yd,
COLUMN, ((
char**)(&tbeta)), &YC, YCd, &YCfr,
392 PB_COutV( type,
ROW,
INIT, *N, *N, Ad0, 1, &YR, YRd, &YRfr, &YRsum );
398 if( *INCX == Xd[
M_] )
400 PB_CInV( type,
NOCONJG,
ROW, *N, *N, Ad0, 1, ((
char *) X), Xi, Xj, Xd,
401 ROW, &XR, XRd, &XRfr );
402 PB_CInV( type,
NOCONJG,
COLUMN, *N, *N, Ad0, 1, XR, 0, 0, XRd,
403 ROW, &XC, XCd, &XCfr );
407 PB_CInV( type,
NOCONJG,
COLUMN, *N, *N, Ad0, 1, ((
char *) X), Xi, Xj, Xd,
408 COLUMN, &XC, XCd, &XCfr );
409 PB_CInV( type,
NOCONJG,
ROW, *N, *N, Ad0, 1, XC, 0, 0, XCd,
410 COLUMN, &XR, XRd, &XRfr );
417 Aimb1 = Ad0[
IMB_ ]; Ainb1 = Ad0[
INB_ ]; Amb = Ad0[
MB_]; Anb = Ad0[
NB_];
419 Amp =
PB_Cnumroc( *N, 0, Aimb1, Amb, myrow, Arow, nprow );
420 Anq =
PB_Cnumroc( *N, 0, Ainb1, Anb, mycol, Acol, npcol );
422 if( ( Amp > 0 ) && ( Anq > 0 ) )
425 Aptr =
Mptr( ((
char *) A), Aii, Ajj, Ald, size );
438 if( ( myrow == YRd[
RSRC_] ) || ( YRd[
RSRC_] < 0 ) )
447 dset_( &Anq, ((
char *) tbeta), YR, &YRld );
451 dscal_( &Anq, ((
char *) tbeta), YR, &YRld );
464 if( ( mycol == YCd[
CSRC_] ) || ( YCd[
CSRC_] < 0 ) )
473 dset_( &Amp, ((
char *) tbeta), YC, &ione );
477 dscal_( &Amp, ((
char *) tbeta), YC, &ione );
488 PB_Clcm( ( Arow >= 0 ? nprow : 1 ), ( Acol >= 0 ? npcol : 1 ) );
492 for( k = 0; k < *N; k += nb )
494 kb = *N - k; kb =
MIN( kb, nb );
495 Akp =
PB_Cnumroc( k, 0, Aimb1, Amb, myrow, Arow, nprow );
496 Akq =
PB_Cnumroc( k, 0, Ainb1, Anb, mycol, Acol, npcol );
497 Anq0 =
PB_Cnumroc( kb, k, Ainb1, Anb, mycol, Acol, npcol );
498 if( Akp > 0 && Anq0 > 0 )
501 Mptr( Aptr, 0, Akq, Ald, size ), &Ald,
Mptr( XR, 0, Akq,
502 XRld, size ), &XRld, one, YC, &ione );
504 Mptr( Aptr, 0, Akq, Ald, size ), &Ald, XC, &ione, one,
505 Mptr( YR, 0, Akq, YRld, size ), &YRld );
508 Aptr, k, k, Ad0,
Mptr( XC, Akp, 0, XCld, size ), XCld,
509 Mptr( XR, 0, Akq, XRld, size ), XRld,
Mptr( YC, Akp, 0,
510 YCld, size ), YCld,
Mptr( YR, 0, Akq, YRld, size ), YRld,
516 for( k = 0; k < *N; k += nb )
518 kb = *N - k; ktmp = k + ( kb =
MIN( kb, nb ) );
519 Akp =
PB_Cnumroc( k, 0, Aimb1, Amb, myrow, Arow, nprow );
520 Akq =
PB_Cnumroc( k, 0, Ainb1, Anb, mycol, Acol, npcol );
522 Aptr, k, k, Ad0,
Mptr( XC, Akp, 0, XCld, size ), XCld,
523 Mptr( XR, 0, Akq, XRld, size ), XRld,
Mptr( YC, Akp, 0,
524 YCld, size ), YCld,
Mptr( YR, 0, Akq, YRld, size ), YRld,
526 Akp =
PB_Cnumroc( ktmp, 0, Aimb1, Amb, myrow, Arow, nprow );
528 Anq0 =
PB_Cnumroc( kb, k, Ainb1, Anb, mycol, Acol, npcol );
529 if( Amp0 > 0 && Anq0 > 0 )
532 Mptr( Aptr, Akp, Akq, Ald, size ), &Ald,
Mptr( XR, 0,
533 Akq, XRld, size ), &XRld, one,
Mptr( YC, Akp, 0, YCld,
536 Mptr( Aptr, Akp, Akq, Ald, size ), &Ald,
Mptr( XC, Akp,
537 0, XCld, size ), &ione, one,
Mptr( YR, 0, Akq, YRld,
543 if( XCfr ) free( XC );
544 if( XRfr ) free( XR );
563 if( YRsum && ( Anq > 0 ) )
573 PB_Cpaxpby( type,
NOCONJG, *N, 1, one, YC, 0, 0, YCd,
COLUMN, one,
574 YR, 0, 0, YRd,
ROW );
580 PB_Cpaxpby( type,
NOCONJG, 1, *N, one, YR, 0, 0, YRd,
ROW,
581 ((
char *)BETA), ((
char *) Y), Yi, Yj, Yd,
ROW );
602 if( YCsum && ( Amp > 0 ) )
611 PB_Cpaxpby( type,
NOCONJG, 1, *N, one, YR, 0, 0, YRd,
ROW, one,
619 COLUMN, ((
char *)BETA), ((
char *) Y), Yi, Yj, Yd,
623 if( YCfr ) free( YC );
624 if( YRfr ) free( YR );