LAPACK  3.4.1
LAPACK: Linear Algebra PACKage
zqrt11.f
Go to the documentation of this file.
00001 *> \brief \b ZQRT11
00002 *
00003 *  =========== DOCUMENTATION ===========
00004 *
00005 * Online html documentation available at 
00006 *            http://www.netlib.org/lapack/explore-html/ 
00007 *
00008 *  Definition:
00009 *  ===========
00010 *
00011 *       DOUBLE PRECISION FUNCTION ZQRT11( M, K, A, LDA, TAU, WORK, LWORK )
00012 * 
00013 *       .. Scalar Arguments ..
00014 *       INTEGER            K, LDA, LWORK, M
00015 *       ..
00016 *       .. Array Arguments ..
00017 *       COMPLEX*16         A( LDA, * ), TAU( * ), WORK( LWORK )
00018 *       ..
00019 *  
00020 *
00021 *> \par Purpose:
00022 *  =============
00023 *>
00024 *> \verbatim
00025 *>
00026 *> ZQRT11 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*16 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*16 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*16 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 complex16_lin
00097 *
00098 *  =====================================================================
00099       DOUBLE PRECISION FUNCTION ZQRT11( 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*16         A( LDA, * ), TAU( * ), WORK( LWORK )
00111 *     ..
00112 *
00113 *  =====================================================================
00114 *
00115 *     .. Parameters ..
00116       DOUBLE PRECISION   ZERO, ONE
00117       PARAMETER          ( ZERO = 0.0D0, ONE = 1.0D0 )
00118 *     ..
00119 *     .. Local Scalars ..
00120       INTEGER            INFO, J
00121 *     ..
00122 *     .. External Functions ..
00123       DOUBLE PRECISION   DLAMCH, ZLANGE
00124       EXTERNAL           DLAMCH, ZLANGE
00125 *     ..
00126 *     .. External Subroutines ..
00127       EXTERNAL           XERBLA, ZLASET, ZUNM2R
00128 *     ..
00129 *     .. Intrinsic Functions ..
00130       INTRINSIC          DBLE, DCMPLX
00131 *     ..
00132 *     .. Local Arrays ..
00133       DOUBLE PRECISION   RDUMMY( 1 )
00134 *     ..
00135 *     .. Executable Statements ..
00136 *
00137       ZQRT11 = ZERO
00138 *
00139 *     Test for sufficient workspace
00140 *
00141       IF( LWORK.LT.M*M+M ) THEN
00142          CALL XERBLA( 'ZQRT11', 7 )
00143          RETURN
00144       END IF
00145 *
00146 *     Quick return if possible
00147 *
00148       IF( M.LE.0 )
00149      $   RETURN
00150 *
00151       CALL ZLASET( 'Full', M, M, DCMPLX( ZERO ), DCMPLX( ONE ), WORK,
00152      $             M )
00153 *
00154 *     Form Q
00155 *
00156       CALL ZUNM2R( 'Left', 'No transpose', M, M, K, A, LDA, TAU, WORK,
00157      $             M, WORK( M*M+1 ), INFO )
00158 *
00159 *     Form Q'*Q
00160 *
00161       CALL ZUNM2R( 'Left', 'Conjugate transpose', M, M, K, A, LDA, TAU,
00162      $             WORK, M, WORK( M*M+1 ), INFO )
00163 *
00164       DO 10 J = 1, M
00165          WORK( ( J-1 )*M+J ) = WORK( ( J-1 )*M+J ) - ONE
00166    10 CONTINUE
00167 *
00168       ZQRT11 = ZLANGE( 'One-norm', M, M, WORK, M, RDUMMY ) /
00169      $         ( DBLE( M )*DLAMCH( 'Epsilon' ) )
00170 *
00171       RETURN
00172 *
00173 *     End of ZQRT11
00174 *
00175       END
 All Files Functions