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

◆ pb_slascal()

subroutine pb_slascal ( character*1  uplo,
integer  m,
integer  n,
integer  ioffd,
real  alpha,
real, dimension( lda, * )  a,
integer  lda 
)

Definition at line 9557 of file psblastst.f.

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