21 double * X,
int * IX,
int * JX,
int * DESCX,
int * INCX,
22 double * Y,
int * IY,
int * JY,
int * DESCY,
int * INCY,
23 double * A,
int * IA,
int * JA,
int * DESCA )
25 void pdsyr2_( 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;
245 int Acol, Ai, Aii, Aimb1, Ainb1, Aj, Ajj, Akp, Akq, Ald, Amb,
246 Amp, Amp0, Anb, Anq, Anq0, Arow, XCfr, XCld, XRfr, XRld,
247 Xi, Xj, YCfr, YCld, YRfr, YRld, Yi, Yj, ctxt, info, ione=1,
248 k, kb, ktmp, mycol, myrow, nb, npcol, nprow, size, upper;
255 char * Aptr = NULL, * XC = NULL, * XR = NULL, * YC = NULL,
270 if( !( info = ( ( nprow == -1 ) ? -( 701 +
CTXT_ ) : 0 ) ) )
272 if( ( !upper ) && ( UploA !=
CLOWER ) )
274 PB_Cwarn( ctxt, __LINE__,
"PDSYR2",
"Illegal UPLO = %c\n", UploA );
277 PB_Cchkvec( ctxt,
"PDSYR2",
"X", *N, 2, Xi, Xj, Xd, *INCX, 7, &info );
278 PB_Cchkvec( ctxt,
"PDSYR2",
"Y", *N, 2, Yi, Yj, Yd, *INCY, 12, &info );
279 PB_Cchkmat( ctxt,
"PDSYR2",
"A", *N, 2, *N, 2, Ai, Aj, Ad, 17, &info );
281 if( info ) {
PB_Cabort( ctxt,
"PDSYR2", info );
return; }
300 PB_Cdescribe( *N, *N, Ai, Aj, Ad, nprow, npcol, myrow, mycol, &Aii, &Ajj,
301 &Ald, &Aimb1, &Ainb1, &Amb, &Anb, &Arow, &Acol, Ad0 );
306 if( *INCX == Xd[
M_] )
308 PB_CInV( type,
NOCONJG,
ROW, *N, *N, Ad0, 1, ((
char *) X), Xi, Xj,
309 Xd,
ROW, &XR, XRd0, &XRfr );
310 PB_CInV( type,
NOCONJG,
COLUMN, *N, *N, Ad0, 1, XR, 0, 0,
311 XRd0,
ROW, &XC, XCd0, &XCfr );
315 PB_CInV( type,
NOCONJG,
COLUMN, *N, *N, Ad0, 1, ((
char *) X), Xi, Xj,
316 Xd,
COLUMN, &XC, XCd0, &XCfr );
317 PB_CInV( type,
NOCONJG,
ROW, *N, *N, Ad0, 1, XC, 0, 0,
318 XCd0,
COLUMN, &XR, XRd0, &XRfr );
324 if( *INCY == Yd[
M_] )
326 PB_CInV( type,
NOCONJG,
ROW, *N, *N, Ad0, 1, ((
char *) Y), Yi, Yj,
327 Yd,
ROW, &YR, YRd0, &YRfr );
328 PB_CInV( type,
NOCONJG,
COLUMN, *N, *N, Ad0, 1, YR, 0, 0,
329 YRd0,
ROW, &YC, YCd0, &YCfr );
333 PB_CInV( type,
NOCONJG,
COLUMN, *N, *N, Ad0, 1, ((
char *) Y), Yi, Yj,
334 Yd,
COLUMN, &YC, YCd0, &YCfr );
335 PB_CInV( type,
NOCONJG,
ROW, *N, *N, Ad0, 1, YC, 0, 0,
336 YCd0,
COLUMN, &YR, YRd0, &YRfr );
341 Amp =
PB_Cnumroc( *N, 0, Aimb1, Amb, myrow, Arow, nprow );
342 Anq =
PB_Cnumroc( *N, 0, Ainb1, Anb, mycol, Acol, npcol );
344 if( ( Amp > 0 ) && ( Anq > 0 ) )
347 Aptr =
Mptr( ((
char *) A), Aii, Ajj, Ald, size );
349 XCld = XCd0[
LLD_]; YCld = YCd0[
LLD_];
350 XRld = XRd0[
LLD_]; YRld = YRd0[
LLD_];
356 PB_Clcm( ( Arow >= 0 ? nprow : 1 ), ( Acol >= 0 ? npcol : 1 ) );
359 for( k = 0; k < *N; k += nb )
361 kb = *N - k; kb =
MIN( kb, nb );
362 Akp =
PB_Cnumroc( k, 0, Aimb1, Amb, myrow, Arow, nprow );
363 Akq =
PB_Cnumroc( k, 0, Ainb1, Anb, mycol, Acol, npcol );
364 Anq0 =
PB_Cnumroc( kb, k, Ainb1, Anb, mycol, Acol, npcol );
365 if( Akp > 0 && Anq0 > 0 )
367 dger_( &Akp, &Anq0, ((
char *) ALPHA), XC, &ione,
368 Mptr( YR, 0, Akq, YRld, size ), &YRld,
369 Mptr( Aptr, 0, Akq, Ald, size ), &Ald );
370 dger_( &Akp, &Anq0, ((
char *) ALPHA), YC, &ione,
371 Mptr( XR, 0, Akq, XRld, size ), &XRld,
372 Mptr( Aptr, 0, Akq, Ald, size ), &Ald );
375 Mptr( XC, Akp, 0, XCld, size ), XCld,
376 Mptr( XR, 0, Akq, XRld, size ), XRld,
377 Mptr( YC, Akp, 0, YCld, size ), YCld,
378 Mptr( YR, 0, Akq, YRld, size ), YRld,
384 for( k = 0; k < *N; k += nb )
386 kb = *N - k; ktmp = k + ( kb =
MIN( kb, nb ) );
387 Akp =
PB_Cnumroc( k, 0, Aimb1, Amb, myrow, Arow, nprow );
388 Akq =
PB_Cnumroc( k, 0, Ainb1, Anb, mycol, Acol, npcol );
390 Mptr( XC, Akp, 0, XCld, size ), XCld,
391 Mptr( XR, 0, Akq, XRld, size ), XRld,
392 Mptr( YC, Akp, 0, YCld, size ), YCld,
393 Mptr( YR, 0, Akq, YRld, size ), YRld,
395 Akp =
PB_Cnumroc( ktmp, 0, Aimb1, Amb, myrow, Arow, nprow );
397 Anq0 =
PB_Cnumroc( kb, k, Ainb1, Anb, mycol, Acol, npcol );
398 if( Amp0 > 0 && Anq0 > 0 )
400 dger_( &Amp0, &Anq0, ((
char *) ALPHA),
401 Mptr( XC, Akp, 0, XCld, size ), &ione,
402 Mptr( YR, 0, Akq, YRld, size ), &YRld,
403 Mptr( Aptr, Akp, Akq, Ald, size ), &Ald );
404 dger_( &Amp0, &Anq0, ((
char *) ALPHA),
405 Mptr( YC, Akp, 0, YCld, size ), &ione,
406 Mptr( XR, 0, Akq, XRld, size ), &XRld,
407 Mptr( Aptr, Akp, Akq, Ald, size ), &Ald );
412 if( XRfr ) free( XR );
413 if( XCfr ) free( XC );
414 if( YRfr ) free( YR );
415 if( YCfr ) free( YC );