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