LAPACK  3.10.1
LAPACK: Linear Algebra PACKage
zrzt02.f
Go to the documentation of this file.
1 *> \brief \b ZRZT02
2 *
3 * =========== DOCUMENTATION ===========
4 *
5 * Online html documentation available at
6 * http://www.netlib.org/lapack/explore-html/
7 *
8 * Definition:
9 * ===========
10 *
11 * DOUBLE PRECISION FUNCTION ZRZT02( M, N, AF, LDA, TAU, WORK,
12 * LWORK )
13 *
14 * .. Scalar Arguments ..
15 * INTEGER LDA, LWORK, M, N
16 * ..
17 * .. Array Arguments ..
18 * COMPLEX*16 AF( LDA, * ), TAU( * ), WORK( LWORK )
19 * ..
20 *
21 *
22 *> \par Purpose:
23 * =============
24 *>
25 *> \verbatim
26 *>
27 *> ZRZT02 returns
28 *> || I - Q'*Q || / ( M * eps)
29 *> where the matrix Q is defined by the Householder transformations
30 *> generated by ZTZRZF.
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*16 array, dimension (LDA,N)
51 *> The output of ZTZRZF.
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*16 array, dimension (M)
63 *> Details of the Householder transformations as returned by
64 *> ZTZRZF.
65 *> \endverbatim
66 *>
67 *> \param[out] WORK
68 *> \verbatim
69 *> WORK is COMPLEX*16 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 complex16_lin
87 *
88 * =====================================================================
89  DOUBLE PRECISION FUNCTION zrzt02( 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*16 af( lda, * ), tau( * ), work( lwork )
101 * ..
102 *
103 * =====================================================================
104 *
105 * .. Parameters ..
106  DOUBLE PRECISION zero, one
107  parameter( zero = 0.0d0, one = 1.0d0 )
108 * ..
109 * .. Local Scalars ..
110  INTEGER i, info
111 * ..
112 * .. Local Arrays ..
113  DOUBLE PRECISION rwork( 1 )
114 * ..
115 * .. External Functions ..
116  DOUBLE PRECISION dlamch, zlange
117  EXTERNAL dlamch, zlange
118 * ..
119 * .. External Subroutines ..
120  EXTERNAL xerbla, zlaset, zunmrz
121 * ..
122 * .. Intrinsic Functions ..
123  INTRINSIC dble, dcmplx, max
124 * ..
125 * .. Executable Statements ..
126 *
127  zrzt02 = zero
128 *
129  IF( lwork.LT.n*n+n ) THEN
130  CALL xerbla( 'ZRZT02', 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 zlaset( 'Full', n, n, dcmplx( zero ), dcmplx( one ), work,
142  $ n )
143 *
144 * Q := P(1) * ... * P(m) * Q
145 *
146  CALL zunmrz( 'Left', 'No transpose', n, n, m, n-m, af, lda, tau,
147  $ work, n, work( n*n+1 ), lwork-n*n, info )
148 *
149 * Q := P(m)' * ... * P(1)' * Q
150 *
151  CALL zunmrz( 'Left', 'Conjugate transpose', n, n, m, n-m, af, lda,
152  $ tau, work, n, work( n*n+1 ), lwork-n*n, info )
153 *
154 * Q := Q - I
155 *
156  DO 10 i = 1, n
157  work( ( i-1 )*n+i ) = work( ( i-1 )*n+i ) - one
158  10 CONTINUE
159 *
160  zrzt02 = zlange( 'One-norm', n, n, work, n, rwork ) /
161  $ ( dlamch( 'Epsilon' )*dble( max( m, n ) ) )
162  RETURN
163 *
164 * End of ZRZT02
165 *
166  END
double precision function dlamch(CMACH)
DLAMCH
Definition: dlamch.f:69
subroutine xerbla(SRNAME, INFO)
XERBLA
Definition: xerbla.f:60
double precision function zrzt02(M, N, AF, LDA, TAU, WORK, LWORK)
ZRZT02
Definition: zrzt02.f:91
double precision function zlange(NORM, M, N, A, LDA, WORK)
ZLANGE returns the value of the 1-norm, Frobenius norm, infinity-norm, or the largest absolute value ...
Definition: zlange.f:115
subroutine zlaset(UPLO, M, N, ALPHA, BETA, A, LDA)
ZLASET initializes the off-diagonal elements and the diagonal elements of a matrix to given values.
Definition: zlaset.f:106
subroutine zunmrz(SIDE, TRANS, M, N, K, L, A, LDA, TAU, C, LDC, WORK, LWORK, INFO)
ZUNMRZ
Definition: zunmrz.f:187