21 int * M,
int * N,
float * ALPHA,
22 float * A,
int * IA,
int * JA,
int * DESCA,
23 float * B,
int * IB,
int * JB,
int * DESCB )
25 void pctrmm_( SIDE, UPLO, TRANS, DIAG, M, N, ALPHA,
26 A, IA, JA, DESCA, B, IB, JB, DESCB )
31 int * IA, * IB, * JA, * JB, * M, * N;
242 char DiagA, DirB, OpC, OpR, SideOp, TopC, TopR, TranOp, UploA,
243 Var, ctop, ctopsave, rtop, rtopsave;
244 int Ai, Aj, Bi, Bj, ChooseAB, ForceTop, ctxt, info, lside, mycol,
245 myrow, nb, notran, nounit, npcol, nprow, upper;
246 double ABestL, ABestR, Best, tmp1, tmp2, tmp3, tmp4;
267 if( !( info = ( ( nprow == -1 ) ? -( 1101 +
CTXT_ ) : 0 ) ) )
269 if( ( !lside ) && ( SideOp !=
CRIGHT ) )
271 PB_Cwarn( ctxt, __LINE__,
"PCTRMM",
"Illegal SIDE = %c\n", SideOp );
274 else if( ( !upper ) && ( UploA !=
CLOWER ) )
276 PB_Cwarn( ctxt, __LINE__,
"PCTRMM",
"Illegal UPLO = %c\n", UploA );
279 else if( ( !notran ) && ( TranOp !=
CTRAN ) && ( TranOp !=
CCOTRAN ) )
281 PB_Cwarn( ctxt, __LINE__,
"PCTRMM",
"Illegal TRANS = %c\n", TranOp );
284 if( ( !nounit ) && ( DiagA !=
CUNIT ) )
287 "Illegal DIAG = %c\n", DiagA );
291 PB_Cchkmat( ctxt,
"PCTRMM",
"A", *M, 5, *M, 5, Ai, Aj, Ad, 11,
294 PB_Cchkmat( ctxt,
"PCTRMM",
"A", *N, 6, *N, 6, Ai, Aj, Ad, 11,
296 PB_Cchkmat( ctxt,
"PCTRMM",
"B", *M, 5, *N, 6, Bi, Bj, Bd, 15,
299 if( info ) {
PB_Cabort( ctxt,
"PCTRMM", info );
return; }
304 if( *M == 0 || *N == 0 )
return;
315 ((
char *) B), Bi, Bj, Bd );
338 ABestR = (double)(*M) *
339 ( ( ( ( Ad[
CSRC_] == -1 ) || ( npcol == 1 ) ) ?
ZERO : tmp1 /
TWO ) +
340 ( ( ( Bd[
RSRC_] == -1 ) || ( nprow == 1 ) ) ?
ZERO : tmp4 ) );
343 Best = (double)(*N) *
345 ( nprow == 1 ?
ZERO : tmp2 ) +
MAX( tmp2, tmp4 ) );
346 ChooseAB = ( ( 1.1 * ABestR ) <= Best );
352 ABestL = (double)(*M) *
353 ( ( ( ( Ad[
CSRC_] == -1 ) || ( npcol == 1 ) ) ?
ZERO : tmp1 /
TWO ) +
355 ( ( ( Bd[
RSRC_] == -1 ) || ( nprow == 1 ) ) ?
ZERO : tmp4 ) );
356 ABestR = (double)(*M) *
357 ( ( ( ( Ad[
CSRC_] == -1 ) || ( npcol == 1 ) ) ?
ZERO : tmp1 /
TWO ) +
358 ( ( ( Bd[
RSRC_] == -1 ) || ( nprow == 1 ) ) ?
ZERO : tmp4 ) +
359 MAX( tmp2, tmp1 ) /
TWO );
362 Best = (double)(*N) *
363 ( ( ( ( Bd[
CSRC_] == -1 ) || ( npcol == 1 ) ) ?
ZERO : tmp1 ) +
365 ChooseAB = ( ( ( 1.1 * ABestL ) <= Best ) ||
366 ( ( 1.1 * ABestR ) <= Best ) );
374 ABestR = (double)(*N) *
375 ( ( ( ( Ad[
RSRC_] == -1 ) || ( nprow == 1 ) ) ?
ZERO : tmp2 /
TWO ) +
376 ( ( ( Bd[
CSRC_] == -1 ) || ( npcol == 1 ) ) ?
ZERO : tmp3 ) );
379 Best = (double)(*M) *
381 ( npcol == 1 ?
ZERO : tmp1 ) +
MAX( tmp1, tmp3 ) );
382 ChooseAB = ( ( 1.1 * ABestR ) <= Best );
388 ABestL = (double)(*N) *
389 ( ( ( ( Ad[
RSRC_] == -1 ) || ( nprow == 1 ) ) ?
ZERO : tmp2 /
TWO ) +
391 ( ( ( Bd[
CSRC_] == -1 ) || ( npcol == 1 ) ) ?
ZERO : tmp3 ) );
392 ABestR = (double)(*N) *
393 ( ( ( ( Ad[
RSRC_] == -1 ) || ( nprow == 1 ) ) ?
ZERO : tmp2 /
TWO ) +
394 ( ( ( Bd[
CSRC_] == -1 ) || ( npcol == 1 ) ) ?
ZERO : tmp3 ) +
395 MAX( tmp2, tmp1 ) /
TWO );
398 Best = (double)(*M) *
399 ( ( ( ( Bd[
RSRC_] == -1 ) || ( nprow == 1 ) ) ?
ZERO : tmp2 ) +
401 ChooseAB = ( ( ( 1.1 * ABestL ) <= Best ) ||
402 ( ( 1.1 * ABestR ) <= Best ) );
411 ForceTop = ( ( *M > nb ) && ( *N > nb ) );
425 if( ABestL <= ABestR )
449 if( ABestL <= ABestR )
469 if( ( rtopsave = rtop ) != TopR )
471 if( ( ctopsave = ctop ) != TopC )
483 PB_CptrmmAB( type, &Var, &SideOp, &UploA, &TranOp, &DiagA, *M, *N,
484 ((
char *)ALPHA), ((
char *)A), Ai, Aj, Ad, ((
char *)B), Bi,
489 if( ( lside && notran ) || ( !( lside ) && !( notran ) ) )
545 PB_CptrmmB( type, &DirB, &SideOp, &UploA, &TranOp, &DiagA, *M, *N,
546 ((
char *)ALPHA), ((
char *)A), Ai, Aj, Ad, ((
char *)B), Bi,
554 rtopsave = *
PB_Ctop( &ctxt, &OpR,
ROW, &rtopsave );