14 #include "../PBpblas.h"
15 #include "../PBtools.h"
16 #include "../PBblacs.h"
17 #include "../PBblas.h"
21 int M,
int N,
char * ALPHA,
char * A,
int IA,
int JA,
22 int * DESCA,
char * BETA,
char * C,
int IC,
int JC,
25 void PB_Cptradd(
TYPE, DIRECAC, UPLO, TRANS, M, N, ALPHA, A, IA, JA, DESCA,
26 BETA, C, IC, JC, DESCC )
30 char * DIRECAC, * TRANS, * UPLO;
31 int IA, IC, JA, JC, M, N;
229 char Dir, * one, * zero;
230 int Afr, conjg, k, kb, kbb, kend, kstart, kstep, ktmp;
251 kstart = 0; kend = ( (
MIN( M, N ) - 1 ) / kb + 1 ) * kb; kstep = kb;
256 kstart = ( (
MIN( M, N ) - 1 ) / kb ) * kb; kend = kstep = -kb;
265 for( k = kstart; k != kend; k += kstep )
267 kbb = N - k; kbb =
MIN( kbb, kb ); ktmp = k + kbb;
272 COLUMN, &Aptr, DBUFA, &Afr );
283 Aptr, k+1, 0, DBUFA );
288 one, C, IC, JC+k, DESCC,
COLUMN );
290 if( Afr ) free( Aptr );
295 for( k = kstart; k != kend; k += kstep )
297 kbb = M - k; kbb =
MIN( kbb, kb ); ktmp = N - k;
302 DESCA,
ROW, &Aptr, DBUFA, &Afr );
318 one, C, IC+k, JC+k, DESCC,
ROW );
320 if( Afr ) free( Aptr );
328 for( k = kstart; k != kend; k += kstep )
330 kbb = N - k; kbb =
MIN( kbb, kb ); ktmp = M - k;
335 DESCA,
COLUMN, &Aptr, DBUFA, &Afr );
351 one, C, IC+k, JC+k, DESCC,
COLUMN );
353 if( Afr ) free( Aptr );
358 for( k = kstart; k != kend; k += kstep )
360 kbb = M - k; kbb =
MIN( kbb, kb ); ktmp = k + kbb;
365 DESCA,
ROW, &Aptr, DBUFA, &Afr );
376 Aptr, 0, k+1, DBUFA );
381 one, C, IC+k, JC, DESCC,
ROW );
383 if( Afr ) free( Aptr );
396 for( k = kstart; k != kend; k += kstep )
398 kbb = N - k; kbb =
MIN( kbb, kb ); ktmp = k + kbb;
403 ROW, &Aptr, DBUFA, &Afr );
417 Aptr, 0, k+1, DBUFA );
422 one, C, IC, JC+k, DESCC,
COLUMN );
424 if( Afr ) free( Aptr );
429 for( k = kstart; k != kend; k += kstep )
431 kbb = M - k; kbb =
MIN( kbb, kb ); ktmp = N - k;
436 DESCA,
COLUMN, &Aptr, DBUFA, &Afr );
455 one, C, IC+k, JC+k, DESCC,
ROW );
457 if( Afr ) free( Aptr );
465 for( k = kstart; k != kend; k += kstep )
467 kbb = N - k; kbb =
MIN( kbb, kb ); ktmp = M - k;
472 DESCA,
ROW, &Aptr, DBUFA, &Afr );
491 one, C, IC+k, JC+k, DESCC,
COLUMN );
493 if( Afr ) free( Aptr );
498 for( k = kstart; k != kend; k += kstep )
500 kbb = M - k; kbb =
MIN( kbb, kb ); ktmp = k + kbb;
505 DESCA,
COLUMN, &Aptr, DBUFA, &Afr );
519 Aptr, k+1, 0, DBUFA );
524 one, C, IC+k, JC, DESCC,
ROW );
526 if( Afr ) free( Aptr );