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

◆ pb_dlascal()

subroutine pb_dlascal ( character*1  uplo,
integer  m,
integer  n,
integer  ioffd,
double precision  alpha,
double precision, dimension( lda, * )  a,
integer  lda 
)

Definition at line 1297 of file pdblastim.f.

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