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

◆ pb_dlaset()

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

Definition at line 9358 of file pdblastst.f.

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