1*> \brief \b CRZT02
2*
3*  =========== DOCUMENTATION ===========
4*
5* Online html documentation available at
6*            http://www.netlib.org/lapack/explore-html/
7*
8*  Definition:
9*  ===========
10*
11*       REAL             FUNCTION CRZT02( M, N, AF, LDA, TAU, WORK,
12*                        LWORK )
13*
14*       .. Scalar Arguments ..
15*       INTEGER            LDA, LWORK, M, N
16*       ..
17*       .. Array Arguments ..
18*       COMPLEX            AF( LDA, * ), TAU( * ), WORK( LWORK )
19*       ..
20*
21*
22*> \par Purpose:
23*  =============
24*>
25*> \verbatim
26*>
27*> CRZT02 returns
28*>      || I - Q'*Q || / ( M * eps)
29*> where the matrix Q is defined by the Householder transformations
30*> generated by CTZRZF.
31*> \endverbatim
32*
33*  Arguments:
34*  ==========
35*
36*> \param[in] M
37*> \verbatim
38*>          M is INTEGER
39*>          The number of rows of the matrix AF.
40*> \endverbatim
41*>
42*> \param[in] N
43*> \verbatim
44*>          N is INTEGER
45*>          The number of columns of the matrix AF.
46*> \endverbatim
47*>
48*> \param[in] AF
49*> \verbatim
50*>          AF is COMPLEX array, dimension (LDA,N)
51*>          The output of CTZRZF.
52*> \endverbatim
53*>
54*> \param[in] LDA
55*> \verbatim
56*>          LDA is INTEGER
57*>          The leading dimension of the array AF.
58*> \endverbatim
59*>
60*> \param[in] TAU
61*> \verbatim
62*>          TAU is COMPLEX array, dimension (M)
63*>          Details of the Householder transformations as returned by
64*>          CTZRZF.
65*> \endverbatim
66*>
67*> \param[out] WORK
68*> \verbatim
69*>          WORK is COMPLEX array, dimension (LWORK)
70*> \endverbatim
71*>
72*> \param[in] LWORK
73*> \verbatim
74*>          LWORK is INTEGER
75*>          Length of WORK array. LWORK >= N*N+N.
76*> \endverbatim
77*
78*  Authors:
79*  ========
80*
81*> \author Univ. of Tennessee
82*> \author Univ. of California Berkeley
83*> \author Univ. of Colorado Denver
84*> \author NAG Ltd.
85*
86*> \ingroup complex_lin
87*
88*  =====================================================================
89      REAL             FUNCTION CRZT02( M, N, AF, LDA, TAU, WORK,
90     $                 LWORK )
91*
92*  -- LAPACK test routine --
93*  -- LAPACK is a software package provided by Univ. of Tennessee,    --
94*  -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
95*
96*     .. Scalar Arguments ..
97      INTEGER            LDA, LWORK, M, N
98*     ..
99*     .. Array Arguments ..
100      COMPLEX            AF( LDA, * ), TAU( * ), WORK( LWORK )
101*     ..
102*
103*  =====================================================================
104*
105*     .. Parameters ..
106      REAL               ZERO, ONE
107      PARAMETER          ( ZERO = 0.0E0, ONE = 1.0E0 )
108*     ..
109*     .. Local Scalars ..
110      INTEGER            I, INFO
111*     ..
112*     .. Local Arrays ..
113      REAL               RWORK( 1 )
114*     ..
115*     .. External Functions ..
116      REAL               CLANGE, SLAMCH
117      EXTERNAL           CLANGE, SLAMCH
118*     ..
119*     .. External Subroutines ..
120      EXTERNAL           CLASET, CUNMRZ, XERBLA
121*     ..
122*     .. Intrinsic Functions ..
123      INTRINSIC          CMPLX, MAX, REAL
124*     ..
125*     .. Executable Statements ..
126*
127      CRZT02 = ZERO
128*
129      IF( LWORK.LT.N*N+N ) THEN
130         CALL XERBLA( 'CRZT02', 7 )
131         RETURN
132      END IF
133*
134*     Quick return if possible
135*
136      IF( M.LE.0 .OR. N.LE.0 )
137     $   RETURN
138*
139*     Q := I
140*
141      CALL CLASET( 'Full', N, N, CMPLX( ZERO ), CMPLX( ONE ), WORK, N )
142*
143*     Q := P(1) * ... * P(m) * Q
144*
145      CALL CUNMRZ( 'Left', 'No transpose', N, N, M, N-M, AF, LDA, TAU,
146     $             WORK, N, WORK( N*N+1 ), LWORK-N*N, INFO )
147*
148*     Q := P(m)' * ... * P(1)' * Q
149*
150      CALL CUNMRZ( 'Left', 'Conjugate transpose', N, N, M, N-M, AF, LDA,
151     $             TAU, WORK, N, WORK( N*N+1 ), LWORK-N*N, INFO )
152*
153*     Q := Q - I
154*
155      DO 10 I = 1, N
156         WORK( ( I-1 )*N+I ) = WORK( ( I-1 )*N+I ) - ONE
157   10 CONTINUE
158*
159      CRZT02 = CLANGE( 'One-norm', N, N, WORK, N, RWORK ) /
160     $         ( SLAMCH( 'Epsilon' )*REAL( MAX( M, N ) ) )
161      RETURN
162*
163*     End of CRZT02
164*
165      END
166