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 1320 of file pzblastim.f.

1321*
1322* -- PBLAS test routine (version 2.0) --
1323* University of Tennessee, Knoxville, Oak Ridge National Laboratory,
1324* and University of California, Berkeley.
1325* April 1, 1998
1326*
1327* .. Scalar Arguments ..
1328 CHARACTER*1 UPLO
1329 INTEGER IOFFD, LDA, M, N
1330 COMPLEX*16 ALPHA
1331* ..
1332* .. Array Arguments ..
1333 COMPLEX*16 A( LDA, * )
1334* ..
1335*
1336* Purpose
1337* =======
1338*
1339* PB_ZLASCAL scales a two-dimensional array A by the scalar alpha.
1340*
1341* Arguments
1342* =========
1343*
1344* UPLO (input) CHARACTER*1
1345* On entry, UPLO specifies which trapezoidal part of the ar-
1346* ray A is to be scaled as follows:
1347* = 'L' or 'l': the lower trapezoid of A is scaled,
1348* = 'U' or 'u': the upper trapezoid of A is scaled,
1349* = 'D' or 'd': diagonal specified by IOFFD is scaled,
1350* Otherwise: all of the array A is scaled.
1351*
1352* M (input) INTEGER
1353* On entry, M specifies the number of rows of the array A. M
1354* must be at least zero.
1355*
1356* N (input) INTEGER
1357* On entry, N specifies the number of columns of the array A.
1358* N must be at least zero.
1359*
1360* IOFFD (input) INTEGER
1361* On entry, IOFFD specifies the position of the offdiagonal de-
1362* limiting the upper and lower trapezoidal part of A as follows
1363* (see the notes below):
1364*
1365* IOFFD = 0 specifies the main diagonal A( i, i ),
1366* with i = 1 ... MIN( M, N ),
1367* IOFFD > 0 specifies the subdiagonal A( i+IOFFD, i ),
1368* with i = 1 ... MIN( M-IOFFD, N ),
1369* IOFFD < 0 specifies the superdiagonal A( i, i-IOFFD ),
1370* with i = 1 ... MIN( M, N+IOFFD ).
1371*
1372* ALPHA (input) COMPLEX*16
1373* On entry, ALPHA specifies the scalar alpha.
1374*
1375* A (input/output) COMPLEX*16 array
1376* On entry, A is an array of dimension (LDA,N). Before entry
1377* with UPLO = 'U' or 'u', the leading m by n part of the array
1378* A must contain the upper trapezoidal part of the matrix as
1379* specified by IOFFD to be scaled, and the strictly lower tra-
1380* pezoidal part of A is not referenced; When UPLO = 'L' or 'l',
1381* the leading m by n part of the array A must contain the lower
1382* trapezoidal part of the matrix as specified by IOFFD to be
1383* scaled, and the strictly upper trapezoidal part of A is not
1384* referenced. On exit, the entries of the trapezoid part of A
1385* determined by UPLO and IOFFD are scaled.
1386*
1387* LDA (input) INTEGER
1388* On entry, LDA specifies the leading dimension of the array A.
1389* LDA must be at least max( 1, M ).
1390*
1391* Notes
1392* =====
1393* N N
1394* ---------------------------- -----------
1395* | d | | |
1396* M | d 'U' | | 'U' |
1397* | 'L' 'D' | |d |
1398* | d | M | d |
1399* ---------------------------- | 'D' |
1400* | d |
1401* IOFFD < 0 | 'L' d |
1402* | d|
1403* N | |
1404* ----------- -----------
1405* | d 'U'|
1406* | d | IOFFD > 0
1407* M | 'D' |
1408* | d| N
1409* | 'L' | ----------------------------
1410* | | | 'U' |
1411* | | |d |
1412* | | | 'D' |
1413* | | | d |
1414* | | |'L' d |
1415* ----------- ----------------------------
1416*
1417* -- Written on April 1, 1998 by
1418* Antoine Petitet, University of Tennessee, Knoxville 37996, USA.
1419*
1420* =====================================================================
1421*
1422* .. Local Scalars ..
1423 INTEGER I, J, JTMP, MN
1424* ..
1425* .. External Functions ..
1426 LOGICAL LSAME
1427 EXTERNAL lsame
1428* ..
1429* .. Intrinsic Functions ..
1430 INTRINSIC max, min
1431* ..
1432* .. Executable Statements ..
1433*
1434* Quick return if possible
1435*
1436 IF( m.LE.0 .OR. n.LE.0 )
1437 $ RETURN
1438*
1439* Start the operations
1440*
1441 IF( lsame( uplo, 'L' ) ) THEN
1442*
1443* Scales the lower triangular part of the array by ALPHA.
1444*
1445 mn = max( 0, -ioffd )
1446 DO 20 j = 1, min( mn, n )
1447 DO 10 i = 1, m
1448 a( i, j ) = alpha * a( i, j )
1449 10 CONTINUE
1450 20 CONTINUE
1451 DO 40 j = mn + 1, min( m - ioffd, n )
1452 DO 30 i = j + ioffd, m
1453 a( i, j ) = alpha * a( i, j )
1454 30 CONTINUE
1455 40 CONTINUE
1456*
1457 ELSE IF( lsame( uplo, 'U' ) ) THEN
1458*
1459* Scales the upper triangular part of the array by ALPHA.
1460*
1461 mn = min( m - ioffd, n )
1462 DO 60 j = max( 0, -ioffd ) + 1, mn
1463 DO 50 i = 1, j + ioffd
1464 a( i, j ) = alpha * a( i, j )
1465 50 CONTINUE
1466 60 CONTINUE
1467 DO 80 j = max( 0, mn ) + 1, n
1468 DO 70 i = 1, m
1469 a( i, j ) = alpha * a( i, j )
1470 70 CONTINUE
1471 80 CONTINUE
1472*
1473 ELSE IF( lsame( uplo, 'D' ) ) THEN
1474*
1475* Scales the diagonal entries by ALPHA.
1476*
1477 DO 90 j = max( 0, -ioffd ) + 1, min( m - ioffd, n )
1478 jtmp = j + ioffd
1479 a( jtmp, j ) = alpha * a( jtmp, j )
1480 90 CONTINUE
1481*
1482 ELSE
1483*
1484* Scales the entire array by ALPHA.
1485*
1486 DO 110 j = 1, n
1487 DO 100 i = 1, m
1488 a( i, j ) = alpha * a( i, j )
1489 100 CONTINUE
1490 110 CONTINUE
1491*
1492 END IF
1493*
1494 RETURN
1495*
1496* End of PB_ZLASCAL
1497*
#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