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 1319 of file pcblastim.f.

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