LAPACK  3.4.1
LAPACK: Linear Algebra PACKage
zlatrz.f
Go to the documentation of this file.
00001 *> \brief \b ZLATRZ
00002 *
00003 *  =========== DOCUMENTATION ===========
00004 *
00005 * Online html documentation available at 
00006 *            http://www.netlib.org/lapack/explore-html/ 
00007 *
00008 *> \htmlonly
00009 *> Download ZLATRZ + dependencies 
00010 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/zlatrz.f"> 
00011 *> [TGZ]</a> 
00012 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/zlatrz.f"> 
00013 *> [ZIP]</a> 
00014 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zlatrz.f"> 
00015 *> [TXT]</a>
00016 *> \endhtmlonly 
00017 *
00018 *  Definition:
00019 *  ===========
00020 *
00021 *       SUBROUTINE ZLATRZ( M, N, L, A, LDA, TAU, WORK )
00022 * 
00023 *       .. Scalar Arguments ..
00024 *       INTEGER            L, LDA, M, N
00025 *       ..
00026 *       .. Array Arguments ..
00027 *       COMPLEX*16         A( LDA, * ), TAU( * ), WORK( * )
00028 *       ..
00029 *  
00030 *
00031 *> \par Purpose:
00032 *  =============
00033 *>
00034 *> \verbatim
00035 *>
00036 *> ZLATRZ factors the M-by-(M+L) complex upper trapezoidal matrix
00037 *> [ A1 A2 ] = [ A(1:M,1:M) A(1:M,N-L+1:N) ] as ( R  0 ) * Z by means
00038 *> of unitary transformations, where  Z is an (M+L)-by-(M+L) unitary
00039 *> matrix and, R and A1 are M-by-M upper triangular matrices.
00040 *> \endverbatim
00041 *
00042 *  Arguments:
00043 *  ==========
00044 *
00045 *> \param[in] M
00046 *> \verbatim
00047 *>          M is INTEGER
00048 *>          The number of rows of the matrix A.  M >= 0.
00049 *> \endverbatim
00050 *>
00051 *> \param[in] N
00052 *> \verbatim
00053 *>          N is INTEGER
00054 *>          The number of columns of the matrix A.  N >= 0.
00055 *> \endverbatim
00056 *>
00057 *> \param[in] L
00058 *> \verbatim
00059 *>          L is INTEGER
00060 *>          The number of columns of the matrix A containing the
00061 *>          meaningful part of the Householder vectors. N-M >= L >= 0.
00062 *> \endverbatim
00063 *>
00064 *> \param[in,out] A
00065 *> \verbatim
00066 *>          A is COMPLEX*16 array, dimension (LDA,N)
00067 *>          On entry, the leading M-by-N upper trapezoidal part of the
00068 *>          array A must contain the matrix to be factorized.
00069 *>          On exit, the leading M-by-M upper triangular part of A
00070 *>          contains the upper triangular matrix R, and elements N-L+1 to
00071 *>          N of the first M rows of A, with the array TAU, represent the
00072 *>          unitary matrix Z as a product of M elementary reflectors.
00073 *> \endverbatim
00074 *>
00075 *> \param[in] LDA
00076 *> \verbatim
00077 *>          LDA is INTEGER
00078 *>          The leading dimension of the array A.  LDA >= max(1,M).
00079 *> \endverbatim
00080 *>
00081 *> \param[out] TAU
00082 *> \verbatim
00083 *>          TAU is COMPLEX*16 array, dimension (M)
00084 *>          The scalar factors of the elementary reflectors.
00085 *> \endverbatim
00086 *>
00087 *> \param[out] WORK
00088 *> \verbatim
00089 *>          WORK is COMPLEX*16 array, dimension (M)
00090 *> \endverbatim
00091 *
00092 *  Authors:
00093 *  ========
00094 *
00095 *> \author Univ. of Tennessee 
00096 *> \author Univ. of California Berkeley 
00097 *> \author Univ. of Colorado Denver 
00098 *> \author NAG Ltd. 
00099 *
00100 *> \date November 2011
00101 *
00102 *> \ingroup complex16OTHERcomputational
00103 *
00104 *> \par Contributors:
00105 *  ==================
00106 *>
00107 *>    A. Petitet, Computer Science Dept., Univ. of Tenn., Knoxville, USA
00108 *
00109 *> \par Further Details:
00110 *  =====================
00111 *>
00112 *> \verbatim
00113 *>
00114 *>  The factorization is obtained by Householder's method.  The kth
00115 *>  transformation matrix, Z( k ), which is used to introduce zeros into
00116 *>  the ( m - k + 1 )th row of A, is given in the form
00117 *>
00118 *>     Z( k ) = ( I     0   ),
00119 *>              ( 0  T( k ) )
00120 *>
00121 *>  where
00122 *>
00123 *>     T( k ) = I - tau*u( k )*u( k )**H,   u( k ) = (   1    ),
00124 *>                                                 (   0    )
00125 *>                                                 ( z( k ) )
00126 *>
00127 *>  tau is a scalar and z( k ) is an l element vector. tau and z( k )
00128 *>  are chosen to annihilate the elements of the kth row of A2.
00129 *>
00130 *>  The scalar tau is returned in the kth element of TAU and the vector
00131 *>  u( k ) in the kth row of A2, such that the elements of z( k ) are
00132 *>  in  a( k, l + 1 ), ..., a( k, n ). The elements of R are returned in
00133 *>  the upper triangular part of A1.
00134 *>
00135 *>  Z is given by
00136 *>
00137 *>     Z =  Z( 1 ) * Z( 2 ) * ... * Z( m ).
00138 *> \endverbatim
00139 *>
00140 *  =====================================================================
00141       SUBROUTINE ZLATRZ( M, N, L, A, LDA, TAU, WORK )
00142 *
00143 *  -- LAPACK computational routine (version 3.4.0) --
00144 *  -- LAPACK is a software package provided by Univ. of Tennessee,    --
00145 *  -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
00146 *     November 2011
00147 *
00148 *     .. Scalar Arguments ..
00149       INTEGER            L, LDA, M, N
00150 *     ..
00151 *     .. Array Arguments ..
00152       COMPLEX*16         A( LDA, * ), TAU( * ), WORK( * )
00153 *     ..
00154 *
00155 *  =====================================================================
00156 *
00157 *     .. Parameters ..
00158       COMPLEX*16         ZERO
00159       PARAMETER          ( ZERO = ( 0.0D+0, 0.0D+0 ) )
00160 *     ..
00161 *     .. Local Scalars ..
00162       INTEGER            I
00163       COMPLEX*16         ALPHA
00164 *     ..
00165 *     .. External Subroutines ..
00166       EXTERNAL           ZLACGV, ZLARFG, ZLARZ
00167 *     ..
00168 *     .. Intrinsic Functions ..
00169       INTRINSIC          DCONJG
00170 *     ..
00171 *     .. Executable Statements ..
00172 *
00173 *     Quick return if possible
00174 *
00175       IF( M.EQ.0 ) THEN
00176          RETURN
00177       ELSE IF( M.EQ.N ) THEN
00178          DO 10 I = 1, N
00179             TAU( I ) = ZERO
00180    10    CONTINUE
00181          RETURN
00182       END IF
00183 *
00184       DO 20 I = M, 1, -1
00185 *
00186 *        Generate elementary reflector H(i) to annihilate
00187 *        [ A(i,i) A(i,n-l+1:n) ]
00188 *
00189          CALL ZLACGV( L, A( I, N-L+1 ), LDA )
00190          ALPHA = DCONJG( A( I, I ) )
00191          CALL ZLARFG( L+1, ALPHA, A( I, N-L+1 ), LDA, TAU( I ) )
00192          TAU( I ) = DCONJG( TAU( I ) )
00193 *
00194 *        Apply H(i) to A(1:i-1,i:n) from the right
00195 *
00196          CALL ZLARZ( 'Right', I-1, N-I+1, L, A( I, N-L+1 ), LDA,
00197      $               DCONJG( TAU( I ) ), A( 1, I ), LDA, WORK )
00198          A( I, I ) = DCONJG( ALPHA )
00199 *
00200    20 CONTINUE
00201 *
00202       RETURN
00203 *
00204 *     End of ZLATRZ
00205 *
00206       END
 All Files Functions