LAPACK  3.4.1
LAPACK: Linear Algebra PACKage
slauum.f
Go to the documentation of this file.
00001 *> \brief \b SLAUUM
00002 *
00003 *  =========== DOCUMENTATION ===========
00004 *
00005 * Online html documentation available at 
00006 *            http://www.netlib.org/lapack/explore-html/ 
00007 *
00008 *> \htmlonly
00009 *> Download SLAUUM + dependencies 
00010 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/slauum.f"> 
00011 *> [TGZ]</a> 
00012 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/slauum.f"> 
00013 *> [ZIP]</a> 
00014 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/slauum.f"> 
00015 *> [TXT]</a>
00016 *> \endhtmlonly 
00017 *
00018 *  Definition:
00019 *  ===========
00020 *
00021 *       SUBROUTINE SLAUUM( UPLO, N, A, LDA, INFO )
00022 * 
00023 *       .. Scalar Arguments ..
00024 *       CHARACTER          UPLO
00025 *       INTEGER            INFO, LDA, N
00026 *       ..
00027 *       .. Array Arguments ..
00028 *       REAL               A( LDA, * )
00029 *       ..
00030 *  
00031 *
00032 *> \par Purpose:
00033 *  =============
00034 *>
00035 *> \verbatim
00036 *>
00037 *> SLAUUM computes the product U * U**T or L**T * L, where the triangular
00038 *> factor U or L is stored in the upper or lower triangular part of
00039 *> the array A.
00040 *>
00041 *> If UPLO = 'U' or 'u' then the upper triangle of the result is stored,
00042 *> overwriting the factor U in A.
00043 *> If UPLO = 'L' or 'l' then the lower triangle of the result is stored,
00044 *> overwriting the factor L in A.
00045 *>
00046 *> This is the blocked form of the algorithm, calling Level 3 BLAS.
00047 *> \endverbatim
00048 *
00049 *  Arguments:
00050 *  ==========
00051 *
00052 *> \param[in] UPLO
00053 *> \verbatim
00054 *>          UPLO is CHARACTER*1
00055 *>          Specifies whether the triangular factor stored in the array A
00056 *>          is upper or lower triangular:
00057 *>          = 'U':  Upper triangular
00058 *>          = 'L':  Lower triangular
00059 *> \endverbatim
00060 *>
00061 *> \param[in] N
00062 *> \verbatim
00063 *>          N is INTEGER
00064 *>          The order of the triangular factor U or L.  N >= 0.
00065 *> \endverbatim
00066 *>
00067 *> \param[in,out] A
00068 *> \verbatim
00069 *>          A is REAL array, dimension (LDA,N)
00070 *>          On entry, the triangular factor U or L.
00071 *>          On exit, if UPLO = 'U', the upper triangle of A is
00072 *>          overwritten with the upper triangle of the product U * U**T;
00073 *>          if UPLO = 'L', the lower triangle of A is overwritten with
00074 *>          the lower triangle of the product L**T * L.
00075 *> \endverbatim
00076 *>
00077 *> \param[in] LDA
00078 *> \verbatim
00079 *>          LDA is INTEGER
00080 *>          The leading dimension of the array A.  LDA >= max(1,N).
00081 *> \endverbatim
00082 *>
00083 *> \param[out] INFO
00084 *> \verbatim
00085 *>          INFO is INTEGER
00086 *>          = 0: successful exit
00087 *>          < 0: if INFO = -k, the k-th argument had an illegal value
00088 *> \endverbatim
00089 *
00090 *  Authors:
00091 *  ========
00092 *
00093 *> \author Univ. of Tennessee 
00094 *> \author Univ. of California Berkeley 
00095 *> \author Univ. of Colorado Denver 
00096 *> \author NAG Ltd. 
00097 *
00098 *> \date November 2011
00099 *
00100 *> \ingroup realOTHERauxiliary
00101 *
00102 *  =====================================================================
00103       SUBROUTINE SLAUUM( UPLO, N, A, LDA, INFO )
00104 *
00105 *  -- LAPACK auxiliary routine (version 3.4.0) --
00106 *  -- LAPACK is a software package provided by Univ. of Tennessee,    --
00107 *  -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
00108 *     November 2011
00109 *
00110 *     .. Scalar Arguments ..
00111       CHARACTER          UPLO
00112       INTEGER            INFO, LDA, N
00113 *     ..
00114 *     .. Array Arguments ..
00115       REAL               A( LDA, * )
00116 *     ..
00117 *
00118 *  =====================================================================
00119 *
00120 *     .. Parameters ..
00121       REAL               ONE
00122       PARAMETER          ( ONE = 1.0E+0 )
00123 *     ..
00124 *     .. Local Scalars ..
00125       LOGICAL            UPPER
00126       INTEGER            I, IB, NB
00127 *     ..
00128 *     .. External Functions ..
00129       LOGICAL            LSAME
00130       INTEGER            ILAENV
00131       EXTERNAL           LSAME, ILAENV
00132 *     ..
00133 *     .. External Subroutines ..
00134       EXTERNAL           SGEMM, SLAUU2, SSYRK, STRMM, XERBLA
00135 *     ..
00136 *     .. Intrinsic Functions ..
00137       INTRINSIC          MAX, MIN
00138 *     ..
00139 *     .. Executable Statements ..
00140 *
00141 *     Test the input parameters.
00142 *
00143       INFO = 0
00144       UPPER = LSAME( UPLO, 'U' )
00145       IF( .NOT.UPPER .AND. .NOT.LSAME( UPLO, 'L' ) ) THEN
00146          INFO = -1
00147       ELSE IF( N.LT.0 ) THEN
00148          INFO = -2
00149       ELSE IF( LDA.LT.MAX( 1, N ) ) THEN
00150          INFO = -4
00151       END IF
00152       IF( INFO.NE.0 ) THEN
00153          CALL XERBLA( 'SLAUUM', -INFO )
00154          RETURN
00155       END IF
00156 *
00157 *     Quick return if possible
00158 *
00159       IF( N.EQ.0 )
00160      $   RETURN
00161 *
00162 *     Determine the block size for this environment.
00163 *
00164       NB = ILAENV( 1, 'SLAUUM', UPLO, N, -1, -1, -1 )
00165 *
00166       IF( NB.LE.1 .OR. NB.GE.N ) THEN
00167 *
00168 *        Use unblocked code
00169 *
00170          CALL SLAUU2( UPLO, N, A, LDA, INFO )
00171       ELSE
00172 *
00173 *        Use blocked code
00174 *
00175          IF( UPPER ) THEN
00176 *
00177 *           Compute the product U * U**T.
00178 *
00179             DO 10 I = 1, N, NB
00180                IB = MIN( NB, N-I+1 )
00181                CALL STRMM( 'Right', 'Upper', 'Transpose', 'Non-unit',
00182      $                     I-1, IB, ONE, A( I, I ), LDA, A( 1, I ),
00183      $                     LDA )
00184                CALL SLAUU2( 'Upper', IB, A( I, I ), LDA, INFO )
00185                IF( I+IB.LE.N ) THEN
00186                   CALL SGEMM( 'No transpose', 'Transpose', I-1, IB,
00187      $                        N-I-IB+1, ONE, A( 1, I+IB ), LDA,
00188      $                        A( I, I+IB ), LDA, ONE, A( 1, I ), LDA )
00189                   CALL SSYRK( 'Upper', 'No transpose', IB, N-I-IB+1,
00190      $                        ONE, A( I, I+IB ), LDA, ONE, A( I, I ),
00191      $                        LDA )
00192                END IF
00193    10       CONTINUE
00194          ELSE
00195 *
00196 *           Compute the product L**T * L.
00197 *
00198             DO 20 I = 1, N, NB
00199                IB = MIN( NB, N-I+1 )
00200                CALL STRMM( 'Left', 'Lower', 'Transpose', 'Non-unit', IB,
00201      $                     I-1, ONE, A( I, I ), LDA, A( I, 1 ), LDA )
00202                CALL SLAUU2( 'Lower', IB, A( I, I ), LDA, INFO )
00203                IF( I+IB.LE.N ) THEN
00204                   CALL SGEMM( 'Transpose', 'No transpose', IB, I-1,
00205      $                        N-I-IB+1, ONE, A( I+IB, I ), LDA,
00206      $                        A( I+IB, 1 ), LDA, ONE, A( I, 1 ), LDA )
00207                   CALL SSYRK( 'Lower', 'Transpose', IB, N-I-IB+1, ONE,
00208      $                        A( I+IB, I ), LDA, ONE, A( I, I ), LDA )
00209                END IF
00210    20       CONTINUE
00211          END IF
00212       END IF
00213 *
00214       RETURN
00215 *
00216 *     End of SLAUUM
00217 *
00218       END
 All Files Functions