1 SUBROUTINE DLASET
( UPLO
, M
, N
, ALPHA
, BETA
, A
, LDA
)
3 * -- LAPACK auxiliary routine
(version
3.1) --
4 * Univ
. of Tennessee
, Univ
. of California Berkeley and NAG Ltd
..
7 * .. Scalar Arguments
..
10 DOUBLE PRECISION ALPHA
, BETA
12 * .. Array Arguments
..
13 DOUBLE PRECISION A
( LDA
, * )
19 * DLASET initializes an m
-by
-n matrix A
to BETA on the diagonal and
20 * ALPHA on the offdiagonals
.
25 * UPLO
(input
) CHARACTER*1
26 * Specifies the part of the matrix A
to be set
.
27 * = 'U': Upper triangular part is set
; the strictly lower
28 * triangular part of A is not changed
.
29 * = 'L': Lower triangular part is set
; the strictly upper
30 * triangular part of A is not changed
.
31 * Otherwise
: All of the matrix A is set
.
34 * The number of rows of the matrix A
. M
>= 0.
37 * The number of columns of the matrix A
. N
>= 0.
39 * ALPHA
(input
) DOUBLE PRECISION
40 * The constant
to which the offdiagonal elements are
to be set
.
42 * BETA
(input
) DOUBLE PRECISION
43 * The constant
to which the diagonal elements are
to be set
.
45 * A
(input
/output
) DOUBLE PRECISION array
, dimension (LDA
,N
)
46 * On exit
, the leading m
-by
-n submatrix of A is set as follows
:
48 * if UPLO
= 'U', A
(i
,j
) = ALPHA
, 1<=i
<=j
-1, 1<=j
<=n
,
49 * if UPLO
= 'L', A
(i
,j
) = ALPHA
, j
+1<=i
<=m
, 1<=j
<=n
,
50 * otherwise
, A
(i
,j
) = ALPHA
, 1<=i
<=m
, 1<=j
<=n
, i
.ne
.j
,
52 * and
, for all UPLO
, A
(i
,i
) = BETA
, 1<=i
<=min
(m
,n
).
55 * The leading
dimension of the array A
. LDA
>= max
(1,M
).
57 * =====================================================================
62 * .. External Functions
..
66 * .. Intrinsic Functions
..
69 * .. Executable Statements
..
71 IF( LSAME
( UPLO
, 'U' ) ) THEN
73 * Set the strictly upper triangular or trapezoidal part of the
77 DO 10 I
= 1, MIN
( J
-1, M
)
82 ELSE IF( LSAME
( UPLO
, 'L' ) ) THEN
84 * Set the strictly lower triangular or trapezoidal part of the
87 DO 40 J
= 1, MIN
( M
, N
)
95 * Set the leading m
-by
-n submatrix
to ALPHA
.
104 * Set the first min
(M
,N
) diagonal elements
to BETA
.
106 DO 70 I
= 1, MIN
( M
, N
)