SCALAPACK 2.2.2
LAPACK: Linear Algebra PACKage
Loading...
Searching...
No Matches

◆ pb_dlascal()

subroutine pb_dlascal ( character*1  uplo,
integer  m,
integer  n,
integer  ioffd,
double precision  alpha,
double precision, dimension( lda, * )  a,
integer  lda 
)

Definition at line 9555 of file pdblastst.f.

9556*
9557* -- PBLAS test routine (version 2.0) --
9558* University of Tennessee, Knoxville, Oak Ridge National Laboratory,
9559* and University of California, Berkeley.
9560* April 1, 1998
9561*
9562* .. Scalar Arguments ..
9563 CHARACTER*1 UPLO
9564 INTEGER IOFFD, LDA, M, N
9565 DOUBLE PRECISION ALPHA
9566* ..
9567* .. Array Arguments ..
9568 DOUBLE PRECISION A( LDA, * )
9569* ..
9570*
9571* Purpose
9572* =======
9573*
9574* PB_DLASCAL scales a two-dimensional array A by the scalar alpha.
9575*
9576* Arguments
9577* =========
9578*
9579* UPLO (input) CHARACTER*1
9580* On entry, UPLO specifies which trapezoidal part of the ar-
9581* ray A is to be scaled as follows:
9582* = 'L' or 'l': the lower trapezoid of A is scaled,
9583* = 'U' or 'u': the upper trapezoid of A is scaled,
9584* = 'D' or 'd': diagonal specified by IOFFD is scaled,
9585* Otherwise: all of the array A is scaled.
9586*
9587* M (input) INTEGER
9588* On entry, M specifies the number of rows of the array A. M
9589* must be at least zero.
9590*
9591* N (input) INTEGER
9592* On entry, N specifies the number of columns of the array A.
9593* N must be at least zero.
9594*
9595* IOFFD (input) INTEGER
9596* On entry, IOFFD specifies the position of the offdiagonal de-
9597* limiting the upper and lower trapezoidal part of A as follows
9598* (see the notes below):
9599*
9600* IOFFD = 0 specifies the main diagonal A( i, i ),
9601* with i = 1 ... MIN( M, N ),
9602* IOFFD > 0 specifies the subdiagonal A( i+IOFFD, i ),
9603* with i = 1 ... MIN( M-IOFFD, N ),
9604* IOFFD < 0 specifies the superdiagonal A( i, i-IOFFD ),
9605* with i = 1 ... MIN( M, N+IOFFD ).
9606*
9607* ALPHA (input) DOUBLE PRECISION
9608* On entry, ALPHA specifies the scalar alpha.
9609*
9610* A (input/output) DOUBLE PRECISION array
9611* On entry, A is an array of dimension (LDA,N). Before entry
9612* with UPLO = 'U' or 'u', the leading m by n part of the array
9613* A must contain the upper trapezoidal part of the matrix as
9614* specified by IOFFD to be scaled, and the strictly lower tra-
9615* pezoidal part of A is not referenced; When UPLO = 'L' or 'l',
9616* the leading m by n part of the array A must contain the lower
9617* trapezoidal part of the matrix as specified by IOFFD to be
9618* scaled, and the strictly upper trapezoidal part of A is not
9619* referenced. On exit, the entries of the trapezoid part of A
9620* determined by UPLO and IOFFD are scaled.
9621*
9622* LDA (input) INTEGER
9623* On entry, LDA specifies the leading dimension of the array A.
9624* LDA must be at least max( 1, M ).
9625*
9626* Notes
9627* =====
9628* N N
9629* ---------------------------- -----------
9630* | d | | |
9631* M | d 'U' | | 'U' |
9632* | 'L' 'D' | |d |
9633* | d | M | d |
9634* ---------------------------- | 'D' |
9635* | d |
9636* IOFFD < 0 | 'L' d |
9637* | d|
9638* N | |
9639* ----------- -----------
9640* | d 'U'|
9641* | d | IOFFD > 0
9642* M | 'D' |
9643* | d| N
9644* | 'L' | ----------------------------
9645* | | | 'U' |
9646* | | |d |
9647* | | | 'D' |
9648* | | | d |
9649* | | |'L' d |
9650* ----------- ----------------------------
9651*
9652* -- Written on April 1, 1998 by
9653* Antoine Petitet, University of Tennessee, Knoxville 37996, USA.
9654*
9655* =====================================================================
9656*
9657* .. Local Scalars ..
9658 INTEGER I, J, JTMP, MN
9659* ..
9660* .. External Functions ..
9661 LOGICAL LSAME
9662 EXTERNAL lsame
9663* ..
9664* .. Intrinsic Functions ..
9665 INTRINSIC max, min
9666* ..
9667* .. Executable Statements ..
9668*
9669* Quick return if possible
9670*
9671 IF( m.LE.0 .OR. n.LE.0 )
9672 $ RETURN
9673*
9674* Start the operations
9675*
9676 IF( lsame( uplo, 'L' ) ) THEN
9677*
9678* Scales the lower triangular part of the array by ALPHA.
9679*
9680 mn = max( 0, -ioffd )
9681 DO 20 j = 1, min( mn, n )
9682 DO 10 i = 1, m
9683 a( i, j ) = alpha * a( i, j )
9684 10 CONTINUE
9685 20 CONTINUE
9686 DO 40 j = mn + 1, min( m - ioffd, n )
9687 DO 30 i = j + ioffd, m
9688 a( i, j ) = alpha * a( i, j )
9689 30 CONTINUE
9690 40 CONTINUE
9691*
9692 ELSE IF( lsame( uplo, 'U' ) ) THEN
9693*
9694* Scales the upper triangular part of the array by ALPHA.
9695*
9696 mn = min( m - ioffd, n )
9697 DO 60 j = max( 0, -ioffd ) + 1, mn
9698 DO 50 i = 1, j + ioffd
9699 a( i, j ) = alpha * a( i, j )
9700 50 CONTINUE
9701 60 CONTINUE
9702 DO 80 j = max( 0, mn ) + 1, n
9703 DO 70 i = 1, m
9704 a( i, j ) = alpha * a( i, j )
9705 70 CONTINUE
9706 80 CONTINUE
9707*
9708 ELSE IF( lsame( uplo, 'D' ) ) THEN
9709*
9710* Scales the diagonal entries by ALPHA.
9711*
9712 DO 90 j = max( 0, -ioffd ) + 1, min( m - ioffd, n )
9713 jtmp = j + ioffd
9714 a( jtmp, j ) = alpha * a( jtmp, j )
9715 90 CONTINUE
9716*
9717 ELSE
9718*
9719* Scales the entire array by ALPHA.
9720*
9721 DO 110 j = 1, n
9722 DO 100 i = 1, m
9723 a( i, j ) = alpha * a( i, j )
9724 100 CONTINUE
9725 110 CONTINUE
9726*
9727 END IF
9728*
9729 RETURN
9730*
9731* End of PB_DLASCAL
9732*
#define max(A, B)
Definition pcgemr.c:180
#define min(A, B)
Definition pcgemr.c:181
logical function lsame(ca, cb)
Definition tools.f:1724
Here is the caller graph for this function: