ScaLAPACK 2.1  2.1
ScaLAPACK: Scalable Linear Algebra PACKage
pbdtrsrt.f
Go to the documentation of this file.
1  SUBROUTINE pbdtrsrt( ICONTXT, ADIST, M, N, NB, A, LDA, BETA, B,
2  $ LDB, LCMP, LCMQ, NINT )
3 *
4 * -- PB-BLAS routine (version 2.1) --
5 * University of Tennessee, Knoxville, Oak Ridge National Laboratory.
6 * April 28, 1996
7 *
8 * .. Scalar Arguments ..
9  CHARACTER*1 ADIST
10  INTEGER ICONTXT, LCMP, LCMQ, LDA, LDB, M, N, NB, NINT
11  DOUBLE PRECISION BETA
12 * ..
13 * .. Array Arguments ..
14  DOUBLE PRECISION A( LDA, * ), B( LDB, * )
15 * ..
16 *
17 * Purpose
18 * =======
19 *
20 * PBDTRSRT forms T <== A + beta * T, where T is a sorted
21 * condensed block row (or column) from a block column (or row) of A
22 * with sorting index ISRT
23 *
24 * =====================================================================
25 *
26 * .. Parameters ..
27  DOUBLE PRECISION ONE
28  parameter( one = 1.0d+0 )
29 * ..
30 * .. Local Variables ..
31  INTEGER JA, JB, K, KK, NJUMP
32 * ..
33 * .. External Subroutines ..
34  EXTERNAL pbdmatadd
35 * ..
36 * .. External Functions ..
37  LOGICAL LSAME
38  INTEGER ICEIL
39  EXTERNAL iceil, lsame
40 * ..
41 * .. Intrinsic Functions ..
42  INTRINSIC min, mod
43 * ..
44 * .. Executable Statements ..
45 *
46  IF( lsame( adist, 'R' ) ) THEN
47  njump = nb * lcmq
48  DO 20 k = 0, lcmq-1
49  ja = nint * mod( k*lcmp, lcmq ) + 1
50  jb = k * nb + 1
51 *
52  DO 10 kk = 1, iceil( nint, nb )
53  IF( n.LT.jb ) GO TO 20
54  CALL pbdmatadd( icontxt, 'G', m, min( n-jb+1, nb ), one,
55  $ a(1, ja), lda, beta, b(1, jb), ldb )
56  ja = ja + nb
57  jb = jb + njump
58  10 CONTINUE
59  20 CONTINUE
60 *
61 * if( LSAME( ADIST, 'C') ) then
62 *
63  ELSE
64  njump = nb * lcmp
65  DO 40 k = 0, lcmp-1
66  ja = 1
67  jb = k * nb + 1
68 *
69  DO 30 kk = 1, iceil( nint, nb )
70  IF( m.LT.jb ) GO TO 40
71  CALL pbdmatadd( icontxt, 'G', min( m-jb+1, nb ), n, one,
72  $ a(ja, n*mod(k*lcmq,lcmp)+1), lda, beta,
73  $ b(jb, 1), ldb )
74  ja = ja + nb
75  jb = jb + njump
76  30 CONTINUE
77  40 CONTINUE
78  END IF
79 *
80  RETURN
81 *
82 * End of PBDTRSRT
83 *
84  END
pbdtrsrt
subroutine pbdtrsrt(ICONTXT, ADIST, M, N, NB, A, LDA, BETA, B, LDB, LCMP, LCMQ, NINT)
Definition: pbdtrsrt.f:3
pbdmatadd
subroutine pbdmatadd(ICONTXT, MODE, M, N, ALPHA, A, LDA, BETA, B, LDB)
Definition: pbdmatadd.f:3
min
#define min(A, B)
Definition: pcgemr.c:181