LAPACK 3.3.1
Linear Algebra PACKage

ztzt02.f

Go to the documentation of this file.
00001       DOUBLE PRECISION FUNCTION ZTZT02( M, N, AF, LDA, TAU, WORK,
00002      $                 LWORK )
00003 *
00004 *  -- LAPACK test routine (version 3.1) --
00005 *     Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd..
00006 *     November 2006
00007 *
00008 *     .. Scalar Arguments ..
00009       INTEGER            LDA, LWORK, M, N
00010 *     ..
00011 *     .. Array Arguments ..
00012       COMPLEX*16         AF( LDA, * ), TAU( * ), WORK( LWORK )
00013 *     ..
00014 *
00015 *  Purpose
00016 *  =======
00017 *
00018 *  ZTZT02 returns
00019 *       || I - Q'*Q || / ( M * eps)
00020 *  where the matrix Q is defined by the Householder transformations
00021 *  generated by ZTZRQF.
00022 *
00023 *  Arguments
00024 *  =========
00025 *
00026 *  M       (input) INTEGER
00027 *          The number of rows of the matrix AF.
00028 *
00029 *  N       (input) INTEGER
00030 *          The number of columns of the matrix AF.
00031 *
00032 *  AF      (input) COMPLEX*16 array, dimension (LDA,N)
00033 *          The output of ZTZRQF.
00034 *
00035 *  LDA     (input) INTEGER
00036 *          The leading dimension of the array AF.
00037 *
00038 *  TAU     (input) COMPLEX*16 array, dimension (M)
00039 *          Details of the Householder transformations as returned by
00040 *          ZTZRQF.
00041 *
00042 *  WORK    (workspace) COMPLEX*16 array, dimension (LWORK)
00043 *
00044 *  LWORK   (input) INTEGER
00045 *          length of WORK array. Must be >= N*N+N
00046 *
00047 *  =====================================================================
00048 *
00049 *     .. Parameters ..
00050       DOUBLE PRECISION   ZERO, ONE
00051       PARAMETER          ( ZERO = 0.0D0, ONE = 1.0D0 )
00052 *     ..
00053 *     .. Local Scalars ..
00054       INTEGER            I
00055 *     ..
00056 *     .. Local Arrays ..
00057       DOUBLE PRECISION   RWORK( 1 )
00058 *     ..
00059 *     .. External Functions ..
00060       DOUBLE PRECISION   DLAMCH, ZLANGE
00061       EXTERNAL           DLAMCH, ZLANGE
00062 *     ..
00063 *     .. External Subroutines ..
00064       EXTERNAL           XERBLA, ZLASET, ZLATZM
00065 *     ..
00066 *     .. Intrinsic Functions ..
00067       INTRINSIC          DBLE, DCMPLX, DCONJG, MAX
00068 *     ..
00069 *     .. Executable Statements ..
00070 *
00071       ZTZT02 = ZERO
00072 *
00073       IF( LWORK.LT.N*N+N ) THEN
00074          CALL XERBLA( 'ZTZT02', 7 )
00075          RETURN
00076       END IF
00077 *
00078 *     Quick return if possible
00079 *
00080       IF( M.LE.0 .OR. N.LE.0 )
00081      $   RETURN
00082 *
00083 *     Q := I
00084 *
00085       CALL ZLASET( 'Full', N, N, DCMPLX( ZERO ), DCMPLX( ONE ), WORK,
00086      $             N )
00087 *
00088 *     Q := P(1) * ... * P(m) * Q
00089 *
00090       DO 10 I = M, 1, -1
00091          CALL ZLATZM( 'Left', N-M+1, N, AF( I, M+1 ), LDA, TAU( I ),
00092      $                WORK( I ), WORK( M+1 ), N, WORK( N*N+1 ) )
00093    10 CONTINUE
00094 *
00095 *     Q := P(m)' * ... * P(1)' * Q
00096 *
00097       DO 20 I = 1, M
00098          CALL ZLATZM( 'Left', N-M+1, N, AF( I, M+1 ), LDA,
00099      $                DCONJG( TAU( I ) ), WORK( I ), WORK( M+1 ), N,
00100      $                WORK( N*N+1 ) )
00101    20 CONTINUE
00102 *
00103 *     Q := Q - I
00104 *
00105       DO 30 I = 1, N
00106          WORK( ( I-1 )*N+I ) = WORK( ( I-1 )*N+I ) - ONE
00107    30 CONTINUE
00108 *
00109       ZTZT02 = ZLANGE( 'One-norm', N, N, WORK, N, RWORK ) /
00110      $         ( DLAMCH( 'Epsilon' )*DBLE( MAX( M, N ) ) )
00111       RETURN
00112 *
00113 *     End of ZTZT02
00114 *
00115       END
 All Files Functions