ScaLAPACK  2.0.2
ScaLAPACK: Scalable Linear Algebra PACKage
pbdtrsrt.f
Go to the documentation of this file.
00001       SUBROUTINE PBDTRSRT( ICONTXT, ADIST, M, N, NB, A, LDA, BETA, B,
00002      $                     LDB, LCMP, LCMQ, NINT )
00003 *
00004 *  -- PB-BLAS routine (version 2.1) --
00005 *     University of Tennessee, Knoxville, Oak Ridge National Laboratory.
00006 *     April 28, 1996
00007 *
00008 *     .. Scalar Arguments ..
00009       CHARACTER*1        ADIST
00010       INTEGER            ICONTXT, LCMP, LCMQ, LDA, LDB, M, N, NB, NINT
00011       DOUBLE PRECISION   BETA
00012 *     ..
00013 *     .. Array Arguments ..
00014       DOUBLE PRECISION   A( LDA, * ), B( LDB, * )
00015 *     ..
00016 *
00017 *  Purpose
00018 *  =======
00019 *
00020 *  PBDTRSRT forms   T <== A + beta * T, where T is a sorted
00021 *  condensed block row (or column) from a block column (or row) of A
00022 *  with sorting index ISRT
00023 *
00024 *  =====================================================================
00025 *
00026 *     .. Parameters ..
00027       DOUBLE PRECISION   ONE
00028       PARAMETER          ( ONE = 1.0D+0 )
00029 *     ..
00030 *     .. Local Variables ..
00031       INTEGER            JA, JB, K, KK, NJUMP
00032 *     ..
00033 *     .. External Subroutines ..
00034       EXTERNAL           PBDMATADD
00035 *     ..
00036 *     .. External Functions ..
00037       LOGICAL            LSAME
00038       INTEGER            ICEIL
00039       EXTERNAL           ICEIL, LSAME
00040 *     ..
00041 *     .. Intrinsic Functions ..
00042       INTRINSIC          MIN, MOD
00043 *     ..
00044 *     .. Executable Statements ..
00045 *
00046       IF( LSAME( ADIST, 'R' ) ) THEN
00047          NJUMP = NB * LCMQ
00048          DO 20 K = 0, LCMQ-1
00049             JA = NINT * MOD( K*LCMP, LCMQ ) + 1
00050             JB = K * NB + 1
00051 *
00052             DO 10 KK = 1, ICEIL( NINT, NB )
00053                IF( N.LT.JB ) GO TO 20
00054                CALL PBDMATADD( ICONTXT, 'G', M, MIN( N-JB+1, NB ), ONE,
00055      $                         A(1, JA), LDA, BETA, B(1, JB), LDB )
00056                JA = JA + NB
00057                JB = JB + NJUMP
00058    10       CONTINUE
00059    20    CONTINUE
00060 *
00061 *     if( LSAME( ADIST, 'C') ) then
00062 *
00063       ELSE
00064          NJUMP = NB * LCMP
00065          DO 40 K = 0, LCMP-1
00066             JA = 1
00067             JB = K * NB + 1
00068 *
00069             DO 30 KK = 1, ICEIL( NINT, NB )
00070                IF( M.LT.JB ) GO TO 40
00071                CALL PBDMATADD( ICONTXT, 'G', MIN( M-JB+1, NB ), N, ONE,
00072      $                         A(JA, N*MOD(K*LCMQ,LCMP)+1), LDA, BETA,
00073      $                         B(JB, 1), LDB )
00074                JA = JA + NB
00075                JB = JB + NJUMP
00076    30       CONTINUE
00077    40    CONTINUE
00078       END IF
00079 *
00080       RETURN
00081 *
00082 *     End of PBDTRSRT
00083 *
00084       END