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

◆ pb_zlaset()

subroutine pb_zlaset ( character*1  uplo,
integer  m,
integer  n,
integer  ioffd,
complex*16  alpha,
complex*16  beta,
complex*16, dimension( lda, * )  a,
integer  lda 
)

Definition at line 10048 of file pzblastst.f.

10049*
10050* -- PBLAS test routine (version 2.0) --
10051* University of Tennessee, Knoxville, Oak Ridge National Laboratory,
10052* and University of California, Berkeley.
10053* April 1, 1998
10054*
10055* .. Scalar Arguments ..
10056 CHARACTER*1 UPLO
10057 INTEGER IOFFD, LDA, M, N
10058 COMPLEX*16 ALPHA, BETA
10059* ..
10060* .. Array Arguments ..
10061 COMPLEX*16 A( LDA, * )
10062* ..
10063*
10064* Purpose
10065* =======
10066*
10067* PB_ZLASET initializes a two-dimensional array A to beta on the diago-
10068* nal specified by IOFFD and alpha on the offdiagonals.
10069*
10070* Arguments
10071* =========
10072*
10073* UPLO (global input) CHARACTER*1
10074* On entry, UPLO specifies which trapezoidal part of the ar-
10075* ray A is to be set as follows:
10076* = 'L' or 'l': Lower triangular part is set; the strictly
10077* upper triangular part of A is not changed,
10078* = 'U' or 'u': Upper triangular part is set; the strictly
10079* lower triangular part of A is not changed,
10080* = 'D' or 'd' Only the diagonal of A is set,
10081* Otherwise: All of the array A is set.
10082*
10083* M (input) INTEGER
10084* On entry, M specifies the number of rows of the array A. M
10085* must be at least zero.
10086*
10087* N (input) INTEGER
10088* On entry, N specifies the number of columns of the array A.
10089* N must be at least zero.
10090*
10091* IOFFD (input) INTEGER
10092* On entry, IOFFD specifies the position of the offdiagonal de-
10093* limiting the upper and lower trapezoidal part of A as follows
10094* (see the notes below):
10095*
10096* IOFFD = 0 specifies the main diagonal A( i, i ),
10097* with i = 1 ... MIN( M, N ),
10098* IOFFD > 0 specifies the subdiagonal A( i+IOFFD, i ),
10099* with i = 1 ... MIN( M-IOFFD, N ),
10100* IOFFD < 0 specifies the superdiagonal A( i, i-IOFFD ),
10101* with i = 1 ... MIN( M, N+IOFFD ).
10102*
10103* ALPHA (input) COMPLEX*16
10104* On entry, ALPHA specifies the value to which the offdiagonal
10105* array elements are set to.
10106*
10107* BETA (input) COMPLEX*16
10108* On entry, BETA specifies the value to which the diagonal ar-
10109* ray elements are set to.
10110*
10111* A (input/output) COMPLEX*16 array
10112* On entry, A is an array of dimension (LDA,N). Before entry
10113* with UPLO = 'U' or 'u', the leading m by n part of the array
10114* A must contain the upper trapezoidal part of the matrix as
10115* specified by IOFFD to be set, and the strictly lower trape-
10116* zoidal part of A is not referenced; When IUPLO = 'L' or 'l',
10117* the leading m by n part of the array A must contain the
10118* lower trapezoidal part of the matrix as specified by IOFFD to
10119* be set, and the strictly upper trapezoidal part of A is
10120* not referenced.
10121*
10122* LDA (input) INTEGER
10123* On entry, LDA specifies the leading dimension of the array A.
10124* LDA must be at least max( 1, M ).
10125*
10126* Notes
10127* =====
10128* N N
10129* ---------------------------- -----------
10130* | d | | |
10131* M | d 'U' | | 'U' |
10132* | 'L' 'D' | |d |
10133* | d | M | d |
10134* ---------------------------- | 'D' |
10135* | d |
10136* IOFFD < 0 | 'L' d |
10137* | d|
10138* N | |
10139* ----------- -----------
10140* | d 'U'|
10141* | d | IOFFD > 0
10142* M | 'D' |
10143* | d| N
10144* | 'L' | ----------------------------
10145* | | | 'U' |
10146* | | |d |
10147* | | | 'D' |
10148* | | | d |
10149* | | |'L' d |
10150* ----------- ----------------------------
10151*
10152* -- Written on April 1, 1998 by
10153* Antoine Petitet, University of Tennessee, Knoxville 37996, USA.
10154*
10155* =====================================================================
10156*
10157* .. Local Scalars ..
10158 INTEGER I, J, JTMP, MN
10159* ..
10160* .. External Functions ..
10161 LOGICAL LSAME
10162 EXTERNAL lsame
10163* ..
10164* .. Intrinsic Functions ..
10165 INTRINSIC max, min
10166* ..
10167* .. Executable Statements ..
10168*
10169* Quick return if possible
10170*
10171 IF( m.LE.0 .OR. n.LE.0 )
10172 $ RETURN
10173*
10174* Start the operations
10175*
10176 IF( lsame( uplo, 'L' ) ) THEN
10177*
10178* Set the diagonal to BETA and the strictly lower triangular
10179* part of the array to ALPHA.
10180*
10181 mn = max( 0, -ioffd )
10182 DO 20 j = 1, min( mn, n )
10183 DO 10 i = 1, m
10184 a( i, j ) = alpha
10185 10 CONTINUE
10186 20 CONTINUE
10187 DO 40 j = mn + 1, min( m - ioffd, n )
10188 jtmp = j + ioffd
10189 a( jtmp, j ) = beta
10190 DO 30 i = jtmp + 1, m
10191 a( i, j ) = alpha
10192 30 CONTINUE
10193 40 CONTINUE
10194*
10195 ELSE IF( lsame( uplo, 'U' ) ) THEN
10196*
10197* Set the diagonal to BETA and the strictly upper triangular
10198* part of the array to ALPHA.
10199*
10200 mn = min( m - ioffd, n )
10201 DO 60 j = max( 0, -ioffd ) + 1, mn
10202 jtmp = j + ioffd
10203 DO 50 i = 1, jtmp - 1
10204 a( i, j ) = alpha
10205 50 CONTINUE
10206 a( jtmp, j ) = beta
10207 60 CONTINUE
10208 DO 80 j = max( 0, mn ) + 1, n
10209 DO 70 i = 1, m
10210 a( i, j ) = alpha
10211 70 CONTINUE
10212 80 CONTINUE
10213*
10214 ELSE IF( lsame( uplo, 'D' ) ) THEN
10215*
10216* Set the array to BETA on the diagonal.
10217*
10218 DO 90 j = max( 0, -ioffd ) + 1, min( m - ioffd, n )
10219 a( j + ioffd, j ) = beta
10220 90 CONTINUE
10221*
10222 ELSE
10223*
10224* Set the array to BETA on the diagonal and ALPHA on the
10225* offdiagonal.
10226*
10227 DO 110 j = 1, n
10228 DO 100 i = 1, m
10229 a( i, j ) = alpha
10230 100 CONTINUE
10231 110 CONTINUE
10232 IF( alpha.NE.beta .AND. ioffd.LT.m .AND. ioffd.GT.-n ) THEN
10233 DO 120 j = max( 0, -ioffd ) + 1, min( m - ioffd, n )
10234 a( j + ioffd, j ) = beta
10235 120 CONTINUE
10236 END IF
10237*
10238 END IF
10239*
10240 RETURN
10241*
10242* End of PB_ZLASET
10243*
#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: