LAPACK 3.12.1
LAPACK: Linear Algebra PACKage
Loading...
Searching...
No Matches

◆ zlaset()

subroutine zlaset ( character uplo,
integer m,
integer n,
complex*16 alpha,
complex*16 beta,
complex*16, dimension( lda, * ) a,
integer lda )

ZLASET initializes the off-diagonal elements and the diagonal elements of a matrix to given values.

Download ZLASET + dependencies [TGZ] [ZIP] [TXT]

Purpose:
!>
!> ZLASET initializes a 2-D array A to BETA on the diagonal and
!> ALPHA on the offdiagonals.
!> 
Parameters
[in]UPLO
!>          UPLO is CHARACTER*1
!>          Specifies the part of the matrix A to be set.
!>          = 'U':      Upper triangular part is set. The lower triangle
!>                      is unchanged.
!>          = 'L':      Lower triangular part is set. The upper triangle
!>                      is unchanged.
!>          Otherwise:  All of the matrix A is set.
!> 
[in]M
!>          M is INTEGER
!>          On entry, M specifies the number of rows of A.
!> 
[in]N
!>          N is INTEGER
!>          On entry, N specifies the number of columns of A.
!> 
[in]ALPHA
!>          ALPHA is COMPLEX*16
!>          All the offdiagonal array elements are set to ALPHA.
!> 
[in]BETA
!>          BETA is COMPLEX*16
!>          All the diagonal array elements are set to BETA.
!> 
[out]A
!>          A is COMPLEX*16 array, dimension (LDA,N)
!>          On entry, the m by n matrix A.
!>          On exit, A(i,j) = ALPHA, 1 <= i <= m, 1 <= j <= n, i.ne.j;
!>                   A(i,i) = BETA , 1 <= i <= min(m,n)
!> 
[in]LDA
!>          LDA is INTEGER
!>          The leading dimension of the array A.  LDA >= max(1,M).
!> 
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.

Definition at line 103 of file zlaset.f.

104*
105* -- LAPACK auxiliary routine --
106* -- LAPACK is a software package provided by Univ. of Tennessee, --
107* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
108*
109* .. Scalar Arguments ..
110 CHARACTER UPLO
111 INTEGER LDA, M, N
112 COMPLEX*16 ALPHA, BETA
113* ..
114* .. Array Arguments ..
115 COMPLEX*16 A( LDA, * )
116* ..
117*
118* =====================================================================
119*
120* .. Local Scalars ..
121 INTEGER I, J
122* ..
123* .. External Functions ..
124 LOGICAL LSAME
125 EXTERNAL lsame
126* ..
127* .. Intrinsic Functions ..
128 INTRINSIC min
129* ..
130* .. Executable Statements ..
131*
132 IF( lsame( uplo, 'U' ) ) THEN
133*
134* Set the diagonal to BETA and the strictly upper triangular
135* part of the array to ALPHA.
136*
137 DO 20 j = 2, n
138 DO 10 i = 1, min( j-1, m )
139 a( i, j ) = alpha
140 10 CONTINUE
141 20 CONTINUE
142 DO 30 i = 1, min( n, m )
143 a( i, i ) = beta
144 30 CONTINUE
145*
146 ELSE IF( lsame( uplo, 'L' ) ) THEN
147*
148* Set the diagonal to BETA and the strictly lower triangular
149* part of the array to ALPHA.
150*
151 DO 50 j = 1, min( m, n )
152 DO 40 i = j + 1, m
153 a( i, j ) = alpha
154 40 CONTINUE
155 50 CONTINUE
156 DO 60 i = 1, min( n, m )
157 a( i, i ) = beta
158 60 CONTINUE
159*
160 ELSE
161*
162* Set the array to BETA on the diagonal and ALPHA on the
163* offdiagonal.
164*
165 DO 80 j = 1, n
166 DO 70 i = 1, m
167 a( i, j ) = alpha
168 70 CONTINUE
169 80 CONTINUE
170 DO 90 i = 1, min( m, n )
171 a( i, i ) = beta
172 90 CONTINUE
173 END IF
174*
175 RETURN
176*
177* End of ZLASET
178*
logical function lsame(ca, cb)
LSAME
Definition lsame.f:48
Here is the caller graph for this function: