21 float * X,
int * IX,
int * JX,
int * DESCX,
int * INCX,
22 float * A,
int * IA,
int * JA,
int * DESCA )
24 void pcher_( UPLO, N, ALPHA, X, IX, JX, DESCX, INCX, A, IA, JA, DESCA )
29 int * IA, * INCX, * IX, * JA, * JX, * N;
217 int Acol, Ai, Aii, Aimb1, Ainb1, Aj, Ajj, Akp, Akq, Ald, Amb,
218 Amp, Amp0, Anb, Anq, Anq0, Arow, XCfr, XCld, XRfr, XRld,
219 Xi, Xj, ctxt, info, ione=1, k, kb, ktmp, mycol, myrow, nb,
220 npcol, nprow, size, upper;
227 char * Aptr = NULL, * XC = NULL, * XR = NULL;
240 if( !( info = ( ( nprow == -1 ) ? -( 701 +
CTXT_ ) : 0 ) ) )
242 if( ( !upper ) && ( UploA !=
CLOWER ) )
244 PB_Cwarn( ctxt, __LINE__,
"PCHER",
"Illegal UPLO = %c\n", UploA );
247 PB_Cchkvec( ctxt,
"PCHER",
"X", *N, 2, Xi, Xj, Xd, *INCX, 7, &info );
248 PB_Cchkmat( ctxt,
"PCHER",
"A", *N, 2, *N, 2, Ai, Aj, Ad, 12, &info );
250 if( info ) {
PB_Cabort( ctxt,
"PCHER", info );
return; }
270 PB_Cdescribe( *N, *N, Ai, Aj, Ad, nprow, npcol, myrow, mycol, &Aii, &Ajj,
271 &Ald, &Aimb1, &Ainb1, &Amb, &Anb, &Arow, &Acol, Ad0 );
276 if( *INCX == Xd[
M_] )
278 PB_CInV( type,
NOCONJG,
ROW, *N, *N, Ad0, 1, ((
char *) X), Xi, Xj,
279 Xd,
ROW, &XR, XRd0, &XRfr );
280 PB_CInV( type,
NOCONJG,
COLUMN, *N, *N, Ad0, 1, XR, 0, 0,
281 XRd0,
ROW, &XC, XCd0, &XCfr );
285 PB_CInV( type,
NOCONJG,
COLUMN, *N, *N, Ad0, 1, ((
char *) X), Xi, Xj,
286 Xd,
COLUMN, &XC, XCd0, &XCfr );
287 PB_CInV( type,
NOCONJG,
ROW, *N, *N, Ad0, 1, XC, 0, 0,
288 XCd0,
COLUMN, &XR, XRd0, &XRfr );
293 Amp =
PB_Cnumroc( *N, 0, Aimb1, Amb, myrow, Arow, nprow );
294 Anq =
PB_Cnumroc( *N, 0, Ainb1, Anb, mycol, Acol, npcol );
296 if( ( Amp > 0 ) && ( Anq > 0 ) )
299 Aptr =
Mptr( ((
char *) A), Aii, Ajj, Ald, size );
305 PB_Clcm( ( Arow >= 0 ? nprow : 1 ), ( Acol >= 0 ? npcol : 1 ) );
307 XCld = XCd0[
LLD_]; XRld = XRd0[
LLD_];
313 for( k = 0; k < *N; k += nb )
315 kb = *N - k; kb =
MIN( kb, nb );
316 Akp =
PB_Cnumroc( k, 0, Aimb1, Amb, myrow, Arow, nprow );
317 Akq =
PB_Cnumroc( k, 0, Ainb1, Anb, mycol, Acol, npcol );
318 Anq0 =
PB_Cnumroc( kb, k, Ainb1, Anb, mycol, Acol, npcol );
319 if( Akp > 0 && Anq0 > 0 )
320 cgerc_( &Akp, &Anq0, ((
char *) Calpha), XC, &ione,
321 Mptr( XR, 0, Akq, XRld, size ), &XRld,
Mptr( Aptr, 0,
322 Akq, Ald, size ), &Ald );
324 XCld, size ), XCld,
Mptr( XR, 0, Akq, XRld, size ), XRld,
330 for( k = 0; k < *N; k += nb )
332 kb = *N - k; ktmp = k + ( kb =
MIN( kb, nb ) );
333 Akp =
PB_Cnumroc( k, 0, Aimb1, Amb, myrow, Arow, nprow );
334 Akq =
PB_Cnumroc( k, 0, Ainb1, Anb, mycol, Acol, npcol );
336 XCld, size ), XCld,
Mptr( XR, 0, Akq, XRld, size ), XRld,
338 Akp =
PB_Cnumroc( ktmp, 0, Aimb1, Amb, myrow, Arow, nprow );
340 Anq0 =
PB_Cnumroc( kb, k, Ainb1, Anb, mycol, Acol, npcol );
341 if( Amp0 > 0 && Anq0 > 0 )
342 cgerc_( &Amp0, &Anq0, ((
char *) Calpha),
Mptr( XC, Akp,
343 0, XCld, size ), &ione,
Mptr( XR, 0, Akq, XRld, size ),
344 &XRld,
Mptr( Aptr, Akp, Akq, Ald, size ), &Ald );
348 if( XRfr ) free( XR );
349 if( XCfr ) free( XC );