21 float * X,
int * IX,
int * JX,
int * DESCX,
int * INCX,
22 float * Y,
int * IY,
int * JY,
int * DESCY,
int * INCY,
23 float * A,
int * IA,
int * JA,
int * DESCA )
25 void pcher2_( UPLO, N, ALPHA, X, IX, JX, DESCX, INCX, Y, IY, JY,
26 DESCY, INCY, A, IA, JA, DESCA )
31 int * IA, * INCX, * INCY, * IX, * IY, * JA, * JX, * JY,
37 int * DESCA, * DESCX, * DESCY;
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, YCld, YRfr, YRld, Yi, Yj, ctxt, info, ione=1,
252 k, kb, ktmp, mycol, myrow, nb, npcol, nprow, size, upper;
260 char * Aptr = NULL, * XC = NULL, * XR = NULL, * YC = NULL,
275 if( !( info = ( ( nprow == -1 ) ? -( 701 +
CTXT_ ) : 0 ) ) )
277 if( ( !upper ) && ( UploA !=
CLOWER ) )
279 PB_Cwarn( ctxt, __LINE__,
"PCHER2",
"Illegal UPLO = %c\n", UploA );
282 PB_Cchkvec( ctxt,
"PCHER2",
"X", *N, 2, Xi, Xj, Xd, *INCX, 7, &info );
283 PB_Cchkvec( ctxt,
"PCHER2",
"Y", *N, 2, Yi, Yj, Yd, *INCY, 12, &info );
284 PB_Cchkmat( ctxt,
"PCHER2",
"A", *N, 2, *N, 2, Ai, Aj, Ad, 17, &info );
286 if( info ) {
PB_Cabort( ctxt,
"PCHER2", info );
return; }
307 PB_Cdescribe( *N, *N, Ai, Aj, Ad, nprow, npcol, myrow, mycol, &Aii, &Ajj,
308 &Ald, &Aimb1, &Ainb1, &Amb, &Anb, &Arow, &Acol, Ad0 );
313 if( *INCX == Xd[
M_] )
315 PB_CInV( type,
NOCONJG,
ROW, *N, *N, Ad0, 1, ((
char *) X), Xi, Xj,
316 Xd,
ROW, &XR, XRd0, &XRfr );
317 PB_CInV( type,
NOCONJG,
COLUMN, *N, *N, Ad0, 1, XR, 0, 0,
318 XRd0,
ROW, &XC, XCd0, &XCfr );
322 PB_CInV( type,
NOCONJG,
COLUMN, *N, *N, Ad0, 1, ((
char *) X), Xi, Xj,
323 Xd,
COLUMN, &XC, XCd0, &XCfr );
324 PB_CInV( type,
NOCONJG,
ROW, *N, *N, Ad0, 1, XC, 0, 0,
325 XCd0,
COLUMN, &XR, XRd0, &XRfr );
331 if( *INCY == Yd[
M_] )
333 PB_CInV( type,
NOCONJG,
ROW, *N, *N, Ad0, 1, ((
char *) Y), Yi, Yj,
334 Yd,
ROW, &YR, YRd0, &YRfr );
335 PB_CInV( type,
NOCONJG,
COLUMN, *N, *N, Ad0, 1, YR, 0, 0,
336 YRd0,
ROW, &YC, YCd0, &YCfr );
340 PB_CInV( type,
NOCONJG,
COLUMN, *N, *N, Ad0, 1, ((
char *) Y), Yi, Yj,
341 Yd,
COLUMN, &YC, YCd0, &YCfr );
342 PB_CInV( type,
NOCONJG,
ROW, *N, *N, Ad0, 1, YC, 0, 0,
343 YCd0,
COLUMN, &YR, YRd0, &YRfr );
348 Amp =
PB_Cnumroc( *N, 0, Aimb1, Amb, myrow, Arow, nprow );
349 Anq =
PB_Cnumroc( *N, 0, Ainb1, Anb, mycol, Acol, npcol );
351 if( ( Amp > 0 ) && ( Anq > 0 ) )
354 Aptr =
Mptr( ((
char *) A), Aii, Ajj, Ald, size );
356 XCld = XCd0[
LLD_]; YCld = YCd0[
LLD_];
357 XRld = XRd0[
LLD_]; YRld = YRd0[
LLD_];
365 PB_Clcm( ( Arow >= 0 ? nprow : 1 ), ( Acol >= 0 ? npcol : 1 ) );
368 for( k = 0; k < *N; k += nb )
370 kb = *N - k; kb =
MIN( kb, nb );
371 Akp =
PB_Cnumroc( k, 0, Aimb1, Amb, myrow, Arow, nprow );
372 Akq =
PB_Cnumroc( k, 0, Ainb1, Anb, mycol, Acol, npcol );
373 Anq0 =
PB_Cnumroc( kb, k, Ainb1, Anb, mycol, Acol, npcol );
374 if( Akp > 0 && Anq0 > 0 )
376 cgerc_( &Akp, &Anq0, ((
char *) ALPHA), XC, &ione,
377 Mptr( YR, 0, Akq, YRld, size ), &YRld,
378 Mptr( Aptr, 0, Akq, Ald, size ), &Ald );
379 cgerc_( &Akp, &Anq0, ((
char *) Calpha), YC, &ione,
380 Mptr( XR, 0, Akq, XRld, size ), &XRld,
381 Mptr( Aptr, 0, Akq, Ald, size ), &Ald );
384 Mptr( XC, Akp, 0, XCld, size ), XCld,
385 Mptr( XR, 0, Akq, XRld, size ), XRld,
386 Mptr( YC, Akp, 0, YCld, size ), YCld,
387 Mptr( YR, 0, Akq, YRld, size ), YRld,
393 for( k = 0; k < *N; k += nb )
395 kb = *N - k; ktmp = k + ( kb =
MIN( kb, nb ) );
396 Akp =
PB_Cnumroc( k, 0, Aimb1, Amb, myrow, Arow, nprow );
397 Akq =
PB_Cnumroc( k, 0, Ainb1, Anb, mycol, Acol, npcol );
399 Mptr( XC, Akp, 0, XCld, size ), XCld,
400 Mptr( XR, 0, Akq, XRld, size ), XRld,
401 Mptr( YC, Akp, 0, YCld, size ), YCld,
402 Mptr( YR, 0, Akq, YRld, size ), YRld,
404 Akp =
PB_Cnumroc( ktmp, 0, Aimb1, Amb, myrow, Arow, nprow );
406 Anq0 =
PB_Cnumroc( kb, k, Ainb1, Anb, mycol, Acol, npcol );
407 if( Amp0 > 0 && Anq0 > 0 )
409 cgerc_( &Amp0, &Anq0, ((
char *) ALPHA),
410 Mptr( XC, Akp, 0, XCld, size ), &ione,
411 Mptr( YR, 0, Akq, YRld, size ), &YRld,
412 Mptr( Aptr, Akp, Akq, Ald, size ), &Ald );
413 cgerc_( &Amp0, &Anq0, ((
char *) Calpha),
414 Mptr( YC, Akp, 0, YCld, size ), &ione,
415 Mptr( XR, 0, Akq, XRld, size ), &XRld,
416 Mptr( Aptr, Akp, Akq, Ald, size ), &Ald );
421 if( XRfr ) free( XR );
422 if( XCfr ) free( XC );
423 if( YRfr ) free( YR );
424 if( YCfr ) free( YC );