LAPACK  3.4.2
LAPACK: Linear Algebra PACKage
 All Files Functions Groups
cerrhex.f
Go to the documentation of this file.
1 *> \brief \b CERRHEX
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 CERRHE( 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 *> CERRHE tests the error exits for the COMPLEX routines
25 *> for Hermitian indefinite matrices.
26 *>
27 *> Note that this file is used only when the XBLAS are available,
28 *> otherwise cerrhe.f defines this subroutine.
29 *> \endverbatim
30 *
31 * Arguments:
32 * ==========
33 *
34 *> \param[in] PATH
35 *> \verbatim
36 *> PATH is CHARACTER*3
37 *> The LAPACK path name for the routines to be tested.
38 *> \endverbatim
39 *>
40 *> \param[in] NUNIT
41 *> \verbatim
42 *> NUNIT is INTEGER
43 *> The unit number for output.
44 *> \endverbatim
45 *
46 * Authors:
47 * ========
48 *
49 *> \author Univ. of Tennessee
50 *> \author Univ. of California Berkeley
51 *> \author Univ. of Colorado Denver
52 *> \author NAG Ltd.
53 *
54 *> \date November 2011
55 *
56 *> \ingroup complex_lin
57 *
58 * =====================================================================
59  SUBROUTINE cerrhe( PATH, NUNIT )
60 *
61 * -- LAPACK test routine (version 3.4.0) --
62 * -- LAPACK is a software package provided by Univ. of Tennessee, --
63 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
64 * November 2011
65 *
66 * .. Scalar Arguments ..
67  CHARACTER*3 path
68  INTEGER nunit
69 * ..
70 *
71 * =====================================================================
72 *
73 *
74 * .. Parameters ..
75  INTEGER nmax
76  parameter( nmax = 4 )
77 * ..
78 * .. Local Scalars ..
79  CHARACTER eq
80  CHARACTER*2 c2
81  INTEGER i, info, j, n_err_bnds, nparams
82  REAL anrm, rcond, berr
83 * ..
84 * .. Local Arrays ..
85  INTEGER ip( nmax )
86  REAL r( nmax ), r1( nmax ), r2( nmax ),
87  $ s( nmax ), err_bnds_n( nmax, 3 ),
88  $ err_bnds_c( nmax, 3 ), params( 1 )
89  COMPLEX a( nmax, nmax ), af( nmax, nmax ), b( nmax ),
90  $ w( 2*nmax ), x( nmax )
91 * ..
92 * .. External Functions ..
93  LOGICAL lsamen
94  EXTERNAL lsamen
95 * ..
96 * .. External Subroutines ..
97  EXTERNAL alaesm, checon, cherfs, chetf2, chetrf, chetri,
100 * ..
101 * .. Scalars in Common ..
102  LOGICAL lerr, ok
103  CHARACTER*32 srnamt
104  INTEGER infot, nout
105 * ..
106 * .. Common blocks ..
107  common / infoc / infot, nout, ok, lerr
108  common / srnamc / srnamt
109 * ..
110 * .. Intrinsic Functions ..
111  INTRINSIC cmplx, real
112 * ..
113 * .. Executable Statements ..
114 *
115  nout = nunit
116  WRITE( nout, fmt = * )
117  c2 = path( 2: 3 )
118 *
119 * Set the variables to innocuous values.
120 *
121  DO 20 j = 1, nmax
122  DO 10 i = 1, nmax
123  a( i, j ) = cmplx( 1. / REAL( I+J ), -1. / REAL( I+J ) )
124  af( i, j ) = cmplx( 1. / REAL( I+J ), -1. / REAL( I+J ) )
125  10 continue
126  b( j ) = 0.
127  r1( j ) = 0.
128  r2( j ) = 0.
129  w( j ) = 0.
130  x( j ) = 0.
131  s( j ) = 0.
132  ip( j ) = j
133  20 continue
134  anrm = 1.0
135  ok = .true.
136 *
137 * Test error exits of the routines that use the diagonal pivoting
138 * factorization of a Hermitian indefinite matrix.
139 *
140  IF( lsamen( 2, c2, 'HE' ) ) THEN
141 *
142 * CHETRF
143 *
144  srnamt = 'CHETRF'
145  infot = 1
146  CALL chetrf( '/', 0, a, 1, ip, w, 1, info )
147  CALL chkxer( 'CHETRF', infot, nout, lerr, ok )
148  infot = 2
149  CALL chetrf( 'U', -1, a, 1, ip, w, 1, info )
150  CALL chkxer( 'CHETRF', infot, nout, lerr, ok )
151  infot = 4
152  CALL chetrf( 'U', 2, a, 1, ip, w, 4, info )
153  CALL chkxer( 'CHETRF', infot, nout, lerr, ok )
154 *
155 * CHETF2
156 *
157  srnamt = 'CHETF2'
158  infot = 1
159  CALL chetf2( '/', 0, a, 1, ip, info )
160  CALL chkxer( 'CHETF2', infot, nout, lerr, ok )
161  infot = 2
162  CALL chetf2( 'U', -1, a, 1, ip, info )
163  CALL chkxer( 'CHETF2', infot, nout, lerr, ok )
164  infot = 4
165  CALL chetf2( 'U', 2, a, 1, ip, info )
166  CALL chkxer( 'CHETF2', infot, nout, lerr, ok )
167 *
168 * CHETRI
169 *
170  srnamt = 'CHETRI'
171  infot = 1
172  CALL chetri( '/', 0, a, 1, ip, w, info )
173  CALL chkxer( 'CHETRI', infot, nout, lerr, ok )
174  infot = 2
175  CALL chetri( 'U', -1, a, 1, ip, w, info )
176  CALL chkxer( 'CHETRI', infot, nout, lerr, ok )
177  infot = 4
178  CALL chetri( 'U', 2, a, 1, ip, w, info )
179  CALL chkxer( 'CHETRI', infot, nout, lerr, ok )
180 *
181 * CHETRI2
182 *
183  srnamt = 'CHETRI2'
184  infot = 1
185  CALL chetri2( '/', 0, a, 1, ip, w, 1, info )
186  CALL chkxer( 'CHETRI2', infot, nout, lerr, ok )
187  infot = 2
188  CALL chetri2( 'U', -1, a, 1, ip, w, 1, info )
189  CALL chkxer( 'CHETRI2', infot, nout, lerr, ok )
190  infot = 4
191  CALL chetri2( 'U', 2, a, 1, ip, w, 1, info )
192  CALL chkxer( 'CHETRI2', infot, nout, lerr, ok )
193 *
194 * CHETRS
195 *
196  srnamt = 'CHETRS'
197  infot = 1
198  CALL chetrs( '/', 0, 0, a, 1, ip, b, 1, info )
199  CALL chkxer( 'CHETRS', infot, nout, lerr, ok )
200  infot = 2
201  CALL chetrs( 'U', -1, 0, a, 1, ip, b, 1, info )
202  CALL chkxer( 'CHETRS', infot, nout, lerr, ok )
203  infot = 3
204  CALL chetrs( 'U', 0, -1, a, 1, ip, b, 1, info )
205  CALL chkxer( 'CHETRS', infot, nout, lerr, ok )
206  infot = 5
207  CALL chetrs( 'U', 2, 1, a, 1, ip, b, 2, info )
208  CALL chkxer( 'CHETRS', infot, nout, lerr, ok )
209  infot = 8
210  CALL chetrs( 'U', 2, 1, a, 2, ip, b, 1, info )
211  CALL chkxer( 'CHETRS', infot, nout, lerr, ok )
212 *
213 * CHERFS
214 *
215  srnamt = 'CHERFS'
216  infot = 1
217  CALL cherfs( '/', 0, 0, a, 1, af, 1, ip, b, 1, x, 1, r1, r2, w,
218  $ r, info )
219  CALL chkxer( 'CHERFS', infot, nout, lerr, ok )
220  infot = 2
221  CALL cherfs( 'U', -1, 0, a, 1, af, 1, ip, b, 1, x, 1, r1, r2,
222  $ w, r, info )
223  CALL chkxer( 'CHERFS', infot, nout, lerr, ok )
224  infot = 3
225  CALL cherfs( 'U', 0, -1, a, 1, af, 1, ip, b, 1, x, 1, r1, r2,
226  $ w, r, info )
227  CALL chkxer( 'CHERFS', infot, nout, lerr, ok )
228  infot = 5
229  CALL cherfs( 'U', 2, 1, a, 1, af, 2, ip, b, 2, x, 2, r1, r2, w,
230  $ r, info )
231  CALL chkxer( 'CHERFS', infot, nout, lerr, ok )
232  infot = 7
233  CALL cherfs( 'U', 2, 1, a, 2, af, 1, ip, b, 2, x, 2, r1, r2, w,
234  $ r, info )
235  CALL chkxer( 'CHERFS', infot, nout, lerr, ok )
236  infot = 10
237  CALL cherfs( 'U', 2, 1, a, 2, af, 2, ip, b, 1, x, 2, r1, r2, w,
238  $ r, info )
239  CALL chkxer( 'CHERFS', infot, nout, lerr, ok )
240  infot = 12
241  CALL cherfs( 'U', 2, 1, a, 2, af, 2, ip, b, 2, x, 1, r1, r2, w,
242  $ r, info )
243  CALL chkxer( 'CHERFS', infot, nout, lerr, ok )
244 *
245 * CHECON
246 *
247  srnamt = 'CHECON'
248  infot = 1
249  CALL checon( '/', 0, a, 1, ip, anrm, rcond, w, info )
250  CALL chkxer( 'CHECON', infot, nout, lerr, ok )
251  infot = 2
252  CALL checon( 'U', -1, a, 1, ip, anrm, rcond, w, info )
253  CALL chkxer( 'CHECON', infot, nout, lerr, ok )
254  infot = 4
255  CALL checon( 'U', 2, a, 1, ip, anrm, rcond, w, info )
256  CALL chkxer( 'CHECON', infot, nout, lerr, ok )
257  infot = 6
258  CALL checon( 'U', 1, a, 1, ip, -anrm, rcond, w, info )
259  CALL chkxer( 'CHECON', infot, nout, lerr, ok )
260 *
261 * CHERFSX
262 *
263  n_err_bnds = 3
264  nparams = 0
265  srnamt = 'CHERFSX'
266  infot = 1
267  CALL cherfsx( '/', eq, 0, 0, a, 1, af, 1, ip, s, b, 1, x, 1,
268  $ rcond, berr, n_err_bnds, err_bnds_n, err_bnds_c, nparams,
269  $ params, w, r, info )
270  CALL chkxer( 'CHERFSX', infot, nout, lerr, ok )
271  infot = 2
272  CALL cherfsx( 'U', eq, -1, 0, a, 1, af, 1, ip, s, b, 1, x, 1,
273  $ rcond, berr, n_err_bnds, err_bnds_n, err_bnds_c, nparams,
274  $ params, w, r, info )
275  CALL chkxer( 'CHERFSX', infot, nout, lerr, ok )
276  eq = 'N'
277  infot = 3
278  CALL cherfsx( 'U', eq, -1, 0, a, 1, af, 1, ip, s, b, 1, x, 1,
279  $ rcond, berr, n_err_bnds, err_bnds_n, err_bnds_c, nparams,
280  $ params, w, r, info )
281  CALL chkxer( 'CHERFSX', infot, nout, lerr, ok )
282  infot = 4
283  CALL cherfsx( 'U', eq, 0, -1, a, 1, af, 1, ip, s, b, 1, x, 1,
284  $ rcond, berr, n_err_bnds, err_bnds_n, err_bnds_c, nparams,
285  $ params, w, r, info )
286  CALL chkxer( 'CHERFSX', infot, nout, lerr, ok )
287  infot = 6
288  CALL cherfsx( 'U', eq, 2, 1, a, 1, af, 2, ip, s, b, 2, x, 2,
289  $ rcond, berr, n_err_bnds, err_bnds_n, err_bnds_c, nparams,
290  $ params, w, r, info )
291  CALL chkxer( 'CHERFSX', infot, nout, lerr, ok )
292  infot = 8
293  CALL cherfsx( 'U', eq, 2, 1, a, 2, af, 1, ip, s, b, 2, x, 2,
294  $ rcond, berr, n_err_bnds, err_bnds_n, err_bnds_c, nparams,
295  $ params, w, r, info )
296  CALL chkxer( 'CHERFSX', infot, nout, lerr, ok )
297  infot = 12
298  CALL cherfsx( 'U', eq, 2, 1, a, 2, af, 2, ip, s, b, 1, x, 2,
299  $ rcond, berr, n_err_bnds, err_bnds_n, err_bnds_c, nparams,
300  $ params, w, r, info )
301  CALL chkxer( 'CHERFSX', infot, nout, lerr, ok )
302  infot = 14
303  CALL cherfsx( 'U', eq, 2, 1, a, 2, af, 2, ip, s, b, 2, x, 1,
304  $ rcond, berr, n_err_bnds, err_bnds_n, err_bnds_c, nparams,
305  $ params, w, r, info )
306  CALL chkxer( 'CHERFSX', infot, nout, lerr, ok )
307 *
308 * Test error exits of the routines that use the diagonal pivoting
309 * factorization of a Hermitian indefinite packed matrix.
310 *
311  ELSE IF( lsamen( 2, c2, 'HP' ) ) THEN
312 *
313 * CHPTRF
314 *
315  srnamt = 'CHPTRF'
316  infot = 1
317  CALL chptrf( '/', 0, a, ip, info )
318  CALL chkxer( 'CHPTRF', infot, nout, lerr, ok )
319  infot = 2
320  CALL chptrf( 'U', -1, a, ip, info )
321  CALL chkxer( 'CHPTRF', infot, nout, lerr, ok )
322 *
323 * CHPTRI
324 *
325  srnamt = 'CHPTRI'
326  infot = 1
327  CALL chptri( '/', 0, a, ip, w, info )
328  CALL chkxer( 'CHPTRI', infot, nout, lerr, ok )
329  infot = 2
330  CALL chptri( 'U', -1, a, ip, w, info )
331  CALL chkxer( 'CHPTRI', infot, nout, lerr, ok )
332 *
333 * CHPTRS
334 *
335  srnamt = 'CHPTRS'
336  infot = 1
337  CALL chptrs( '/', 0, 0, a, ip, b, 1, info )
338  CALL chkxer( 'CHPTRS', infot, nout, lerr, ok )
339  infot = 2
340  CALL chptrs( 'U', -1, 0, a, ip, b, 1, info )
341  CALL chkxer( 'CHPTRS', infot, nout, lerr, ok )
342  infot = 3
343  CALL chptrs( 'U', 0, -1, a, ip, b, 1, info )
344  CALL chkxer( 'CHPTRS', infot, nout, lerr, ok )
345  infot = 7
346  CALL chptrs( 'U', 2, 1, a, ip, b, 1, info )
347  CALL chkxer( 'CHPTRS', infot, nout, lerr, ok )
348 *
349 * CHPRFS
350 *
351  srnamt = 'CHPRFS'
352  infot = 1
353  CALL chprfs( '/', 0, 0, a, af, ip, b, 1, x, 1, r1, r2, w, r,
354  $ info )
355  CALL chkxer( 'CHPRFS', infot, nout, lerr, ok )
356  infot = 2
357  CALL chprfs( 'U', -1, 0, a, af, ip, b, 1, x, 1, r1, r2, w, r,
358  $ info )
359  CALL chkxer( 'CHPRFS', infot, nout, lerr, ok )
360  infot = 3
361  CALL chprfs( 'U', 0, -1, a, af, ip, b, 1, x, 1, r1, r2, w, r,
362  $ info )
363  CALL chkxer( 'CHPRFS', infot, nout, lerr, ok )
364  infot = 8
365  CALL chprfs( 'U', 2, 1, a, af, ip, b, 1, x, 2, r1, r2, w, r,
366  $ info )
367  CALL chkxer( 'CHPRFS', infot, nout, lerr, ok )
368  infot = 10
369  CALL chprfs( 'U', 2, 1, a, af, ip, b, 2, x, 1, r1, r2, w, r,
370  $ info )
371  CALL chkxer( 'CHPRFS', infot, nout, lerr, ok )
372 *
373 * CHPCON
374 *
375  srnamt = 'CHPCON'
376  infot = 1
377  CALL chpcon( '/', 0, a, ip, anrm, rcond, w, info )
378  CALL chkxer( 'CHPCON', infot, nout, lerr, ok )
379  infot = 2
380  CALL chpcon( 'U', -1, a, ip, anrm, rcond, w, info )
381  CALL chkxer( 'CHPCON', infot, nout, lerr, ok )
382  infot = 5
383  CALL chpcon( 'U', 1, a, ip, -anrm, rcond, w, info )
384  CALL chkxer( 'CHPCON', infot, nout, lerr, ok )
385  END IF
386 *
387 * Print a summary line.
388 *
389  CALL alaesm( path, ok, nout )
390 *
391  return
392 *
393 * End of CERRHE
394 *
395  END