LAPACK  3.4.1
LAPACK: Linear Algebra PACKage
slauu2.f
Go to the documentation of this file.
00001 *> \brief \b SLAUU2
00002 *
00003 *  =========== DOCUMENTATION ===========
00004 *
00005 * Online html documentation available at 
00006 *            http://www.netlib.org/lapack/explore-html/ 
00007 *
00008 *> \htmlonly
00009 *> Download SLAUU2 + dependencies 
00010 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/slauu2.f"> 
00011 *> [TGZ]</a> 
00012 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/slauu2.f"> 
00013 *> [ZIP]</a> 
00014 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/slauu2.f"> 
00015 *> [TXT]</a>
00016 *> \endhtmlonly 
00017 *
00018 *  Definition:
00019 *  ===========
00020 *
00021 *       SUBROUTINE SLAUU2( 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 *> SLAUU2 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 unblocked form of the algorithm, calling Level 2 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 SLAUU2( 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
00127       REAL               AII
00128 *     ..
00129 *     .. External Functions ..
00130       LOGICAL            LSAME
00131       REAL               SDOT
00132       EXTERNAL           LSAME, SDOT
00133 *     ..
00134 *     .. External Subroutines ..
00135       EXTERNAL           SGEMV, SSCAL, XERBLA
00136 *     ..
00137 *     .. Intrinsic Functions ..
00138       INTRINSIC          MAX
00139 *     ..
00140 *     .. Executable Statements ..
00141 *
00142 *     Test the input parameters.
00143 *
00144       INFO = 0
00145       UPPER = LSAME( UPLO, 'U' )
00146       IF( .NOT.UPPER .AND. .NOT.LSAME( UPLO, 'L' ) ) THEN
00147          INFO = -1
00148       ELSE IF( N.LT.0 ) THEN
00149          INFO = -2
00150       ELSE IF( LDA.LT.MAX( 1, N ) ) THEN
00151          INFO = -4
00152       END IF
00153       IF( INFO.NE.0 ) THEN
00154          CALL XERBLA( 'SLAUU2', -INFO )
00155          RETURN
00156       END IF
00157 *
00158 *     Quick return if possible
00159 *
00160       IF( N.EQ.0 )
00161      $   RETURN
00162 *
00163       IF( UPPER ) THEN
00164 *
00165 *        Compute the product U * U**T.
00166 *
00167          DO 10 I = 1, N
00168             AII = A( I, I )
00169             IF( I.LT.N ) THEN
00170                A( I, I ) = SDOT( N-I+1, A( I, I ), LDA, A( I, I ), LDA )
00171                CALL SGEMV( 'No transpose', I-1, N-I, ONE, A( 1, I+1 ),
00172      $                     LDA, A( I, I+1 ), LDA, AII, A( 1, I ), 1 )
00173             ELSE
00174                CALL SSCAL( I, AII, A( 1, I ), 1 )
00175             END IF
00176    10    CONTINUE
00177 *
00178       ELSE
00179 *
00180 *        Compute the product L**T * L.
00181 *
00182          DO 20 I = 1, N
00183             AII = A( I, I )
00184             IF( I.LT.N ) THEN
00185                A( I, I ) = SDOT( N-I+1, A( I, I ), 1, A( I, I ), 1 )
00186                CALL SGEMV( 'Transpose', N-I, I-1, ONE, A( I+1, 1 ), LDA,
00187      $                     A( I+1, I ), 1, AII, A( I, 1 ), LDA )
00188             ELSE
00189                CALL SSCAL( I, AII, A( I, 1 ), LDA )
00190             END IF
00191    20    CONTINUE
00192       END IF
00193 *
00194       RETURN
00195 *
00196 *     End of SLAUU2
00197 *
00198       END
 All Files Functions