![]() |
LAPACK
3.4.1
LAPACK: Linear Algebra PACKage
|
00001 *> \brief \b CTZRQF 00002 * 00003 * =========== DOCUMENTATION =========== 00004 * 00005 * Online html documentation available at 00006 * http://www.netlib.org/lapack/explore-html/ 00007 * 00008 *> \htmlonly 00009 *> Download CTZRQF + dependencies 00010 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/ctzrqf.f"> 00011 *> [TGZ]</a> 00012 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/ctzrqf.f"> 00013 *> [ZIP]</a> 00014 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/ctzrqf.f"> 00015 *> [TXT]</a> 00016 *> \endhtmlonly 00017 * 00018 * Definition: 00019 * =========== 00020 * 00021 * SUBROUTINE CTZRQF( M, N, A, LDA, TAU, INFO ) 00022 * 00023 * .. Scalar Arguments .. 00024 * INTEGER INFO, LDA, M, N 00025 * .. 00026 * .. Array Arguments .. 00027 * COMPLEX A( LDA, * ), TAU( * ) 00028 * .. 00029 * 00030 * 00031 *> \par Purpose: 00032 * ============= 00033 *> 00034 *> \verbatim 00035 *> 00036 *> This routine is deprecated and has been replaced by routine CTZRZF. 00037 *> 00038 *> CTZRQF reduces the M-by-N ( M<=N ) complex upper trapezoidal matrix A 00039 *> to upper triangular form by means of unitary transformations. 00040 *> 00041 *> The upper trapezoidal matrix A is factored as 00042 *> 00043 *> A = ( R 0 ) * Z, 00044 *> 00045 *> where Z is an N-by-N unitary matrix and R is an M-by-M upper 00046 *> triangular matrix. 00047 *> \endverbatim 00048 * 00049 * Arguments: 00050 * ========== 00051 * 00052 *> \param[in] M 00053 *> \verbatim 00054 *> M is INTEGER 00055 *> The number of rows of the matrix A. M >= 0. 00056 *> \endverbatim 00057 *> 00058 *> \param[in] N 00059 *> \verbatim 00060 *> N is INTEGER 00061 *> The number of columns of the matrix A. N >= M. 00062 *> \endverbatim 00063 *> 00064 *> \param[in,out] A 00065 *> \verbatim 00066 *> A is COMPLEX 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 M+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 array, dimension (M) 00084 *> The scalar factors of the elementary reflectors. 00085 *> \endverbatim 00086 *> 00087 *> \param[out] INFO 00088 *> \verbatim 00089 *> INFO is INTEGER 00090 *> = 0: successful exit 00091 *> < 0: if INFO = -i, the i-th argument had an illegal value 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 complexOTHERcomputational 00105 * 00106 *> \par Further Details: 00107 * ===================== 00108 *> 00109 *> \verbatim 00110 *> 00111 *> The factorization is obtained by Householder's method. The kth 00112 *> transformation matrix, Z( k ), whose conjugate transpose is used to 00113 *> introduce zeros into the (m - k + 1)th row of A, is given in the form 00114 *> 00115 *> Z( k ) = ( I 0 ), 00116 *> ( 0 T( k ) ) 00117 *> 00118 *> where 00119 *> 00120 *> T( k ) = I - tau*u( k )*u( k )**H, u( k ) = ( 1 ), 00121 *> ( 0 ) 00122 *> ( z( k ) ) 00123 *> 00124 *> tau is a scalar and z( k ) is an ( n - m ) element vector. 00125 *> tau and z( k ) are chosen to annihilate the elements of the kth row 00126 *> of X. 00127 *> 00128 *> The scalar tau is returned in the kth element of TAU and the vector 00129 *> u( k ) in the kth row of A, such that the elements of z( k ) are 00130 *> in a( k, m + 1 ), ..., a( k, n ). The elements of R are returned in 00131 *> the upper triangular part of A. 00132 *> 00133 *> Z is given by 00134 *> 00135 *> Z = Z( 1 ) * Z( 2 ) * ... * Z( m ). 00136 *> \endverbatim 00137 *> 00138 * ===================================================================== 00139 SUBROUTINE CTZRQF( M, N, A, LDA, TAU, INFO ) 00140 * 00141 * -- LAPACK computational routine (version 3.4.0) -- 00142 * -- LAPACK is a software package provided by Univ. of Tennessee, -- 00143 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..-- 00144 * November 2011 00145 * 00146 * .. Scalar Arguments .. 00147 INTEGER INFO, LDA, M, N 00148 * .. 00149 * .. Array Arguments .. 00150 COMPLEX A( LDA, * ), TAU( * ) 00151 * .. 00152 * 00153 * ===================================================================== 00154 * 00155 * .. Parameters .. 00156 COMPLEX CONE, CZERO 00157 PARAMETER ( CONE = ( 1.0E+0, 0.0E+0 ), 00158 $ CZERO = ( 0.0E+0, 0.0E+0 ) ) 00159 * .. 00160 * .. Local Scalars .. 00161 INTEGER I, K, M1 00162 COMPLEX ALPHA 00163 * .. 00164 * .. Intrinsic Functions .. 00165 INTRINSIC CONJG, MAX, MIN 00166 * .. 00167 * .. External Subroutines .. 00168 EXTERNAL CAXPY, CCOPY, CGEMV, CGERC, CLACGV, CLARFG, 00169 $ XERBLA 00170 * .. 00171 * .. Executable Statements .. 00172 * 00173 * Test the input parameters. 00174 * 00175 INFO = 0 00176 IF( M.LT.0 ) THEN 00177 INFO = -1 00178 ELSE IF( N.LT.M ) THEN 00179 INFO = -2 00180 ELSE IF( LDA.LT.MAX( 1, M ) ) THEN 00181 INFO = -4 00182 END IF 00183 IF( INFO.NE.0 ) THEN 00184 CALL XERBLA( 'CTZRQF', -INFO ) 00185 RETURN 00186 END IF 00187 * 00188 * Perform the factorization. 00189 * 00190 IF( M.EQ.0 ) 00191 $ RETURN 00192 IF( M.EQ.N ) THEN 00193 DO 10 I = 1, N 00194 TAU( I ) = CZERO 00195 10 CONTINUE 00196 ELSE 00197 M1 = MIN( M+1, N ) 00198 DO 20 K = M, 1, -1 00199 * 00200 * Use a Householder reflection to zero the kth row of A. 00201 * First set up the reflection. 00202 * 00203 A( K, K ) = CONJG( A( K, K ) ) 00204 CALL CLACGV( N-M, A( K, M1 ), LDA ) 00205 ALPHA = A( K, K ) 00206 CALL CLARFG( N-M+1, ALPHA, A( K, M1 ), LDA, TAU( K ) ) 00207 A( K, K ) = ALPHA 00208 TAU( K ) = CONJG( TAU( K ) ) 00209 * 00210 IF( TAU( K ).NE.CZERO .AND. K.GT.1 ) THEN 00211 * 00212 * We now perform the operation A := A*P( k )**H. 00213 * 00214 * Use the first ( k - 1 ) elements of TAU to store a( k ), 00215 * where a( k ) consists of the first ( k - 1 ) elements of 00216 * the kth column of A. Also let B denote the first 00217 * ( k - 1 ) rows of the last ( n - m ) columns of A. 00218 * 00219 CALL CCOPY( K-1, A( 1, K ), 1, TAU, 1 ) 00220 * 00221 * Form w = a( k ) + B*z( k ) in TAU. 00222 * 00223 CALL CGEMV( 'No transpose', K-1, N-M, CONE, A( 1, M1 ), 00224 $ LDA, A( K, M1 ), LDA, CONE, TAU, 1 ) 00225 * 00226 * Now form a( k ) := a( k ) - conjg(tau)*w 00227 * and B := B - conjg(tau)*w*z( k )**H. 00228 * 00229 CALL CAXPY( K-1, -CONJG( TAU( K ) ), TAU, 1, A( 1, K ), 00230 $ 1 ) 00231 CALL CGERC( K-1, N-M, -CONJG( TAU( K ) ), TAU, 1, 00232 $ A( K, M1 ), LDA, A( 1, M1 ), LDA ) 00233 END IF 00234 20 CONTINUE 00235 END IF 00236 * 00237 RETURN 00238 * 00239 * End of CTZRQF 00240 * 00241 END