1*> \brief \b CERRQR
2*
3*  =========== DOCUMENTATION ===========
4*
5* Online html documentation available at
6*            http://www.netlib.org/lapack/explore-html/
7*
8*  Definition:
9*  ===========
10*
11*       SUBROUTINE CERRQR( PATH, NUNIT )
12*
13*       .. Scalar Arguments ..
14*       CHARACTER*3        PATH
15*       INTEGER            NUNIT
16*       ..
17*
18*
19*> \par Purpose:
20*  =============
21*>
22*> \verbatim
23*>
24*> CERRQR tests the error exits for the COMPLEX routines
25*> that use the QR decomposition of a general matrix.
26*> \endverbatim
27*
28*  Arguments:
29*  ==========
30*
31*> \param[in] PATH
32*> \verbatim
33*>          PATH is CHARACTER*3
34*>          The LAPACK path name for the routines to be tested.
35*> \endverbatim
36*>
37*> \param[in] NUNIT
38*> \verbatim
39*>          NUNIT is INTEGER
40*>          The unit number for output.
41*> \endverbatim
42*
43*  Authors:
44*  ========
45*
46*> \author Univ. of Tennessee
47*> \author Univ. of California Berkeley
48*> \author Univ. of Colorado Denver
49*> \author NAG Ltd.
50*
51*> \ingroup complex_lin
52*
53*  =====================================================================
54      SUBROUTINE CERRQR( PATH, NUNIT )
55*
56*  -- LAPACK test routine --
57*  -- LAPACK is a software package provided by Univ. of Tennessee,    --
58*  -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
59*
60*     .. Scalar Arguments ..
61      CHARACTER*3        PATH
62      INTEGER            NUNIT
63*     ..
64*
65*  =====================================================================
66*
67*     .. Parameters ..
68      INTEGER            NMAX
69      PARAMETER          ( NMAX = 2 )
70*     ..
71*     .. Local Scalars ..
72      INTEGER            I, INFO, J
73*     ..
74*     .. Local Arrays ..
75      COMPLEX            A( NMAX, NMAX ), AF( NMAX, NMAX ), B( NMAX ),
76     $                   W( NMAX ), X( NMAX )
77*     ..
78*     .. External Subroutines ..
79      EXTERNAL           ALAESM, CGEQR2, CGEQR2P, CGEQRF, CGEQRFP,
80     $                   CGEQRS, CHKXER, CUNG2R, CUNGQR, CUNM2R,
81     $                   CUNMQR
82*     ..
83*     .. Scalars in Common ..
84      LOGICAL            LERR, OK
85      CHARACTER*32       SRNAMT
86      INTEGER            INFOT, NOUT
87*     ..
88*     .. Common blocks ..
89      COMMON             / INFOC / INFOT, NOUT, OK, LERR
90      COMMON             / SRNAMC / SRNAMT
91*     ..
92*     .. Intrinsic Functions ..
93      INTRINSIC          CMPLX, REAL
94*     ..
95*     .. Executable Statements ..
96*
97      NOUT = NUNIT
98      WRITE( NOUT, FMT = * )
99*
100*     Set the variables to innocuous values.
101*
102      DO 20 J = 1, NMAX
103         DO 10 I = 1, NMAX
104            A( I, J ) = CMPLX( 1. / REAL( I+J ), -1. / REAL( I+J ) )
105            AF( I, J ) = CMPLX( 1. / REAL( I+J ), -1. / REAL( I+J ) )
106   10    CONTINUE
107         B( J ) = 0.
108         W( J ) = 0.
109         X( J ) = 0.
110   20 CONTINUE
111      OK = .TRUE.
112*
113*     Error exits for QR factorization
114*
115*     CGEQRF
116*
117      SRNAMT = 'CGEQRF'
118      INFOT = 1
119      CALL CGEQRF( -1, 0, A, 1, B, W, 1, INFO )
120      CALL CHKXER( 'CGEQRF', INFOT, NOUT, LERR, OK )
121      INFOT = 2
122      CALL CGEQRF( 0, -1, A, 1, B, W, 1, INFO )
123      CALL CHKXER( 'CGEQRF', INFOT, NOUT, LERR, OK )
124      INFOT = 4
125      CALL CGEQRF( 2, 1, A, 1, B, W, 1, INFO )
126      CALL CHKXER( 'CGEQRF', INFOT, NOUT, LERR, OK )
127      INFOT = 7
128      CALL CGEQRF( 1, 2, A, 1, B, W, 1, INFO )
129      CALL CHKXER( 'CGEQRF', INFOT, NOUT, LERR, OK )
130*
131*     CGEQRFP
132*
133      SRNAMT = 'CGEQRFP'
134      INFOT = 1
135      CALL CGEQRFP( -1, 0, A, 1, B, W, 1, INFO )
136      CALL CHKXER( 'CGEQRFP', INFOT, NOUT, LERR, OK )
137      INFOT = 2
138      CALL CGEQRFP( 0, -1, A, 1, B, W, 1, INFO )
139      CALL CHKXER( 'CGEQRFP', INFOT, NOUT, LERR, OK )
140      INFOT = 4
141      CALL CGEQRFP( 2, 1, A, 1, B, W, 1, INFO )
142      CALL CHKXER( 'CGEQRFP', INFOT, NOUT, LERR, OK )
143      INFOT = 7
144      CALL CGEQRFP( 1, 2, A, 1, B, W, 1, INFO )
145      CALL CHKXER( 'CGEQRFP', INFOT, NOUT, LERR, OK )
146*
147*     CGEQR2
148*
149      SRNAMT = 'CGEQR2'
150      INFOT = 1
151      CALL CGEQR2( -1, 0, A, 1, B, W, INFO )
152      CALL CHKXER( 'CGEQR2', INFOT, NOUT, LERR, OK )
153      INFOT = 2
154      CALL CGEQR2( 0, -1, A, 1, B, W, INFO )
155      CALL CHKXER( 'CGEQR2', INFOT, NOUT, LERR, OK )
156      INFOT = 4
157      CALL CGEQR2( 2, 1, A, 1, B, W, INFO )
158      CALL CHKXER( 'CGEQR2', INFOT, NOUT, LERR, OK )
159*
160*     CGEQR2P
161*
162      SRNAMT = 'CGEQR2P'
163      INFOT = 1
164      CALL CGEQR2P( -1, 0, A, 1, B, W, INFO )
165      CALL CHKXER( 'CGEQR2P', INFOT, NOUT, LERR, OK )
166      INFOT = 2
167      CALL CGEQR2P( 0, -1, A, 1, B, W, INFO )
168      CALL CHKXER( 'CGEQR2P', INFOT, NOUT, LERR, OK )
169      INFOT = 4
170      CALL CGEQR2P( 2, 1, A, 1, B, W, INFO )
171      CALL CHKXER( 'CGEQR2P', INFOT, NOUT, LERR, OK )
172*
173*     CGEQRS
174*
175      SRNAMT = 'CGEQRS'
176      INFOT = 1
177      CALL CGEQRS( -1, 0, 0, A, 1, X, B, 1, W, 1, INFO )
178      CALL CHKXER( 'CGEQRS', INFOT, NOUT, LERR, OK )
179      INFOT = 2
180      CALL CGEQRS( 0, -1, 0, A, 1, X, B, 1, W, 1, INFO )
181      CALL CHKXER( 'CGEQRS', INFOT, NOUT, LERR, OK )
182      INFOT = 2
183      CALL CGEQRS( 1, 2, 0, A, 2, X, B, 2, W, 1, INFO )
184      CALL CHKXER( 'CGEQRS', INFOT, NOUT, LERR, OK )
185      INFOT = 3
186      CALL CGEQRS( 0, 0, -1, A, 1, X, B, 1, W, 1, INFO )
187      CALL CHKXER( 'CGEQRS', INFOT, NOUT, LERR, OK )
188      INFOT = 5
189      CALL CGEQRS( 2, 1, 0, A, 1, X, B, 2, W, 1, INFO )
190      CALL CHKXER( 'CGEQRS', INFOT, NOUT, LERR, OK )
191      INFOT = 8
192      CALL CGEQRS( 2, 1, 0, A, 2, X, B, 1, W, 1, INFO )
193      CALL CHKXER( 'CGEQRS', INFOT, NOUT, LERR, OK )
194      INFOT = 10
195      CALL CGEQRS( 1, 1, 2, A, 1, X, B, 1, W, 1, INFO )
196      CALL CHKXER( 'CGEQRS', INFOT, NOUT, LERR, OK )
197*
198*     CUNGQR
199*
200      SRNAMT = 'CUNGQR'
201      INFOT = 1
202      CALL CUNGQR( -1, 0, 0, A, 1, X, W, 1, INFO )
203      CALL CHKXER( 'CUNGQR', INFOT, NOUT, LERR, OK )
204      INFOT = 2
205      CALL CUNGQR( 0, -1, 0, A, 1, X, W, 1, INFO )
206      CALL CHKXER( 'CUNGQR', INFOT, NOUT, LERR, OK )
207      INFOT = 2
208      CALL CUNGQR( 1, 2, 0, A, 1, X, W, 2, INFO )
209      CALL CHKXER( 'CUNGQR', INFOT, NOUT, LERR, OK )
210      INFOT = 3
211      CALL CUNGQR( 0, 0, -1, A, 1, X, W, 1, INFO )
212      CALL CHKXER( 'CUNGQR', INFOT, NOUT, LERR, OK )
213      INFOT = 3
214      CALL CUNGQR( 1, 1, 2, A, 1, X, W, 1, INFO )
215      CALL CHKXER( 'CUNGQR', INFOT, NOUT, LERR, OK )
216      INFOT = 5
217      CALL CUNGQR( 2, 2, 0, A, 1, X, W, 2, INFO )
218      CALL CHKXER( 'CUNGQR', INFOT, NOUT, LERR, OK )
219      INFOT = 8
220      CALL CUNGQR( 2, 2, 0, A, 2, X, W, 1, INFO )
221      CALL CHKXER( 'CUNGQR', INFOT, NOUT, LERR, OK )
222*
223*     CUNG2R
224*
225      SRNAMT = 'CUNG2R'
226      INFOT = 1
227      CALL CUNG2R( -1, 0, 0, A, 1, X, W, INFO )
228      CALL CHKXER( 'CUNG2R', INFOT, NOUT, LERR, OK )
229      INFOT = 2
230      CALL CUNG2R( 0, -1, 0, A, 1, X, W, INFO )
231      CALL CHKXER( 'CUNG2R', INFOT, NOUT, LERR, OK )
232      INFOT = 2
233      CALL CUNG2R( 1, 2, 0, A, 1, X, W, INFO )
234      CALL CHKXER( 'CUNG2R', INFOT, NOUT, LERR, OK )
235      INFOT = 3
236      CALL CUNG2R( 0, 0, -1, A, 1, X, W, INFO )
237      CALL CHKXER( 'CUNG2R', INFOT, NOUT, LERR, OK )
238      INFOT = 3
239      CALL CUNG2R( 2, 1, 2, A, 2, X, W, INFO )
240      CALL CHKXER( 'CUNG2R', INFOT, NOUT, LERR, OK )
241      INFOT = 5
242      CALL CUNG2R( 2, 1, 0, A, 1, X, W, INFO )
243      CALL CHKXER( 'CUNG2R', INFOT, NOUT, LERR, OK )
244*
245*     CUNMQR
246*
247      SRNAMT = 'CUNMQR'
248      INFOT = 1
249      CALL CUNMQR( '/', 'N', 0, 0, 0, A, 1, X, AF, 1, W, 1, INFO )
250      CALL CHKXER( 'CUNMQR', INFOT, NOUT, LERR, OK )
251      INFOT = 2
252      CALL CUNMQR( 'L', '/', 0, 0, 0, A, 1, X, AF, 1, W, 1, INFO )
253      CALL CHKXER( 'CUNMQR', INFOT, NOUT, LERR, OK )
254      INFOT = 3
255      CALL CUNMQR( 'L', 'N', -1, 0, 0, A, 1, X, AF, 1, W, 1, INFO )
256      CALL CHKXER( 'CUNMQR', INFOT, NOUT, LERR, OK )
257      INFOT = 4
258      CALL CUNMQR( 'L', 'N', 0, -1, 0, A, 1, X, AF, 1, W, 1, INFO )
259      CALL CHKXER( 'CUNMQR', INFOT, NOUT, LERR, OK )
260      INFOT = 5
261      CALL CUNMQR( 'L', 'N', 0, 0, -1, A, 1, X, AF, 1, W, 1, INFO )
262      CALL CHKXER( 'CUNMQR', INFOT, NOUT, LERR, OK )
263      INFOT = 5
264      CALL CUNMQR( 'L', 'N', 0, 1, 1, A, 1, X, AF, 1, W, 1, INFO )
265      CALL CHKXER( 'CUNMQR', INFOT, NOUT, LERR, OK )
266      INFOT = 5
267      CALL CUNMQR( 'R', 'N', 1, 0, 1, A, 1, X, AF, 1, W, 1, INFO )
268      CALL CHKXER( 'CUNMQR', INFOT, NOUT, LERR, OK )
269      INFOT = 7
270      CALL CUNMQR( 'L', 'N', 2, 1, 0, A, 1, X, AF, 2, W, 1, INFO )
271      CALL CHKXER( 'CUNMQR', INFOT, NOUT, LERR, OK )
272      INFOT = 7
273      CALL CUNMQR( 'R', 'N', 1, 2, 0, A, 1, X, AF, 1, W, 1, INFO )
274      CALL CHKXER( 'CUNMQR', INFOT, NOUT, LERR, OK )
275      INFOT = 10
276      CALL CUNMQR( 'L', 'N', 2, 1, 0, A, 2, X, AF, 1, W, 1, INFO )
277      CALL CHKXER( 'CUNMQR', INFOT, NOUT, LERR, OK )
278      INFOT = 12
279      CALL CUNMQR( 'L', 'N', 1, 2, 0, A, 1, X, AF, 1, W, 1, INFO )
280      CALL CHKXER( 'CUNMQR', INFOT, NOUT, LERR, OK )
281      INFOT = 12
282      CALL CUNMQR( 'R', 'N', 2, 1, 0, A, 1, X, AF, 2, W, 1, INFO )
283      CALL CHKXER( 'CUNMQR', INFOT, NOUT, LERR, OK )
284*
285*     CUNM2R
286*
287      SRNAMT = 'CUNM2R'
288      INFOT = 1
289      CALL CUNM2R( '/', 'N', 0, 0, 0, A, 1, X, AF, 1, W, INFO )
290      CALL CHKXER( 'CUNM2R', INFOT, NOUT, LERR, OK )
291      INFOT = 2
292      CALL CUNM2R( 'L', '/', 0, 0, 0, A, 1, X, AF, 1, W, INFO )
293      CALL CHKXER( 'CUNM2R', INFOT, NOUT, LERR, OK )
294      INFOT = 3
295      CALL CUNM2R( 'L', 'N', -1, 0, 0, A, 1, X, AF, 1, W, INFO )
296      CALL CHKXER( 'CUNM2R', INFOT, NOUT, LERR, OK )
297      INFOT = 4
298      CALL CUNM2R( 'L', 'N', 0, -1, 0, A, 1, X, AF, 1, W, INFO )
299      CALL CHKXER( 'CUNM2R', INFOT, NOUT, LERR, OK )
300      INFOT = 5
301      CALL CUNM2R( 'L', 'N', 0, 0, -1, A, 1, X, AF, 1, W, INFO )
302      CALL CHKXER( 'CUNM2R', INFOT, NOUT, LERR, OK )
303      INFOT = 5
304      CALL CUNM2R( 'L', 'N', 0, 1, 1, A, 1, X, AF, 1, W, INFO )
305      CALL CHKXER( 'CUNM2R', INFOT, NOUT, LERR, OK )
306      INFOT = 5
307      CALL CUNM2R( 'R', 'N', 1, 0, 1, A, 1, X, AF, 1, W, INFO )
308      CALL CHKXER( 'CUNM2R', INFOT, NOUT, LERR, OK )
309      INFOT = 7
310      CALL CUNM2R( 'L', 'N', 2, 1, 0, A, 1, X, AF, 2, W, INFO )
311      CALL CHKXER( 'CUNM2R', INFOT, NOUT, LERR, OK )
312      INFOT = 7
313      CALL CUNM2R( 'R', 'N', 1, 2, 0, A, 1, X, AF, 1, W, INFO )
314      CALL CHKXER( 'CUNM2R', INFOT, NOUT, LERR, OK )
315      INFOT = 10
316      CALL CUNM2R( 'L', 'N', 2, 1, 0, A, 2, X, AF, 1, W, INFO )
317      CALL CHKXER( 'CUNM2R', INFOT, NOUT, LERR, OK )
318*
319*     Print a summary line.
320*
321      CALL ALAESM( PATH, OK, NOUT )
322*
323      RETURN
324*
325*     End of CERRQR
326*
327      END
328