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

◆ pb_claset()

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

Definition at line 10046 of file pcblastst.f.

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