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