LAPACK  3.4.1
LAPACK: Linear Algebra PACKage
claset.f
Go to the documentation of this file.
00001 *> \brief \b CLASET
00002 *
00003 *  =========== DOCUMENTATION ===========
00004 *
00005 * Online html documentation available at 
00006 *            http://www.netlib.org/lapack/explore-html/ 
00007 *
00008 *> \htmlonly
00009 *> Download CLASET + dependencies 
00010 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/claset.f"> 
00011 *> [TGZ]</a> 
00012 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/claset.f"> 
00013 *> [ZIP]</a> 
00014 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/claset.f"> 
00015 *> [TXT]</a>
00016 *> \endhtmlonly 
00017 *
00018 *  Definition:
00019 *  ===========
00020 *
00021 *       SUBROUTINE CLASET( UPLO, M, N, ALPHA, BETA, A, LDA )
00022 * 
00023 *       .. Scalar Arguments ..
00024 *       CHARACTER          UPLO
00025 *       INTEGER            LDA, M, N
00026 *       COMPLEX            ALPHA, BETA
00027 *       ..
00028 *       .. Array Arguments ..
00029 *       COMPLEX            A( LDA, * )
00030 *       ..
00031 *  
00032 *
00033 *> \par Purpose:
00034 *  =============
00035 *>
00036 *> \verbatim
00037 *>
00038 *> CLASET initializes a 2-D array A to BETA on the diagonal and
00039 *> ALPHA on the offdiagonals.
00040 *> \endverbatim
00041 *
00042 *  Arguments:
00043 *  ==========
00044 *
00045 *> \param[in] UPLO
00046 *> \verbatim
00047 *>          UPLO is CHARACTER*1
00048 *>          Specifies the part of the matrix A to be set.
00049 *>          = 'U':      Upper triangular part is set. The lower triangle
00050 *>                      is unchanged.
00051 *>          = 'L':      Lower triangular part is set. The upper triangle
00052 *>                      is unchanged.
00053 *>          Otherwise:  All of the matrix A is set.
00054 *> \endverbatim
00055 *>
00056 *> \param[in] M
00057 *> \verbatim
00058 *>          M is INTEGER
00059 *>          On entry, M specifies the number of rows of A.
00060 *> \endverbatim
00061 *>
00062 *> \param[in] N
00063 *> \verbatim
00064 *>          N is INTEGER
00065 *>          On entry, N specifies the number of columns of A.
00066 *> \endverbatim
00067 *>
00068 *> \param[in] ALPHA
00069 *> \verbatim
00070 *>          ALPHA is COMPLEX
00071 *>          All the offdiagonal array elements are set to ALPHA.
00072 *> \endverbatim
00073 *>
00074 *> \param[in] BETA
00075 *> \verbatim
00076 *>          BETA is COMPLEX
00077 *>          All the diagonal array elements are set to BETA.
00078 *> \endverbatim
00079 *>
00080 *> \param[in,out] A
00081 *> \verbatim
00082 *>          A is COMPLEX array, dimension (LDA,N)
00083 *>          On entry, the m by n matrix A.
00084 *>          On exit, A(i,j) = ALPHA, 1 <= i <= m, 1 <= j <= n, i.ne.j;
00085 *>                   A(i,i) = BETA , 1 <= i <= min(m,n)
00086 *> \endverbatim
00087 *>
00088 *> \param[in] LDA
00089 *> \verbatim
00090 *>          LDA is INTEGER
00091 *>          The leading dimension of the array A.  LDA >= max(1,M).
00092 *> \endverbatim
00093 *
00094 *  Authors:
00095 *  ========
00096 *
00097 *> \author Univ. of Tennessee 
00098 *> \author Univ. of California Berkeley 
00099 *> \author Univ. of Colorado Denver 
00100 *> \author NAG Ltd. 
00101 *
00102 *> \date November 2011
00103 *
00104 *> \ingroup complexOTHERauxiliary
00105 *
00106 *  =====================================================================
00107       SUBROUTINE CLASET( UPLO, M, N, ALPHA, BETA, A, LDA )
00108 *
00109 *  -- LAPACK auxiliary routine (version 3.4.0) --
00110 *  -- LAPACK is a software package provided by Univ. of Tennessee,    --
00111 *  -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
00112 *     November 2011
00113 *
00114 *     .. Scalar Arguments ..
00115       CHARACTER          UPLO
00116       INTEGER            LDA, M, N
00117       COMPLEX            ALPHA, BETA
00118 *     ..
00119 *     .. Array Arguments ..
00120       COMPLEX            A( LDA, * )
00121 *     ..
00122 *
00123 *  =====================================================================
00124 *
00125 *     .. Local Scalars ..
00126       INTEGER            I, J
00127 *     ..
00128 *     .. External Functions ..
00129       LOGICAL            LSAME
00130       EXTERNAL           LSAME
00131 *     ..
00132 *     .. Intrinsic Functions ..
00133       INTRINSIC          MIN
00134 *     ..
00135 *     .. Executable Statements ..
00136 *
00137       IF( LSAME( UPLO, 'U' ) ) THEN
00138 *
00139 *        Set the diagonal to BETA and the strictly upper triangular
00140 *        part of the array to ALPHA.
00141 *
00142          DO 20 J = 2, N
00143             DO 10 I = 1, MIN( J-1, M )
00144                A( I, J ) = ALPHA
00145    10       CONTINUE
00146    20    CONTINUE
00147          DO 30 I = 1, MIN( N, M )
00148             A( I, I ) = BETA
00149    30    CONTINUE
00150 *
00151       ELSE IF( LSAME( UPLO, 'L' ) ) THEN
00152 *
00153 *        Set the diagonal to BETA and the strictly lower triangular
00154 *        part of the array to ALPHA.
00155 *
00156          DO 50 J = 1, MIN( M, N )
00157             DO 40 I = J + 1, M
00158                A( I, J ) = ALPHA
00159    40       CONTINUE
00160    50    CONTINUE
00161          DO 60 I = 1, MIN( N, M )
00162             A( I, I ) = BETA
00163    60    CONTINUE
00164 *
00165       ELSE
00166 *
00167 *        Set the array to BETA on the diagonal and ALPHA on the
00168 *        offdiagonal.
00169 *
00170          DO 80 J = 1, N
00171             DO 70 I = 1, M
00172                A( I, J ) = ALPHA
00173    70       CONTINUE
00174    80    CONTINUE
00175          DO 90 I = 1, MIN( M, N )
00176             A( I, I ) = BETA
00177    90    CONTINUE
00178       END IF
00179 *
00180       RETURN
00181 *
00182 *     End of CLASET
00183 *
00184       END
 All Files Functions