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

◆ pb_clascal()

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

Definition at line 10243 of file pcblastst.f.

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