ScaLAPACK 2.1  2.1
ScaLAPACK: Scalable Linear Algebra PACKage
pbstrsrt.f
Go to the documentation of this file.
1  SUBROUTINE pbstrsrt( 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  REAL BETA
12 * ..
13 * .. Array Arguments ..
14  REAL A( LDA, * ), B( LDB, * )
15 * ..
16 *
17 * Purpose
18 * =======
19 *
20 * PBSTRSRT 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  REAL ONE
28  parameter( one = 1.0e+0 )
29 * ..
30 * .. Local Variables ..
31  INTEGER JA, JB, K, KK, NJUMP
32 * ..
33 * .. External Subroutines ..
34  EXTERNAL pbsmatadd
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 pbsmatadd( 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 pbsmatadd( 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 PBSTRSRT
83 *
84  END
pbstrsrt
subroutine pbstrsrt(ICONTXT, ADIST, M, N, NB, A, LDA, BETA, B, LDB, LCMP, LCMQ, NINT)
Definition: pbstrsrt.f:3
pbsmatadd
subroutine pbsmatadd(ICONTXT, MODE, M, N, ALPHA, A, LDA, BETA, B, LDB)
Definition: pbsmatadd.f:3
min
#define min(A, B)
Definition: pcgemr.c:181