LAPACK  3.4.2
LAPACK: Linear Algebra PACKage
 All Files Functions Groups
stzt01.f
Go to the documentation of this file.
1 *> \brief \b STZT01
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 STZT01( M, N, A, AF, LDA, TAU, WORK,
12 * LWORK )
13 *
14 * .. Scalar Arguments ..
15 * INTEGER LDA, LWORK, M, N
16 * ..
17 * .. Array Arguments ..
18 * REAL A( LDA, * ), AF( LDA, * ), TAU( * ),
19 * $ WORK( LWORK )
20 * ..
21 *
22 *
23 *> \par Purpose:
24 * =============
25 *>
26 *> \verbatim
27 *>
28 *> STZT01 returns
29 *> || A - R*Q || / ( M * eps * ||A|| )
30 *> for an upper trapezoidal A that was factored with 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 matrices A and AF.
40 *> \endverbatim
41 *>
42 *> \param[in] N
43 *> \verbatim
44 *> N is INTEGER
45 *> The number of columns of the matrices A and AF.
46 *> \endverbatim
47 *>
48 *> \param[in] A
49 *> \verbatim
50 *> A is REAL array, dimension (LDA,N)
51 *> The original upper trapezoidal M by N matrix A.
52 *> \endverbatim
53 *>
54 *> \param[in] AF
55 *> \verbatim
56 *> AF is REAL array, dimension (LDA,N)
57 *> The output of STZRQF for input matrix A.
58 *> The lower triangle is not referenced.
59 *> \endverbatim
60 *>
61 *> \param[in] LDA
62 *> \verbatim
63 *> LDA is INTEGER
64 *> The leading dimension of the arrays A and AF.
65 *> \endverbatim
66 *>
67 *> \param[in] TAU
68 *> \verbatim
69 *> TAU is REAL array, dimension (M)
70 *> Details of the Householder transformations as returned by
71 *> STZRQF.
72 *> \endverbatim
73 *>
74 *> \param[out] WORK
75 *> \verbatim
76 *> WORK is REAL array, dimension (LWORK)
77 *> \endverbatim
78 *>
79 *> \param[in] LWORK
80 *> \verbatim
81 *> LWORK is INTEGER
82 *> The length of the array WORK. LWORK >= m*n + m.
83 *> \endverbatim
84 *
85 * Authors:
86 * ========
87 *
88 *> \author Univ. of Tennessee
89 *> \author Univ. of California Berkeley
90 *> \author Univ. of Colorado Denver
91 *> \author NAG Ltd.
92 *
93 *> \date November 2011
94 *
95 *> \ingroup single_lin
96 *
97 * =====================================================================
98  REAL FUNCTION stzt01( M, N, A, AF, LDA, TAU, WORK,
99  $ lwork )
100 *
101 * -- LAPACK test routine (version 3.4.0) --
102 * -- LAPACK is a software package provided by Univ. of Tennessee, --
103 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
104 * November 2011
105 *
106 * .. Scalar Arguments ..
107  INTEGER lda, lwork, m, n
108 * ..
109 * .. Array Arguments ..
110  REAL a( lda, * ), af( lda, * ), tau( * ),
111  $ work( lwork )
112 * ..
113 *
114 * =====================================================================
115 *
116 * .. Parameters ..
117  REAL zero, one
118  parameter( zero = 0.0e0, one = 1.0e0 )
119 * ..
120 * .. Local Scalars ..
121  INTEGER i, j
122  REAL norma
123 * ..
124 * .. Local Arrays ..
125  REAL rwork( 1 )
126 * ..
127 * .. External Functions ..
128  REAL slamch, slange
129  EXTERNAL slamch, slange
130 * ..
131 * .. External Subroutines ..
132  EXTERNAL saxpy, slatzm, slaset, xerbla
133 * ..
134 * .. Intrinsic Functions ..
135  INTRINSIC max, real
136 * ..
137 * .. Executable Statements ..
138 *
139  stzt01 = zero
140 *
141  IF( lwork.LT.m*n+m ) THEN
142  CALL xerbla( 'STZT01', 8 )
143  return
144  END IF
145 *
146 * Quick return if possible
147 *
148  IF( m.LE.0 .OR. n.LE.0 )
149  $ return
150 *
151  norma = slange( 'One-norm', m, n, a, lda, rwork )
152 *
153 * Copy upper triangle R
154 *
155  CALL slaset( 'Full', m, n, zero, zero, work, m )
156  DO 20 j = 1, m
157  DO 10 i = 1, j
158  work( ( j-1 )*m+i ) = af( i, j )
159  10 continue
160  20 continue
161 *
162 * R = R * P(1) * ... *P(m)
163 *
164  DO 30 i = 1, m
165  CALL slatzm( 'Right', i, n-m+1, af( i, m+1 ), lda, tau( i ),
166  $ work( ( i-1 )*m+1 ), work( m*m+1 ), m,
167  $ work( m*n+1 ) )
168  30 continue
169 *
170 * R = R - A
171 *
172  DO 40 i = 1, n
173  CALL saxpy( m, -one, a( 1, i ), 1, work( ( i-1 )*m+1 ), 1 )
174  40 continue
175 *
176  stzt01 = slange( 'One-norm', m, n, work, m, rwork )
177 *
178  stzt01 = stzt01 / ( slamch( 'Epsilon' )*REAL( MAX( M, N ) ) )
179  IF( norma.NE.zero )
180  $ stzt01 = stzt01 / norma
181 *
182  return
183 *
184 * End of STZT01
185 *
186  END