3 /* Subroutine */ int slaset_(char *uplo, integer *m, integer *n, real *alpha,
4 real *beta, real *a, integer *lda)
6 /* System generated locals */
7 integer a_dim1, a_offset, i__1, i__2, i__3;
11 extern logical lsame_(char *, char *);
14 /* -- LAPACK auxiliary routine (version 3.1) -- */
15 /* Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd.. */
18 /* .. Scalar Arguments .. */
20 /* .. Array Arguments .. */
26 /* SLASET initializes an m-by-n matrix A to BETA on the diagonal and */
27 /* ALPHA on the offdiagonals. */
32 /* UPLO (input) CHARACTER*1 */
33 /* Specifies the part of the matrix A to be set. */
34 /* = 'U': Upper triangular part is set; the strictly lower */
35 /* triangular part of A is not changed. */
36 /* = 'L': Lower triangular part is set; the strictly upper */
37 /* triangular part of A is not changed. */
38 /* Otherwise: All of the matrix A is set. */
40 /* M (input) INTEGER */
41 /* The number of rows of the matrix A. M >= 0. */
43 /* N (input) INTEGER */
44 /* The number of columns of the matrix A. N >= 0. */
46 /* ALPHA (input) REAL */
47 /* The constant to which the offdiagonal elements are to be set. */
49 /* BETA (input) REAL */
50 /* The constant to which the diagonal elements are to be set. */
52 /* A (input/output) REAL array, dimension (LDA,N) */
53 /* On exit, the leading m-by-n submatrix of A is set as follows: */
55 /* if UPLO = 'U', A(i,j) = ALPHA, 1<=i<=j-1, 1<=j<=n, */
56 /* if UPLO = 'L', A(i,j) = ALPHA, j+1<=i<=m, 1<=j<=n, */
57 /* otherwise, A(i,j) = ALPHA, 1<=i<=m, 1<=j<=n, i.ne.j, */
59 /* and, for all UPLO, A(i,i) = BETA, 1<=i<=min(m,n). */
61 /* LDA (input) INTEGER */
62 /* The leading dimension of the array A. LDA >= max(1,M). */
64 /* ===================================================================== */
66 /* .. Local Scalars .. */
68 /* .. External Functions .. */
70 /* .. Intrinsic Functions .. */
72 /* .. Executable Statements .. */
74 /* Parameter adjustments */
76 a_offset = 1 + a_dim1;
80 if (lsame_(uplo, "U")) {
82 /* Set the strictly upper triangular or trapezoidal part of the */
86 for (j = 2; j <= i__1; ++j) {
90 for (i__ = 1; i__ <= i__2; ++i__) {
91 a[i__ + j * a_dim1] = *alpha;
97 } else if (lsame_(uplo, "L")) {
99 /* Set the strictly lower triangular or trapezoidal part of the */
100 /* array to ALPHA. */
103 for (j = 1; j <= i__1; ++j) {
105 for (i__ = j + 1; i__ <= i__2; ++i__) {
106 a[i__ + j * a_dim1] = *alpha;
114 /* Set the leading m-by-n submatrix to ALPHA. */
117 for (j = 1; j <= i__1; ++j) {
119 for (i__ = 1; i__ <= i__2; ++i__) {
120 a[i__ + j * a_dim1] = *alpha;
127 /* Set the first min(M,N) diagonal elements to BETA. */
130 for (i__ = 1; i__ <= i__1; ++i__) {
131 a[i__ + i__ * a_dim1] = *beta;