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

◆ pb_zlascal()

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

Definition at line 10245 of file pzblastst.f.

10246*
10247* -- PBLAS test routine (version 2.0) --
10248* University of Tennessee, Knoxville, Oak Ridge National Laboratory,
10249* and University of California, Berkeley.
10250* April 1, 1998
10251*
10252* .. Scalar Arguments ..
10253 CHARACTER*1 UPLO
10254 INTEGER IOFFD, LDA, M, N
10255 COMPLEX*16 ALPHA
10256* ..
10257* .. Array Arguments ..
10258 COMPLEX*16 A( LDA, * )
10259* ..
10260*
10261* Purpose
10262* =======
10263*
10264* PB_ZLASCAL scales a two-dimensional array A by the scalar alpha.
10265*
10266* Arguments
10267* =========
10268*
10269* UPLO (input) CHARACTER*1
10270* On entry, UPLO specifies which trapezoidal part of the ar-
10271* ray A is to be scaled as follows:
10272* = 'L' or 'l': the lower trapezoid of A is scaled,
10273* = 'U' or 'u': the upper trapezoid of A is scaled,
10274* = 'D' or 'd': diagonal specified by IOFFD is scaled,
10275* Otherwise: all of the array A is scaled.
10276*
10277* M (input) INTEGER
10278* On entry, M specifies the number of rows of the array A. M
10279* must be at least zero.
10280*
10281* N (input) INTEGER
10282* On entry, N specifies the number of columns of the array A.
10283* N must be at least zero.
10284*
10285* IOFFD (input) INTEGER
10286* On entry, IOFFD specifies the position of the offdiagonal de-
10287* limiting the upper and lower trapezoidal part of A as follows
10288* (see the notes below):
10289*
10290* IOFFD = 0 specifies the main diagonal A( i, i ),
10291* with i = 1 ... MIN( M, N ),
10292* IOFFD > 0 specifies the subdiagonal A( i+IOFFD, i ),
10293* with i = 1 ... MIN( M-IOFFD, N ),
10294* IOFFD < 0 specifies the superdiagonal A( i, i-IOFFD ),
10295* with i = 1 ... MIN( M, N+IOFFD ).
10296*
10297* ALPHA (input) COMPLEX*16
10298* On entry, ALPHA specifies the scalar alpha.
10299*
10300* A (input/output) COMPLEX*16 array
10301* On entry, A is an array of dimension (LDA,N). Before entry
10302* with UPLO = 'U' or 'u', the leading m by n part of the array
10303* A must contain the upper trapezoidal part of the matrix as
10304* specified by IOFFD to be scaled, and the strictly lower tra-
10305* pezoidal part of A is not referenced; When UPLO = 'L' or 'l',
10306* the leading m by n part of the array A must contain the lower
10307* trapezoidal part of the matrix as specified by IOFFD to be
10308* scaled, and the strictly upper trapezoidal part of A is not
10309* referenced. On exit, the entries of the trapezoid part of A
10310* determined by UPLO and IOFFD are scaled.
10311*
10312* LDA (input) INTEGER
10313* On entry, LDA specifies the leading dimension of the array A.
10314* LDA must be at least max( 1, M ).
10315*
10316* Notes
10317* =====
10318* N N
10319* ---------------------------- -----------
10320* | d | | |
10321* M | d 'U' | | 'U' |
10322* | 'L' 'D' | |d |
10323* | d | M | d |
10324* ---------------------------- | 'D' |
10325* | d |
10326* IOFFD < 0 | 'L' d |
10327* | d|
10328* N | |
10329* ----------- -----------
10330* | d 'U'|
10331* | d | IOFFD > 0
10332* M | 'D' |
10333* | d| N
10334* | 'L' | ----------------------------
10335* | | | 'U' |
10336* | | |d |
10337* | | | 'D' |
10338* | | | d |
10339* | | |'L' d |
10340* ----------- ----------------------------
10341*
10342* -- Written on April 1, 1998 by
10343* Antoine Petitet, University of Tennessee, Knoxville 37996, USA.
10344*
10345* =====================================================================
10346*
10347* .. Local Scalars ..
10348 INTEGER I, J, JTMP, MN
10349* ..
10350* .. External Functions ..
10351 LOGICAL LSAME
10352 EXTERNAL lsame
10353* ..
10354* .. Intrinsic Functions ..
10355 INTRINSIC max, min
10356* ..
10357* .. Executable Statements ..
10358*
10359* Quick return if possible
10360*
10361 IF( m.LE.0 .OR. n.LE.0 )
10362 $ RETURN
10363*
10364* Start the operations
10365*
10366 IF( lsame( uplo, 'L' ) ) THEN
10367*
10368* Scales the lower triangular part of the array by ALPHA.
10369*
10370 mn = max( 0, -ioffd )
10371 DO 20 j = 1, min( mn, n )
10372 DO 10 i = 1, m
10373 a( i, j ) = alpha * a( i, j )
10374 10 CONTINUE
10375 20 CONTINUE
10376 DO 40 j = mn + 1, min( m - ioffd, n )
10377 DO 30 i = j + ioffd, m
10378 a( i, j ) = alpha * a( i, j )
10379 30 CONTINUE
10380 40 CONTINUE
10381*
10382 ELSE IF( lsame( uplo, 'U' ) ) THEN
10383*
10384* Scales the upper triangular part of the array by ALPHA.
10385*
10386 mn = min( m - ioffd, n )
10387 DO 60 j = max( 0, -ioffd ) + 1, mn
10388 DO 50 i = 1, j + ioffd
10389 a( i, j ) = alpha * a( i, j )
10390 50 CONTINUE
10391 60 CONTINUE
10392 DO 80 j = max( 0, mn ) + 1, n
10393 DO 70 i = 1, m
10394 a( i, j ) = alpha * a( i, j )
10395 70 CONTINUE
10396 80 CONTINUE
10397*
10398 ELSE IF( lsame( uplo, 'D' ) ) THEN
10399*
10400* Scales the diagonal entries by ALPHA.
10401*
10402 DO 90 j = max( 0, -ioffd ) + 1, min( m - ioffd, n )
10403 jtmp = j + ioffd
10404 a( jtmp, j ) = alpha * a( jtmp, j )
10405 90 CONTINUE
10406*
10407 ELSE
10408*
10409* Scales the entire array by ALPHA.
10410*
10411 DO 110 j = 1, n
10412 DO 100 i = 1, m
10413 a( i, j ) = alpha * a( i, j )
10414 100 CONTINUE
10415 110 CONTINUE
10416*
10417 END IF
10418*
10419 RETURN
10420*
10421* End of PB_ZLASCAL
10422*
#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: