claset.c
Go to the documentation of this file.
00001 /* claset.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 claset_(char *uplo, integer *m, integer *n, complex *
00017         alpha, complex *beta, complex *a, integer *lda)
00018 {
00019     /* System generated locals */
00020     integer a_dim1, a_offset, i__1, i__2, i__3;
00021 
00022     /* Local variables */
00023     integer i__, j;
00024     extern logical lsame_(char *, char *);
00025 
00026 
00027 /*  -- LAPACK auxiliary routine (version 3.2) -- */
00028 /*     Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd.. */
00029 /*     November 2006 */
00030 
00031 /*     .. Scalar Arguments .. */
00032 /*     .. */
00033 /*     .. Array Arguments .. */
00034 /*     .. */
00035 
00036 /*  Purpose */
00037 /*  ======= */
00038 
00039 /*  CLASET initializes a 2-D array A to BETA on the diagonal and */
00040 /*  ALPHA on the offdiagonals. */
00041 
00042 /*  Arguments */
00043 /*  ========= */
00044 
00045 /*  UPLO    (input) CHARACTER*1 */
00046 /*          Specifies the part of the matrix A to be set. */
00047 /*          = 'U':      Upper triangular part is set. The lower triangle */
00048 /*                      is unchanged. */
00049 /*          = 'L':      Lower triangular part is set. The upper triangle */
00050 /*                      is unchanged. */
00051 /*          Otherwise:  All of the matrix A is set. */
00052 
00053 /*  M       (input) INTEGER */
00054 /*          On entry, M specifies the number of rows of A. */
00055 
00056 /*  N       (input) INTEGER */
00057 /*          On entry, N specifies the number of columns of A. */
00058 
00059 /*  ALPHA   (input) COMPLEX */
00060 /*          All the offdiagonal array elements are set to ALPHA. */
00061 
00062 /*  BETA    (input) COMPLEX */
00063 /*          All the diagonal array elements are set to BETA. */
00064 
00065 /*  A       (input/output) COMPLEX array, dimension (LDA,N) */
00066 /*          On entry, the m by n matrix A. */
00067 /*          On exit, A(i,j) = ALPHA, 1 <= i <= m, 1 <= j <= n, i.ne.j; */
00068 /*                   A(i,i) = BETA , 1 <= i <= min(m,n) */
00069 
00070 /*  LDA     (input) INTEGER */
00071 /*          The leading dimension of the array A.  LDA >= max(1,M). */
00072 
00073 /*  ===================================================================== */
00074 
00075 /*     .. Local Scalars .. */
00076 /*     .. */
00077 /*     .. External Functions .. */
00078 /*     .. */
00079 /*     .. Intrinsic Functions .. */
00080 /*     .. */
00081 /*     .. Executable Statements .. */
00082 
00083     /* Parameter adjustments */
00084     a_dim1 = *lda;
00085     a_offset = 1 + a_dim1;
00086     a -= a_offset;
00087 
00088     /* Function Body */
00089     if (lsame_(uplo, "U")) {
00090 
00091 /*        Set the diagonal to BETA and the strictly upper triangular */
00092 /*        part of the array to ALPHA. */
00093 
00094         i__1 = *n;
00095         for (j = 2; j <= i__1; ++j) {
00096 /* Computing MIN */
00097             i__3 = j - 1;
00098             i__2 = min(i__3,*m);
00099             for (i__ = 1; i__ <= i__2; ++i__) {
00100                 i__3 = i__ + j * a_dim1;
00101                 a[i__3].r = alpha->r, a[i__3].i = alpha->i;
00102 /* L10: */
00103             }
00104 /* L20: */
00105         }
00106         i__1 = min(*n,*m);
00107         for (i__ = 1; i__ <= i__1; ++i__) {
00108             i__2 = i__ + i__ * a_dim1;
00109             a[i__2].r = beta->r, a[i__2].i = beta->i;
00110 /* L30: */
00111         }
00112 
00113     } else if (lsame_(uplo, "L")) {
00114 
00115 /*        Set the diagonal to BETA and the strictly lower triangular */
00116 /*        part of the array to ALPHA. */
00117 
00118         i__1 = min(*m,*n);
00119         for (j = 1; j <= i__1; ++j) {
00120             i__2 = *m;
00121             for (i__ = j + 1; i__ <= i__2; ++i__) {
00122                 i__3 = i__ + j * a_dim1;
00123                 a[i__3].r = alpha->r, a[i__3].i = alpha->i;
00124 /* L40: */
00125             }
00126 /* L50: */
00127         }
00128         i__1 = min(*n,*m);
00129         for (i__ = 1; i__ <= i__1; ++i__) {
00130             i__2 = i__ + i__ * a_dim1;
00131             a[i__2].r = beta->r, a[i__2].i = beta->i;
00132 /* L60: */
00133         }
00134 
00135     } else {
00136 
00137 /*        Set the array to BETA on the diagonal and ALPHA on the */
00138 /*        offdiagonal. */
00139 
00140         i__1 = *n;
00141         for (j = 1; j <= i__1; ++j) {
00142             i__2 = *m;
00143             for (i__ = 1; i__ <= i__2; ++i__) {
00144                 i__3 = i__ + j * a_dim1;
00145                 a[i__3].r = alpha->r, a[i__3].i = alpha->i;
00146 /* L70: */
00147             }
00148 /* L80: */
00149         }
00150         i__1 = min(*m,*n);
00151         for (i__ = 1; i__ <= i__1; ++i__) {
00152             i__2 = i__ + i__ * a_dim1;
00153             a[i__2].r = beta->r, a[i__2].i = beta->i;
00154 /* L90: */
00155         }
00156     }
00157 
00158     return 0;
00159 
00160 /*     End of CLASET */
00161 
00162 } /* claset_ */


swiftnav
Author(s):
autogenerated on Sat Jun 8 2019 18:55:32