00001 /* zlaset.f -- translated by f2c (version 20061008). 00002 You must link the resulting object file with libf2c: 00003 on Microsoft Windows system, link with libf2c.lib; 00004 on Linux or Unix systems, link with .../path/to/libf2c.a -lm 00005 or, if you install libf2c.a in a standard place, with -lf2c -lm 00006 -- in that order, at the end of the command line, as in 00007 cc *.o -lf2c -lm 00008 Source for libf2c is in /netlib/f2c/libf2c.zip, e.g., 00009 00010 http://www.netlib.org/f2c/libf2c.zip 00011 */ 00012 00013 #include "f2c.h" 00014 #include "blaswrap.h" 00015 00016 /* Subroutine */ int zlaset_(char *uplo, integer *m, integer *n, 00017 doublecomplex *alpha, doublecomplex *beta, doublecomplex *a, integer * 00018 lda) 00019 { 00020 /* System generated locals */ 00021 integer a_dim1, a_offset, i__1, i__2, i__3; 00022 00023 /* Local variables */ 00024 integer i__, j; 00025 extern logical lsame_(char *, char *); 00026 00027 00028 /* -- LAPACK auxiliary routine (version 3.2) -- */ 00029 /* Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd.. */ 00030 /* November 2006 */ 00031 00032 /* .. Scalar Arguments .. */ 00033 /* .. */ 00034 /* .. Array Arguments .. */ 00035 /* .. */ 00036 00037 /* Purpose */ 00038 /* ======= */ 00039 00040 /* ZLASET initializes a 2-D array A to BETA on the diagonal and */ 00041 /* ALPHA on the offdiagonals. */ 00042 00043 /* Arguments */ 00044 /* ========= */ 00045 00046 /* UPLO (input) CHARACTER*1 */ 00047 /* Specifies the part of the matrix A to be set. */ 00048 /* = 'U': Upper triangular part is set. The lower triangle */ 00049 /* is unchanged. */ 00050 /* = 'L': Lower triangular part is set. The upper triangle */ 00051 /* is unchanged. */ 00052 /* Otherwise: All of the matrix A is set. */ 00053 00054 /* M (input) INTEGER */ 00055 /* On entry, M specifies the number of rows of A. */ 00056 00057 /* N (input) INTEGER */ 00058 /* On entry, N specifies the number of columns of A. */ 00059 00060 /* ALPHA (input) COMPLEX*16 */ 00061 /* All the offdiagonal array elements are set to ALPHA. */ 00062 00063 /* BETA (input) COMPLEX*16 */ 00064 /* All the diagonal array elements are set to BETA. */ 00065 00066 /* A (input/output) COMPLEX*16 array, dimension (LDA,N) */ 00067 /* On entry, the m by n matrix A. */ 00068 /* On exit, A(i,j) = ALPHA, 1 <= i <= m, 1 <= j <= n, i.ne.j; */ 00069 /* A(i,i) = BETA , 1 <= i <= min(m,n) */ 00070 00071 /* LDA (input) INTEGER */ 00072 /* The leading dimension of the array A. LDA >= max(1,M). */ 00073 00074 /* ===================================================================== */ 00075 00076 /* .. Local Scalars .. */ 00077 /* .. */ 00078 /* .. External Functions .. */ 00079 /* .. */ 00080 /* .. Intrinsic Functions .. */ 00081 /* .. */ 00082 /* .. Executable Statements .. */ 00083 00084 /* Parameter adjustments */ 00085 a_dim1 = *lda; 00086 a_offset = 1 + a_dim1; 00087 a -= a_offset; 00088 00089 /* Function Body */ 00090 if (lsame_(uplo, "U")) { 00091 00092 /* Set the diagonal to BETA and the strictly upper triangular */ 00093 /* part of the array to ALPHA. */ 00094 00095 i__1 = *n; 00096 for (j = 2; j <= i__1; ++j) { 00097 /* Computing MIN */ 00098 i__3 = j - 1; 00099 i__2 = min(i__3,*m); 00100 for (i__ = 1; i__ <= i__2; ++i__) { 00101 i__3 = i__ + j * a_dim1; 00102 a[i__3].r = alpha->r, a[i__3].i = alpha->i; 00103 /* L10: */ 00104 } 00105 /* L20: */ 00106 } 00107 i__1 = min(*n,*m); 00108 for (i__ = 1; i__ <= i__1; ++i__) { 00109 i__2 = i__ + i__ * a_dim1; 00110 a[i__2].r = beta->r, a[i__2].i = beta->i; 00111 /* L30: */ 00112 } 00113 00114 } else if (lsame_(uplo, "L")) { 00115 00116 /* Set the diagonal to BETA and the strictly lower triangular */ 00117 /* part of the array to ALPHA. */ 00118 00119 i__1 = min(*m,*n); 00120 for (j = 1; j <= i__1; ++j) { 00121 i__2 = *m; 00122 for (i__ = j + 1; i__ <= i__2; ++i__) { 00123 i__3 = i__ + j * a_dim1; 00124 a[i__3].r = alpha->r, a[i__3].i = alpha->i; 00125 /* L40: */ 00126 } 00127 /* L50: */ 00128 } 00129 i__1 = min(*n,*m); 00130 for (i__ = 1; i__ <= i__1; ++i__) { 00131 i__2 = i__ + i__ * a_dim1; 00132 a[i__2].r = beta->r, a[i__2].i = beta->i; 00133 /* L60: */ 00134 } 00135 00136 } else { 00137 00138 /* Set the array to BETA on the diagonal and ALPHA on the */ 00139 /* offdiagonal. */ 00140 00141 i__1 = *n; 00142 for (j = 1; j <= i__1; ++j) { 00143 i__2 = *m; 00144 for (i__ = 1; i__ <= i__2; ++i__) { 00145 i__3 = i__ + j * a_dim1; 00146 a[i__3].r = alpha->r, a[i__3].i = alpha->i; 00147 /* L70: */ 00148 } 00149 /* L80: */ 00150 } 00151 i__1 = min(*m,*n); 00152 for (i__ = 1; i__ <= i__1; ++i__) { 00153 i__2 = i__ + i__ * a_dim1; 00154 a[i__2].r = beta->r, a[i__2].i = beta->i; 00155 /* L90: */ 00156 } 00157 } 00158 00159 return 0; 00160 00161 /* End of ZLASET */ 00162 00163 } /* zlaset_ */