1 *> \brief \b SLASET initializes the off-diagonal elements and the diagonal elements of a matrix to given values.
3 * =========== DOCUMENTATION ===========
5 * Online html documentation available at
6 * http://www.netlib.org/lapack/explore-html/
9 *> Download SLASET + dependencies
10 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/slaset.f">
12 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/slaset.f">
14 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/slaset.f">
21 * SUBROUTINE SLASET( UPLO, M, N, ALPHA, BETA, A, LDA )
23 * .. Scalar Arguments ..
28 * .. Array Arguments ..
38 *> SLASET initializes an m-by-n matrix A to BETA on the diagonal and
39 *> ALPHA on the offdiagonals.
47 *> UPLO is CHARACTER*1
48 *> Specifies the part of the matrix A to be set.
49 *> = 'U': Upper triangular part is set; the strictly lower
50 *> triangular part of A is not changed.
51 *> = 'L': Lower triangular part is set; the strictly upper
52 *> triangular part of A is not changed.
53 *> Otherwise: All of the matrix A is set.
59 *> The number of rows of the matrix A. M >= 0.
65 *> The number of columns of the matrix A. N >= 0.
71 *> The constant to which the offdiagonal elements are to be set.
77 *> The constant to which the diagonal elements are to be set.
82 *> A is REAL array, dimension (LDA,N)
83 *> On exit, the leading m-by-n submatrix of A is set as follows:
85 *> if UPLO = 'U', A(i,j) = ALPHA, 1<=i<=j-1, 1<=j<=n,
86 *> if UPLO = 'L', A(i,j) = ALPHA, j+1<=i<=m, 1<=j<=n,
87 *> otherwise, A(i,j) = ALPHA, 1<=i<=m, 1<=j<=n, i.ne.j,
89 *> and, for all UPLO, A(i,i) = BETA, 1<=i<=min(m,n).
95 *> The leading dimension of the array A. LDA >= max(1,M).
101 *> \author Univ. of Tennessee
102 *> \author Univ. of California Berkeley
103 *> \author Univ. of Colorado Denver
106 *> \date November 2015
108 *> \ingroup auxOTHERauxiliary
110 * =====================================================================
111 SUBROUTINE SLASET( UPLO, M, N, ALPHA, BETA, A, LDA )
113 * -- LAPACK auxiliary routine (version 3.6.0) --
114 * -- LAPACK is a software package provided by Univ. of Tennessee, --
115 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
118 * .. Scalar Arguments ..
123 * .. Array Arguments ..
127 * =====================================================================
129 * .. Local Scalars ..
132 * .. External Functions ..
136 * .. Intrinsic Functions ..
139 * .. Executable Statements ..
141 IF( LSAME( UPLO, 'U' ) ) THEN
143 * Set the strictly upper triangular or trapezoidal part of the
147 DO 10 I = 1, MIN( J-1, M )
152 ELSE IF( LSAME( UPLO, 'L' ) ) THEN
154 * Set the strictly lower triangular or trapezoidal part of the
157 DO 40 J = 1, MIN( M, N )
165 * Set the leading m-by-n submatrix to ALPHA.
174 * Set the first min(M,N) diagonal elements to BETA.
176 DO 70 I = 1, MIN( M, N )