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

◆ pb_slascal()

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

Definition at line 1298 of file psblastim.f.

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