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

◆ pb_slaset()

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

Definition at line 9360 of file psblastst.f.

9361*
9362* -- PBLAS test routine (version 2.0) --
9363* University of Tennessee, Knoxville, Oak Ridge National Laboratory,
9364* and University of California, Berkeley.
9365* April 1, 1998
9366*
9367* .. Scalar Arguments ..
9368 CHARACTER*1 UPLO
9369 INTEGER IOFFD, LDA, M, N
9370 REAL ALPHA, BETA
9371* ..
9372* .. Array Arguments ..
9373 REAL A( LDA, * )
9374* ..
9375*
9376* Purpose
9377* =======
9378*
9379* PB_SLASET initializes a two-dimensional array A to beta on the diago-
9380* nal specified by IOFFD and alpha on the offdiagonals.
9381*
9382* Arguments
9383* =========
9384*
9385* UPLO (global input) CHARACTER*1
9386* On entry, UPLO specifies which trapezoidal part of the ar-
9387* ray A is to be set as follows:
9388* = 'L' or 'l': Lower triangular part is set; the strictly
9389* upper triangular part of A is not changed,
9390* = 'U' or 'u': Upper triangular part is set; the strictly
9391* lower triangular part of A is not changed,
9392* = 'D' or 'd' Only the diagonal of A is set,
9393* Otherwise: All of the array A is set.
9394*
9395* M (input) INTEGER
9396* On entry, M specifies the number of rows of the array A. M
9397* must be at least zero.
9398*
9399* N (input) INTEGER
9400* On entry, N specifies the number of columns of the array A.
9401* N must be at least zero.
9402*
9403* IOFFD (input) INTEGER
9404* On entry, IOFFD specifies the position of the offdiagonal de-
9405* limiting the upper and lower trapezoidal part of A as follows
9406* (see the notes below):
9407*
9408* IOFFD = 0 specifies the main diagonal A( i, i ),
9409* with i = 1 ... MIN( M, N ),
9410* IOFFD > 0 specifies the subdiagonal A( i+IOFFD, i ),
9411* with i = 1 ... MIN( M-IOFFD, N ),
9412* IOFFD < 0 specifies the superdiagonal A( i, i-IOFFD ),
9413* with i = 1 ... MIN( M, N+IOFFD ).
9414*
9415* ALPHA (input) REAL
9416* On entry, ALPHA specifies the value to which the offdiagonal
9417* array elements are set to.
9418*
9419* BETA (input) REAL
9420* On entry, BETA specifies the value to which the diagonal ar-
9421* ray elements are set to.
9422*
9423* A (input/output) REAL array
9424* On entry, A is an array of dimension (LDA,N). Before entry
9425* with UPLO = 'U' or 'u', the leading m by n part of the array
9426* A must contain the upper trapezoidal part of the matrix as
9427* specified by IOFFD to be set, and the strictly lower trape-
9428* zoidal part of A is not referenced; When IUPLO = 'L' or 'l',
9429* the leading m by n part of the array A must contain the
9430* lower trapezoidal part of the matrix as specified by IOFFD to
9431* be set, and the strictly upper trapezoidal part of A is
9432* not referenced.
9433*
9434* LDA (input) INTEGER
9435* On entry, LDA specifies the leading dimension of the array A.
9436* LDA must be at least max( 1, M ).
9437*
9438* Notes
9439* =====
9440* N N
9441* ---------------------------- -----------
9442* | d | | |
9443* M | d 'U' | | 'U' |
9444* | 'L' 'D' | |d |
9445* | d | M | d |
9446* ---------------------------- | 'D' |
9447* | d |
9448* IOFFD < 0 | 'L' d |
9449* | d|
9450* N | |
9451* ----------- -----------
9452* | d 'U'|
9453* | d | IOFFD > 0
9454* M | 'D' |
9455* | d| N
9456* | 'L' | ----------------------------
9457* | | | 'U' |
9458* | | |d |
9459* | | | 'D' |
9460* | | | d |
9461* | | |'L' d |
9462* ----------- ----------------------------
9463*
9464* -- Written on April 1, 1998 by
9465* Antoine Petitet, University of Tennessee, Knoxville 37996, USA.
9466*
9467* =====================================================================
9468*
9469* .. Local Scalars ..
9470 INTEGER I, J, JTMP, MN
9471* ..
9472* .. External Functions ..
9473 LOGICAL LSAME
9474 EXTERNAL lsame
9475* ..
9476* .. Intrinsic Functions ..
9477 INTRINSIC max, min
9478* ..
9479* .. Executable Statements ..
9480*
9481* Quick return if possible
9482*
9483 IF( m.LE.0 .OR. n.LE.0 )
9484 $ RETURN
9485*
9486* Start the operations
9487*
9488 IF( lsame( uplo, 'L' ) ) THEN
9489*
9490* Set the diagonal to BETA and the strictly lower triangular
9491* part of the array to ALPHA.
9492*
9493 mn = max( 0, -ioffd )
9494 DO 20 j = 1, min( mn, n )
9495 DO 10 i = 1, m
9496 a( i, j ) = alpha
9497 10 CONTINUE
9498 20 CONTINUE
9499 DO 40 j = mn + 1, min( m - ioffd, n )
9500 jtmp = j + ioffd
9501 a( jtmp, j ) = beta
9502 DO 30 i = jtmp + 1, m
9503 a( i, j ) = alpha
9504 30 CONTINUE
9505 40 CONTINUE
9506*
9507 ELSE IF( lsame( uplo, 'U' ) ) THEN
9508*
9509* Set the diagonal to BETA and the strictly upper triangular
9510* part of the array to ALPHA.
9511*
9512 mn = min( m - ioffd, n )
9513 DO 60 j = max( 0, -ioffd ) + 1, mn
9514 jtmp = j + ioffd
9515 DO 50 i = 1, jtmp - 1
9516 a( i, j ) = alpha
9517 50 CONTINUE
9518 a( jtmp, j ) = beta
9519 60 CONTINUE
9520 DO 80 j = max( 0, mn ) + 1, n
9521 DO 70 i = 1, m
9522 a( i, j ) = alpha
9523 70 CONTINUE
9524 80 CONTINUE
9525*
9526 ELSE IF( lsame( uplo, 'D' ) ) THEN
9527*
9528* Set the array to BETA on the diagonal.
9529*
9530 DO 90 j = max( 0, -ioffd ) + 1, min( m - ioffd, n )
9531 a( j + ioffd, j ) = beta
9532 90 CONTINUE
9533*
9534 ELSE
9535*
9536* Set the array to BETA on the diagonal and ALPHA on the
9537* offdiagonal.
9538*
9539 DO 110 j = 1, n
9540 DO 100 i = 1, m
9541 a( i, j ) = alpha
9542 100 CONTINUE
9543 110 CONTINUE
9544 IF( alpha.NE.beta .AND. ioffd.LT.m .AND. ioffd.GT.-n ) THEN
9545 DO 120 j = max( 0, -ioffd ) + 1, min( m - ioffd, n )
9546 a( j + ioffd, j ) = beta
9547 120 CONTINUE
9548 END IF
9549*
9550 END IF
9551*
9552 RETURN
9553*
9554* End of PB_SLASET
9555*
#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: