14 #include "../PBpblas.h"
15 #include "../PBtools.h"
16 #include "../PBblacs.h"
17 #include "../PBblas.h"
21 int N,
char * ALPHA,
char * A,
int IA,
int JA,
28 char * CONJUG, * UPLO;
173 char UploA, herm, type;
174 int Acol, Arow, Aii, Aimb1, Ainb1, Ajj, Akp, Akq, Ald, Amb, Amp,
175 Amp0, Anb, Anq, Anq0, ctxt, izero=0, k, kb, ktmp, mn, mycol,
176 myrow, nb, npcol, nprow, size;
190 if( ( M <= 0 ) || ( N <= 0 ) )
return;
208 else if( type ==
DREAL )
218 else if( type ==
SCPLX )
243 else if( type ==
DCPLX )
275 PB_Cdescribe( M, N, IA, JA, DESCA, nprow, npcol, myrow, mycol, &Aii, &Ajj,
276 &Ald, &Aimb1, &Ainb1, &Amb, &Anb, &Arow, &Acol, Ad0 );
280 Amp =
PB_Cnumroc( M, 0, Aimb1, Amb, myrow, Arow, nprow );
281 Anq =
PB_Cnumroc( N, 0, Ainb1, Anb, mycol, Acol, npcol );
282 if( ( Amp <= 0 ) || ( Anq <= 0 ) )
return;
286 Aptr =
Mptr( A, Aii, Ajj, Ald, size );
292 ( ( ( Arow < 0 ) || ( nprow == 1 ) ) &&
293 ( ( Acol < 0 ) || ( npcol == 1 ) ) ) )
295 scal(
C2F_CHAR( UPLO ), &Amp, &Anq, &izero, ALPHA, Aptr, &Ald );
304 PB_Clcm( ( Arow >= 0 ? nprow : 1 ), ( Acol >= 0 ? npcol : 1 ) );
315 for( k = 0; k < mn; k += nb )
317 kb = mn - k; ktmp = k + ( kb =
MIN( kb, nb ) );
319 Akp =
PB_Cnumroc( ktmp, 0, Aimb1, Amb, myrow, Arow, nprow );
320 Akq =
PB_Cnumroc( k, 0, Ainb1, Anb, mycol, Acol, npcol );
321 Anq0 =
PB_Cnumroc( kb, k, Ainb1, Anb, mycol, Acol, npcol );
322 if( ( Amp0 = Amp - Akp ) > 0 )
324 Akp, Akq, Ald, size ), &Ald );
335 for( k = 0; k < mn; k += nb )
337 kb = mn - k; kb =
MIN( kb, nb );
338 Akp =
PB_Cnumroc( k, 0, Aimb1, Amb, myrow, Arow, nprow );
339 Akq =
PB_Cnumroc( k, 0, Ainb1, Anb, mycol, Acol, npcol );
340 Anq0 =
PB_Cnumroc( kb, k, Ainb1, Anb, mycol, Acol, npcol );
343 0, Akq, Ald, size ), &Ald );
346 if( ( Anq -= ( Akq += Anq0 ) ) > 0 )
348 Akq, Ald, size ), &Ald );
358 for( k = 0; k < mn; k += nb )
360 kb = mn - k; kb =
MIN( kb, nb );
361 Akp =
PB_Cnumroc( k, 0, Aimb1, Amb, myrow, Arow, nprow );
362 Akq =
PB_Cnumroc( k, 0, Ainb1, Anb, mycol, Acol, npcol );
363 Anq0 =
PB_Cnumroc( kb, k, Ainb1, Anb, mycol, Acol, npcol );
366 0, Akq, Ald, size ), &Ald );
368 Akp =
PB_Cnumroc( k+kb, 0, Aimb1, Amb, myrow, Arow, nprow );
369 if( ( Amp0 = Amp - Akp ) > 0 )
371 Akp, Akq, Ald, size ), &Ald );
373 if( ( Anq -= ( Akq += Anq0 ) ) > 0 )
375 Akq, Ald, size ), &Ald );