![]() |
LAPACK
3.4.1
LAPACK: Linear Algebra PACKage
|
00001 *> \brief \b DGEQL2 00002 * 00003 * =========== DOCUMENTATION =========== 00004 * 00005 * Online html documentation available at 00006 * http://www.netlib.org/lapack/explore-html/ 00007 * 00008 *> \htmlonly 00009 *> Download DGEQL2 + dependencies 00010 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/dgeql2.f"> 00011 *> [TGZ]</a> 00012 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/dgeql2.f"> 00013 *> [ZIP]</a> 00014 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dgeql2.f"> 00015 *> [TXT]</a> 00016 *> \endhtmlonly 00017 * 00018 * Definition: 00019 * =========== 00020 * 00021 * SUBROUTINE DGEQL2( M, N, A, LDA, TAU, WORK, INFO ) 00022 * 00023 * .. Scalar Arguments .. 00024 * INTEGER INFO, LDA, M, N 00025 * .. 00026 * .. Array Arguments .. 00027 * DOUBLE PRECISION A( LDA, * ), TAU( * ), WORK( * ) 00028 * .. 00029 * 00030 * 00031 *> \par Purpose: 00032 * ============= 00033 *> 00034 *> \verbatim 00035 *> 00036 *> DGEQL2 computes a QL factorization of a real m by n matrix A: 00037 *> A = Q * L. 00038 *> \endverbatim 00039 * 00040 * Arguments: 00041 * ========== 00042 * 00043 *> \param[in] M 00044 *> \verbatim 00045 *> M is INTEGER 00046 *> The number of rows of the matrix A. M >= 0. 00047 *> \endverbatim 00048 *> 00049 *> \param[in] N 00050 *> \verbatim 00051 *> N is INTEGER 00052 *> The number of columns of the matrix A. N >= 0. 00053 *> \endverbatim 00054 *> 00055 *> \param[in,out] A 00056 *> \verbatim 00057 *> A is DOUBLE PRECISION array, dimension (LDA,N) 00058 *> On entry, the m by n matrix A. 00059 *> On exit, if m >= n, the lower triangle of the subarray 00060 *> A(m-n+1:m,1:n) contains the n by n lower triangular matrix L; 00061 *> if m <= n, the elements on and below the (n-m)-th 00062 *> superdiagonal contain the m by n lower trapezoidal matrix L; 00063 *> the remaining elements, with the array TAU, represent the 00064 *> orthogonal matrix Q as a product of elementary reflectors 00065 *> (see Further Details). 00066 *> \endverbatim 00067 *> 00068 *> \param[in] LDA 00069 *> \verbatim 00070 *> LDA is INTEGER 00071 *> The leading dimension of the array A. LDA >= max(1,M). 00072 *> \endverbatim 00073 *> 00074 *> \param[out] TAU 00075 *> \verbatim 00076 *> TAU is DOUBLE PRECISION array, dimension (min(M,N)) 00077 *> The scalar factors of the elementary reflectors (see Further 00078 *> Details). 00079 *> \endverbatim 00080 *> 00081 *> \param[out] WORK 00082 *> \verbatim 00083 *> WORK is DOUBLE PRECISION array, dimension (N) 00084 *> \endverbatim 00085 *> 00086 *> \param[out] INFO 00087 *> \verbatim 00088 *> INFO is INTEGER 00089 *> = 0: successful exit 00090 *> < 0: if INFO = -i, the i-th argument had an illegal value 00091 *> \endverbatim 00092 * 00093 * Authors: 00094 * ======== 00095 * 00096 *> \author Univ. of Tennessee 00097 *> \author Univ. of California Berkeley 00098 *> \author Univ. of Colorado Denver 00099 *> \author NAG Ltd. 00100 * 00101 *> \date November 2011 00102 * 00103 *> \ingroup doubleGEcomputational 00104 * 00105 *> \par Further Details: 00106 * ===================== 00107 *> 00108 *> \verbatim 00109 *> 00110 *> The matrix Q is represented as a product of elementary reflectors 00111 *> 00112 *> Q = H(k) . . . H(2) H(1), where k = min(m,n). 00113 *> 00114 *> Each H(i) has the form 00115 *> 00116 *> H(i) = I - tau * v * v**T 00117 *> 00118 *> where tau is a real scalar, and v is a real vector with 00119 *> v(m-k+i+1:m) = 0 and v(m-k+i) = 1; v(1:m-k+i-1) is stored on exit in 00120 *> A(1:m-k+i-1,n-k+i), and tau in TAU(i). 00121 *> \endverbatim 00122 *> 00123 * ===================================================================== 00124 SUBROUTINE DGEQL2( M, N, A, LDA, TAU, WORK, INFO ) 00125 * 00126 * -- LAPACK computational routine (version 3.4.0) -- 00127 * -- LAPACK is a software package provided by Univ. of Tennessee, -- 00128 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..-- 00129 * November 2011 00130 * 00131 * .. Scalar Arguments .. 00132 INTEGER INFO, LDA, M, N 00133 * .. 00134 * .. Array Arguments .. 00135 DOUBLE PRECISION A( LDA, * ), TAU( * ), WORK( * ) 00136 * .. 00137 * 00138 * ===================================================================== 00139 * 00140 * .. Parameters .. 00141 DOUBLE PRECISION ONE 00142 PARAMETER ( ONE = 1.0D+0 ) 00143 * .. 00144 * .. Local Scalars .. 00145 INTEGER I, K 00146 DOUBLE PRECISION AII 00147 * .. 00148 * .. External Subroutines .. 00149 EXTERNAL DLARF, DLARFG, XERBLA 00150 * .. 00151 * .. Intrinsic Functions .. 00152 INTRINSIC MAX, MIN 00153 * .. 00154 * .. Executable Statements .. 00155 * 00156 * Test the input arguments 00157 * 00158 INFO = 0 00159 IF( M.LT.0 ) THEN 00160 INFO = -1 00161 ELSE IF( N.LT.0 ) THEN 00162 INFO = -2 00163 ELSE IF( LDA.LT.MAX( 1, M ) ) THEN 00164 INFO = -4 00165 END IF 00166 IF( INFO.NE.0 ) THEN 00167 CALL XERBLA( 'DGEQL2', -INFO ) 00168 RETURN 00169 END IF 00170 * 00171 K = MIN( M, N ) 00172 * 00173 DO 10 I = K, 1, -1 00174 * 00175 * Generate elementary reflector H(i) to annihilate 00176 * A(1:m-k+i-1,n-k+i) 00177 * 00178 CALL DLARFG( M-K+I, A( M-K+I, N-K+I ), A( 1, N-K+I ), 1, 00179 $ TAU( I ) ) 00180 * 00181 * Apply H(i) to A(1:m-k+i,1:n-k+i-1) from the left 00182 * 00183 AII = A( M-K+I, N-K+I ) 00184 A( M-K+I, N-K+I ) = ONE 00185 CALL DLARF( 'Left', M-K+I, N-K+I-1, A( 1, N-K+I ), 1, TAU( I ), 00186 $ A, LDA, WORK ) 00187 A( M-K+I, N-K+I ) = AII 00188 10 CONTINUE 00189 RETURN 00190 * 00191 * End of DGEQL2 00192 * 00193 END