21 double * X,
int * IX,
int * JX,
int * DESCX,
int * INCX,
22 double * A,
int * IA,
int * JA,
int * DESCA )
24 void pdsyr_( UPLO, N, ALPHA, X, IX, JX, DESCX, INCX, A, IA, JA, DESCA )
29 int * IA, * INCX, * IX, * JA, * JX, * N;
213 int Acol, Ai, Aii, Aimb1, Ainb1, Aj, Ajj, Akp, Akq, Ald, Amb,
214 Amp, Amp0, Anb, Anq, Anq0, Arow, XCfr, XCld, XRfr, XRld,
215 Xi, Xj, ctxt, info, ione=1, k, kb, ktmp, mycol, myrow, nb,
216 npcol, nprow, size, upper;
222 char * Aptr = NULL, * XC = NULL, * XR = NULL;
235 if( !( info = ( ( nprow == -1 ) ? -( 701 +
CTXT_ ) : 0 ) ) )
237 if( ( !upper ) && ( UploA !=
CLOWER ) )
239 PB_Cwarn( ctxt, __LINE__,
"PDSYR",
"Illegal UPLO = %c\n", UploA );
242 PB_Cchkvec( ctxt,
"PDSYR",
"X", *N, 2, Xi, Xj, Xd, *INCX, 7, &info );
243 PB_Cchkmat( ctxt,
"PDSYR",
"A", *N, 2, *N, 2, Ai, Aj, Ad, 12, &info );
245 if( info ) {
PB_Cabort( ctxt,
"PDSYR", info );
return; }
265 PB_Cdescribe( *N, *N, Ai, Aj, Ad, nprow, npcol, myrow, mycol, &Aii, &Ajj,
266 &Ald, &Aimb1, &Ainb1, &Amb, &Anb, &Arow, &Acol, Ad0 );
271 if( *INCX == Xd[
M_] )
273 PB_CInV( type,
NOCONJG,
ROW, *N, *N, Ad0, 1, ((
char *) X), Xi, Xj,
274 Xd,
ROW, &XR, XRd0, &XRfr );
275 PB_CInV( type,
NOCONJG,
COLUMN, *N, *N, Ad0, 1, XR, 0, 0,
276 XRd0,
ROW, &XC, XCd0, &XCfr );
280 PB_CInV( type,
NOCONJG,
COLUMN, *N, *N, Ad0, 1, ((
char *) X), Xi, Xj,
281 Xd,
COLUMN, &XC, XCd0, &XCfr );
282 PB_CInV( type,
NOCONJG,
ROW, *N, *N, Ad0, 1, XC, 0, 0,
283 XCd0,
COLUMN, &XR, XRd0, &XRfr );
288 Amp =
PB_Cnumroc( *N, 0, Aimb1, Amb, myrow, Arow, nprow );
289 Anq =
PB_Cnumroc( *N, 0, Ainb1, Anb, mycol, Acol, npcol );
291 if( ( Amp > 0 ) && ( Anq > 0 ) )
294 Aptr =
Mptr( ((
char *) A), Aii, Ajj, Ald, size );
300 PB_Clcm( ( Arow >= 0 ? nprow : 1 ), ( Acol >= 0 ? npcol : 1 ) );
302 XCld = XCd0[
LLD_]; XRld = XRd0[
LLD_];
306 for( k = 0; k < *N; k += nb )
308 kb = *N - k; kb =
MIN( kb, nb );
309 Akp =
PB_Cnumroc( k, 0, Aimb1, Amb, myrow, Arow, nprow );
310 Akq =
PB_Cnumroc( k, 0, Ainb1, Anb, mycol, Acol, npcol );
311 Anq0 =
PB_Cnumroc( kb, k, Ainb1, Anb, mycol, Acol, npcol );
312 if( Akp > 0 && Anq0 > 0 )
313 dger_( &Akp, &Anq0, ((
char *) ALPHA), XC, &ione,
314 Mptr( XR, 0, Akq, XRld, size ), &XRld,
Mptr( Aptr, 0, Akq,
317 XCld, size ), XCld,
Mptr( XR, 0, Akq, XRld, size ), XRld,
323 for( k = 0; k < *N; k += nb )
325 kb = *N - k; ktmp = k + ( kb =
MIN( kb, nb ) );
326 Akp =
PB_Cnumroc( k, 0, Aimb1, Amb, myrow, Arow, nprow );
327 Akq =
PB_Cnumroc( k, 0, Ainb1, Anb, mycol, Acol, npcol );
329 XCld, size ), XCld,
Mptr( XR, 0, Akq, XRld, size ), XRld,
331 Akp =
PB_Cnumroc( ktmp, 0, Aimb1, Amb, myrow, Arow, nprow );
333 Anq0 =
PB_Cnumroc( kb, k, Ainb1, Anb, mycol, Acol, npcol );
334 if( Amp0 > 0 && Anq0 > 0 )
335 dger_( &Amp0, &Anq0, ((
char *) ALPHA),
Mptr( XC, Akp,
336 0, XCld, size ), &ione,
Mptr( XR, 0, Akq, XRld, size ),
337 &XRld,
Mptr( Aptr, Akp, Akq, Ald, size ), &Ald );
341 if( XRfr ) free( XR );
342 if( XCfr ) free( XC );