![]() |
LAPACK
3.4.1
LAPACK: Linear Algebra PACKage
|
00001 *> \brief \b CQRT11 00002 * 00003 * =========== DOCUMENTATION =========== 00004 * 00005 * Online html documentation available at 00006 * http://www.netlib.org/lapack/explore-html/ 00007 * 00008 * Definition: 00009 * =========== 00010 * 00011 * REAL FUNCTION CQRT11( M, K, A, LDA, TAU, WORK, LWORK ) 00012 * 00013 * .. Scalar Arguments .. 00014 * INTEGER K, LDA, LWORK, M 00015 * .. 00016 * .. Array Arguments .. 00017 * COMPLEX A( LDA, * ), TAU( * ), WORK( LWORK ) 00018 * .. 00019 * 00020 * 00021 *> \par Purpose: 00022 * ============= 00023 *> 00024 *> \verbatim 00025 *> 00026 *> CQRT11 computes the test ratio 00027 *> 00028 *> || Q'*Q - I || / (eps * m) 00029 *> 00030 *> where the orthogonal matrix Q is represented as a product of 00031 *> elementary transformations. Each transformation has the form 00032 *> 00033 *> H(k) = I - tau(k) v(k) v(k)' 00034 *> 00035 *> where tau(k) is stored in TAU(k) and v(k) is an m-vector of the form 00036 *> [ 0 ... 0 1 x(k) ]', where x(k) is a vector of length m-k stored 00037 *> in A(k+1:m,k). 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. 00047 *> \endverbatim 00048 *> 00049 *> \param[in] K 00050 *> \verbatim 00051 *> K is INTEGER 00052 *> The number of columns of A whose subdiagonal entries 00053 *> contain information about orthogonal transformations. 00054 *> \endverbatim 00055 *> 00056 *> \param[in] A 00057 *> \verbatim 00058 *> A is COMPLEX array, dimension (LDA,K) 00059 *> The (possibly partial) output of a QR reduction routine. 00060 *> \endverbatim 00061 *> 00062 *> \param[in] LDA 00063 *> \verbatim 00064 *> LDA is INTEGER 00065 *> The leading dimension of the array A. 00066 *> \endverbatim 00067 *> 00068 *> \param[in] TAU 00069 *> \verbatim 00070 *> TAU is COMPLEX array, dimension (K) 00071 *> The scaling factors tau for the elementary transformations as 00072 *> computed by the QR factorization routine. 00073 *> \endverbatim 00074 *> 00075 *> \param[out] WORK 00076 *> \verbatim 00077 *> WORK is COMPLEX array, dimension (LWORK) 00078 *> \endverbatim 00079 *> 00080 *> \param[in] LWORK 00081 *> \verbatim 00082 *> LWORK is INTEGER 00083 *> The length of the array WORK. LWORK >= M*M + M. 00084 *> \endverbatim 00085 * 00086 * Authors: 00087 * ======== 00088 * 00089 *> \author Univ. of Tennessee 00090 *> \author Univ. of California Berkeley 00091 *> \author Univ. of Colorado Denver 00092 *> \author NAG Ltd. 00093 * 00094 *> \date November 2011 00095 * 00096 *> \ingroup complex_lin 00097 * 00098 * ===================================================================== 00099 REAL FUNCTION CQRT11( M, K, A, LDA, TAU, WORK, LWORK ) 00100 * 00101 * -- LAPACK test routine (version 3.4.0) -- 00102 * -- LAPACK is a software package provided by Univ. of Tennessee, -- 00103 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..-- 00104 * November 2011 00105 * 00106 * .. Scalar Arguments .. 00107 INTEGER K, LDA, LWORK, M 00108 * .. 00109 * .. Array Arguments .. 00110 COMPLEX A( LDA, * ), TAU( * ), WORK( LWORK ) 00111 * .. 00112 * 00113 * ===================================================================== 00114 * 00115 * .. Parameters .. 00116 REAL ZERO, ONE 00117 PARAMETER ( ZERO = 0.0E0, ONE = 1.0E0 ) 00118 * .. 00119 * .. Local Scalars .. 00120 INTEGER INFO, J 00121 * .. 00122 * .. External Functions .. 00123 REAL CLANGE, SLAMCH 00124 EXTERNAL CLANGE, SLAMCH 00125 * .. 00126 * .. External Subroutines .. 00127 EXTERNAL CLASET, CUNM2R, XERBLA 00128 * .. 00129 * .. Intrinsic Functions .. 00130 INTRINSIC CMPLX, REAL 00131 * .. 00132 * .. Local Arrays .. 00133 REAL RDUMMY( 1 ) 00134 * .. 00135 * .. Executable Statements .. 00136 * 00137 CQRT11 = ZERO 00138 * 00139 * Test for sufficient workspace 00140 * 00141 IF( LWORK.LT.M*M+M ) THEN 00142 CALL XERBLA( 'CQRT11', 7 ) 00143 RETURN 00144 END IF 00145 * 00146 * Quick return if possible 00147 * 00148 IF( M.LE.0 ) 00149 $ RETURN 00150 * 00151 CALL CLASET( 'Full', M, M, CMPLX( ZERO ), CMPLX( ONE ), WORK, M ) 00152 * 00153 * Form Q 00154 * 00155 CALL CUNM2R( 'Left', 'No transpose', M, M, K, A, LDA, TAU, WORK, 00156 $ M, WORK( M*M+1 ), INFO ) 00157 * 00158 * Form Q'*Q 00159 * 00160 CALL CUNM2R( 'Left', 'Conjugate transpose', M, M, K, A, LDA, TAU, 00161 $ WORK, M, WORK( M*M+1 ), INFO ) 00162 * 00163 DO 10 J = 1, M 00164 WORK( ( J-1 )*M+J ) = WORK( ( J-1 )*M+J ) - ONE 00165 10 CONTINUE 00166 * 00167 CQRT11 = CLANGE( 'One-norm', M, M, WORK, M, RDUMMY ) / 00168 $ ( REAL( M )*SLAMCH( 'Epsilon' ) ) 00169 * 00170 RETURN 00171 * 00172 * End of CQRT11 00173 * 00174 END