LAPACK  3.4.2
LAPACK: Linear Algebra PACKage
 All Files Functions Groups
stzt02.f
Go to the documentation of this file.
1 *> \brief \b STZT02
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 STZT02( M, N, AF, LDA, TAU, WORK,
12 * LWORK )
13 *
14 * .. Scalar Arguments ..
15 * INTEGER LDA, LWORK, M, N
16 * ..
17 * .. Array Arguments ..
18 * REAL AF( LDA, * ), TAU( * ), WORK( LWORK )
19 * ..
20 *
21 *
22 *> \par Purpose:
23 * =============
24 *>
25 *> \verbatim
26 *>
27 *> STZT02 returns
28 *> || I - Q'*Q || / ( M * eps)
29 *> where the matrix Q is defined by the Householder transformations
30 *> generated by STZRQF.
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 REAL array, dimension (LDA,N)
51 *> The output of STZRQF.
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 REAL array, dimension (M)
63 *> Details of the Householder transformations as returned by
64 *> STZRQF.
65 *> \endverbatim
66 *>
67 *> \param[out] WORK
68 *> \verbatim
69 *> WORK is REAL array, dimension (LWORK)
70 *> \endverbatim
71 *>
72 *> \param[in] LWORK
73 *> \verbatim
74 *> LWORK is INTEGER
75 *> length of WORK array. Must be >= 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 *> \date November 2011
87 *
88 *> \ingroup single_lin
89 *
90 * =====================================================================
91  REAL FUNCTION stzt02( M, N, AF, LDA, TAU, WORK,
92  $ lwork )
93 *
94 * -- LAPACK test routine (version 3.4.0) --
95 * -- LAPACK is a software package provided by Univ. of Tennessee, --
96 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
97 * November 2011
98 *
99 * .. Scalar Arguments ..
100  INTEGER lda, lwork, m, n
101 * ..
102 * .. Array Arguments ..
103  REAL af( lda, * ), tau( * ), work( lwork )
104 * ..
105 *
106 * =====================================================================
107 *
108 * .. Parameters ..
109  REAL zero, one
110  parameter( zero = 0.0e0, one = 1.0e0 )
111 * ..
112 * .. Local Scalars ..
113  INTEGER i
114 * ..
115 * .. Local Arrays ..
116  REAL rwork( 1 )
117 * ..
118 * .. External Functions ..
119  REAL slamch, slange
120  EXTERNAL slamch, slange
121 * ..
122 * .. External Subroutines ..
123  EXTERNAL slatzm, slaset, xerbla
124 * ..
125 * .. Intrinsic Functions ..
126  INTRINSIC max, real
127 * ..
128 * .. Executable Statements ..
129 *
130  stzt02 = zero
131 *
132  IF( lwork.LT.n*n+n ) THEN
133  CALL xerbla( 'STZT02', 7 )
134  return
135  END IF
136 *
137 * Quick return if possible
138 *
139  IF( m.LE.0 .OR. n.LE.0 )
140  $ return
141 *
142 * Q := I
143 *
144  CALL slaset( 'Full', n, n, zero, one, work, n )
145 *
146 * Q := P(1) * ... * P(m) * Q
147 *
148  DO 10 i = m, 1, -1
149  CALL slatzm( 'Left', n-m+1, n, af( i, m+1 ), lda, tau( i ),
150  $ work( i ), work( m+1 ), n, work( n*n+1 ) )
151  10 continue
152 *
153 * Q := P(m) * ... * P(1) * Q
154 *
155  DO 20 i = 1, m
156  CALL slatzm( 'Left', n-m+1, n, af( i, m+1 ), lda, tau( i ),
157  $ work( i ), work( m+1 ), n, work( n*n+1 ) )
158  20 continue
159 *
160 * Q := Q - I
161 *
162  DO 30 i = 1, n
163  work( ( i-1 )*n+i ) = work( ( i-1 )*n+i ) - one
164  30 continue
165 *
166  stzt02 = slange( 'One-norm', n, n, work, n, rwork ) /
167  $ ( slamch( 'Epsilon' )*REAL( MAX( M, N ) ) )
168  return
169 *
170 * End of STZT02
171 *
172  END