LAPACK  3.6.1
LAPACK: Linear Algebra PACKage
cerrhe.f
Go to the documentation of this file.
1 *> \brief \b CERRHE
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 *> \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 November 2013
52 *
53 *> \ingroup complex_lin
54 *
55 * =====================================================================
56  SUBROUTINE cerrhe( PATH, NUNIT )
57 *
58 * -- LAPACK test routine (version 3.5.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 * November 2013
62 *
63 * .. Scalar Arguments ..
64  CHARACTER*3 PATH
65  INTEGER NUNIT
66 * ..
67 *
68 * =====================================================================
69 *
70 *
71 * .. Parameters ..
72  INTEGER NMAX
73  parameter ( nmax = 4 )
74 * ..
75 * .. Local Scalars ..
76  CHARACTER*2 C2
77  INTEGER I, INFO, J
78  REAL ANRM, RCOND
79 * ..
80 * .. Local Arrays ..
81  INTEGER IP( nmax )
82  REAL R( nmax ), R1( nmax ), R2( nmax )
83  COMPLEX A( nmax, nmax ), AF( nmax, nmax ), B( nmax ),
84  $ w( 2*nmax ), x( nmax )
85 * ..
86 * .. External Functions ..
87  LOGICAL LSAMEN
88  EXTERNAL lsamen
89 * ..
90 * .. External Subroutines ..
91  EXTERNAL alaesm, checon, checon_rook, cherfs, chetf2,
95 * ..
96 * .. Scalars in Common ..
97  LOGICAL LERR, OK
98  CHARACTER*32 SRNAMT
99  INTEGER INFOT, NOUT
100 * ..
101 * .. Common blocks ..
102  COMMON / infoc / infot, nout, ok, lerr
103  COMMON / srnamc / srnamt
104 * ..
105 * .. Intrinsic Functions ..
106  INTRINSIC cmplx, real
107 * ..
108 * .. Executable Statements ..
109 *
110  nout = nunit
111  WRITE( nout, fmt = * )
112  c2 = path( 2: 3 )
113 *
114 * Set the variables to innocuous values.
115 *
116  DO 20 j = 1, nmax
117  DO 10 i = 1, nmax
118  a( i, j ) = cmplx( 1. / REAL( I+J ), -1. / REAL( I+J ) )
119  af( i, j ) = cmplx( 1. / REAL( I+J ), -1. / REAL( I+J ) )
120  10 CONTINUE
121  b( j ) = 0.
122  r1( j ) = 0.
123  r2( j ) = 0.
124  w( j ) = 0.
125  x( j ) = 0.
126  ip( j ) = j
127  20 CONTINUE
128  anrm = 1.0
129  ok = .true.
130 *
131 * Test error exits of the routines that use factorization
132 * of a Hermitian indefinite matrix with patrial
133 * (Bunch-Kaufman) diagonal pivoting method.
134 *
135  IF( lsamen( 2, c2, 'HE' ) ) THEN
136 *
137 * CHETRF
138 *
139  srnamt = 'CHETRF'
140  infot = 1
141  CALL chetrf( '/', 0, a, 1, ip, w, 1, info )
142  CALL chkxer( 'CHETRF', infot, nout, lerr, ok )
143  infot = 2
144  CALL chetrf( 'U', -1, a, 1, ip, w, 1, info )
145  CALL chkxer( 'CHETRF', infot, nout, lerr, ok )
146  infot = 4
147  CALL chetrf( 'U', 2, a, 1, ip, w, 4, info )
148  CALL chkxer( 'CHETRF', infot, nout, lerr, ok )
149 *
150 * CHETF2
151 *
152  srnamt = 'CHETF2'
153  infot = 1
154  CALL chetf2( '/', 0, a, 1, ip, info )
155  CALL chkxer( 'CHETF2', infot, nout, lerr, ok )
156  infot = 2
157  CALL chetf2( 'U', -1, a, 1, ip, info )
158  CALL chkxer( 'CHETF2', infot, nout, lerr, ok )
159  infot = 4
160  CALL chetf2( 'U', 2, a, 1, ip, info )
161  CALL chkxer( 'CHETF2', infot, nout, lerr, ok )
162 *
163 * CHETRI
164 *
165  srnamt = 'CHETRI'
166  infot = 1
167  CALL chetri( '/', 0, a, 1, ip, w, info )
168  CALL chkxer( 'CHETRI', infot, nout, lerr, ok )
169  infot = 2
170  CALL chetri( 'U', -1, a, 1, ip, w, info )
171  CALL chkxer( 'CHETRI', infot, nout, lerr, ok )
172  infot = 4
173  CALL chetri( 'U', 2, a, 1, ip, w, info )
174  CALL chkxer( 'CHETRI', infot, nout, lerr, ok )
175 *
176 * CHETRI2
177 *
178  srnamt = 'CHETRI2'
179  infot = 1
180  CALL chetri2( '/', 0, a, 1, ip, w, 1, info )
181  CALL chkxer( 'CHETRI2', infot, nout, lerr, ok )
182  infot = 2
183  CALL chetri2( 'U', -1, a, 1, ip, w, 1, info )
184  CALL chkxer( 'CHETRI2', infot, nout, lerr, ok )
185  infot = 4
186  CALL chetri2( 'U', 2, a, 1, ip, w, 1, info )
187  CALL chkxer( 'CHETRI2', infot, nout, lerr, ok )
188 *
189 * CHETRS
190 *
191  srnamt = 'CHETRS'
192  infot = 1
193  CALL chetrs( '/', 0, 0, a, 1, ip, b, 1, info )
194  CALL chkxer( 'CHETRS', infot, nout, lerr, ok )
195  infot = 2
196  CALL chetrs( 'U', -1, 0, a, 1, ip, b, 1, info )
197  CALL chkxer( 'CHETRS', infot, nout, lerr, ok )
198  infot = 3
199  CALL chetrs( 'U', 0, -1, a, 1, ip, b, 1, info )
200  CALL chkxer( 'CHETRS', infot, nout, lerr, ok )
201  infot = 5
202  CALL chetrs( 'U', 2, 1, a, 1, ip, b, 2, info )
203  CALL chkxer( 'CHETRS', infot, nout, lerr, ok )
204  infot = 8
205  CALL chetrs( 'U', 2, 1, a, 2, ip, b, 1, info )
206  CALL chkxer( 'CHETRS', infot, nout, lerr, ok )
207 *
208 * CHERFS
209 *
210  srnamt = 'CHERFS'
211  infot = 1
212  CALL cherfs( '/', 0, 0, a, 1, af, 1, ip, b, 1, x, 1, r1, r2, w,
213  $ r, info )
214  CALL chkxer( 'CHERFS', infot, nout, lerr, ok )
215  infot = 2
216  CALL cherfs( 'U', -1, 0, a, 1, af, 1, ip, b, 1, x, 1, r1, r2,
217  $ w, r, info )
218  CALL chkxer( 'CHERFS', infot, nout, lerr, ok )
219  infot = 3
220  CALL cherfs( 'U', 0, -1, a, 1, af, 1, ip, b, 1, x, 1, r1, r2,
221  $ w, r, info )
222  CALL chkxer( 'CHERFS', infot, nout, lerr, ok )
223  infot = 5
224  CALL cherfs( 'U', 2, 1, a, 1, af, 2, ip, b, 2, x, 2, r1, r2, w,
225  $ r, info )
226  CALL chkxer( 'CHERFS', infot, nout, lerr, ok )
227  infot = 7
228  CALL cherfs( 'U', 2, 1, a, 2, af, 1, ip, b, 2, x, 2, r1, r2, w,
229  $ r, info )
230  CALL chkxer( 'CHERFS', infot, nout, lerr, ok )
231  infot = 10
232  CALL cherfs( 'U', 2, 1, a, 2, af, 2, ip, b, 1, x, 2, r1, r2, w,
233  $ r, info )
234  CALL chkxer( 'CHERFS', infot, nout, lerr, ok )
235  infot = 12
236  CALL cherfs( 'U', 2, 1, a, 2, af, 2, ip, b, 2, x, 1, r1, r2, w,
237  $ r, info )
238  CALL chkxer( 'CHERFS', infot, nout, lerr, ok )
239 *
240 * CHECON
241 *
242  srnamt = 'CHECON'
243  infot = 1
244  CALL checon( '/', 0, a, 1, ip, anrm, rcond, w, info )
245  CALL chkxer( 'CHECON', infot, nout, lerr, ok )
246  infot = 2
247  CALL checon( 'U', -1, a, 1, ip, anrm, rcond, w, info )
248  CALL chkxer( 'CHECON', infot, nout, lerr, ok )
249  infot = 4
250  CALL checon( 'U', 2, a, 1, ip, anrm, rcond, w, info )
251  CALL chkxer( 'CHECON', infot, nout, lerr, ok )
252  infot = 6
253  CALL checon( 'U', 1, a, 1, ip, -anrm, rcond, w, info )
254  CALL chkxer( 'CHECON', infot, nout, lerr, ok )
255 *
256 * Test error exits of the routines that use factorization
257 * of a Hermitian indefinite matrix with "rook"
258 * (bounded Bunch-Kaufman) diagonal pivoting method.
259 *
260  ELSE IF( lsamen( 2, c2, 'HR' ) ) THEN
261 *
262 * CHETRF_ROOK
263 *
264  srnamt = 'CHETRF_ROOK'
265  infot = 1
266  CALL chetrf_rook( '/', 0, a, 1, ip, w, 1, info )
267  CALL chkxer( 'CHETRF_ROOK', infot, nout, lerr, ok )
268  infot = 2
269  CALL chetrf_rook( 'U', -1, a, 1, ip, w, 1, info )
270  CALL chkxer( 'CHETRF_ROOK', infot, nout, lerr, ok )
271  infot = 4
272  CALL chetrf_rook( 'U', 2, a, 1, ip, w, 4, info )
273  CALL chkxer( 'CHETRF_ROOK', infot, nout, lerr, ok )
274 *
275 * CHETF2_ROOK
276 *
277  srnamt = 'CHETF2_ROOK'
278  infot = 1
279  CALL chetf2_rook( '/', 0, a, 1, ip, info )
280  CALL chkxer( 'CHETF2_ROOK', infot, nout, lerr, ok )
281  infot = 2
282  CALL chetf2_rook( 'U', -1, a, 1, ip, info )
283  CALL chkxer( 'CHETF2_ROOK', infot, nout, lerr, ok )
284  infot = 4
285  CALL chetf2_rook( 'U', 2, a, 1, ip, info )
286  CALL chkxer( 'CHETF2_ROOK', infot, nout, lerr, ok )
287 *
288 * CHETRI_ROOK
289 *
290  srnamt = 'CHETRI_ROOK'
291  infot = 1
292  CALL chetri_rook( '/', 0, a, 1, ip, w, info )
293  CALL chkxer( 'CHETRI_ROOK', infot, nout, lerr, ok )
294  infot = 2
295  CALL chetri_rook( 'U', -1, a, 1, ip, w, info )
296  CALL chkxer( 'CHETRI_ROOK', infot, nout, lerr, ok )
297  infot = 4
298  CALL chetri_rook( 'U', 2, a, 1, ip, w, info )
299  CALL chkxer( 'CHETRI_ROOK', infot, nout, lerr, ok )
300 *
301 * CHETRS_ROOK
302 *
303  srnamt = 'CHETRS_ROOK'
304  infot = 1
305  CALL chetrs_rook( '/', 0, 0, a, 1, ip, b, 1, info )
306  CALL chkxer( 'CHETRS_ROOK', infot, nout, lerr, ok )
307  infot = 2
308  CALL chetrs_rook( 'U', -1, 0, a, 1, ip, b, 1, info )
309  CALL chkxer( 'CHETRS_ROOK', infot, nout, lerr, ok )
310  infot = 3
311  CALL chetrs_rook( 'U', 0, -1, a, 1, ip, b, 1, info )
312  CALL chkxer( 'CHETRS_ROOK', infot, nout, lerr, ok )
313  infot = 5
314  CALL chetrs_rook( 'U', 2, 1, a, 1, ip, b, 2, info )
315  CALL chkxer( 'CHETRS_ROOK', infot, nout, lerr, ok )
316  infot = 8
317  CALL chetrs_rook( 'U', 2, 1, a, 2, ip, b, 1, info )
318  CALL chkxer( 'CHETRS_ROOK', infot, nout, lerr, ok )
319 *
320 * CHECON_ROOK
321 *
322  srnamt = 'CHECON_ROOK'
323  infot = 1
324  CALL checon_rook( '/', 0, a, 1, ip, anrm, rcond, w, info )
325  CALL chkxer( 'CHECON_ROOK', infot, nout, lerr, ok )
326  infot = 2
327  CALL checon_rook( 'U', -1, a, 1, ip, anrm, rcond, w, info )
328  CALL chkxer( 'CHECON_ROOK', infot, nout, lerr, ok )
329  infot = 4
330  CALL checon_rook( 'U', 2, a, 1, ip, anrm, rcond, w, info )
331  CALL chkxer( 'CHECON_ROOK', infot, nout, lerr, ok )
332  infot = 6
333  CALL checon_rook( 'U', 1, a, 1, ip, -anrm, rcond, w, info )
334  CALL chkxer( 'CHECON_ROOK', infot, nout, lerr, ok )
335 *
336 * Test error exits of the routines that use factorization
337 * of a Hermitian indefinite packed matrix with patrial
338 * (Bunch-Kaufman) diagonal pivoting method.
339 *
340  ELSE IF( lsamen( 2, c2, 'HP' ) ) THEN
341 *
342 * CHPTRF
343 *
344  srnamt = 'CHPTRF'
345  infot = 1
346  CALL chptrf( '/', 0, a, ip, info )
347  CALL chkxer( 'CHPTRF', infot, nout, lerr, ok )
348  infot = 2
349  CALL chptrf( 'U', -1, a, ip, info )
350  CALL chkxer( 'CHPTRF', infot, nout, lerr, ok )
351 *
352 * CHPTRI
353 *
354  srnamt = 'CHPTRI'
355  infot = 1
356  CALL chptri( '/', 0, a, ip, w, info )
357  CALL chkxer( 'CHPTRI', infot, nout, lerr, ok )
358  infot = 2
359  CALL chptri( 'U', -1, a, ip, w, info )
360  CALL chkxer( 'CHPTRI', infot, nout, lerr, ok )
361 *
362 * CHPTRS
363 *
364  srnamt = 'CHPTRS'
365  infot = 1
366  CALL chptrs( '/', 0, 0, a, ip, b, 1, info )
367  CALL chkxer( 'CHPTRS', infot, nout, lerr, ok )
368  infot = 2
369  CALL chptrs( 'U', -1, 0, a, ip, b, 1, info )
370  CALL chkxer( 'CHPTRS', infot, nout, lerr, ok )
371  infot = 3
372  CALL chptrs( 'U', 0, -1, a, ip, b, 1, info )
373  CALL chkxer( 'CHPTRS', infot, nout, lerr, ok )
374  infot = 7
375  CALL chptrs( 'U', 2, 1, a, ip, b, 1, info )
376  CALL chkxer( 'CHPTRS', infot, nout, lerr, ok )
377 *
378 * CHPRFS
379 *
380  srnamt = 'CHPRFS'
381  infot = 1
382  CALL chprfs( '/', 0, 0, a, af, ip, b, 1, x, 1, r1, r2, w, r,
383  $ info )
384  CALL chkxer( 'CHPRFS', infot, nout, lerr, ok )
385  infot = 2
386  CALL chprfs( 'U', -1, 0, a, af, ip, b, 1, x, 1, r1, r2, w, r,
387  $ info )
388  CALL chkxer( 'CHPRFS', infot, nout, lerr, ok )
389  infot = 3
390  CALL chprfs( 'U', 0, -1, a, af, ip, b, 1, x, 1, r1, r2, w, r,
391  $ info )
392  CALL chkxer( 'CHPRFS', infot, nout, lerr, ok )
393  infot = 8
394  CALL chprfs( 'U', 2, 1, a, af, ip, b, 1, x, 2, r1, r2, w, r,
395  $ info )
396  CALL chkxer( 'CHPRFS', infot, nout, lerr, ok )
397  infot = 10
398  CALL chprfs( 'U', 2, 1, a, af, ip, b, 2, x, 1, r1, r2, w, r,
399  $ info )
400  CALL chkxer( 'CHPRFS', infot, nout, lerr, ok )
401 *
402 * CHPCON
403 *
404  srnamt = 'CHPCON'
405  infot = 1
406  CALL chpcon( '/', 0, a, ip, anrm, rcond, w, info )
407  CALL chkxer( 'CHPCON', infot, nout, lerr, ok )
408  infot = 2
409  CALL chpcon( 'U', -1, a, ip, anrm, rcond, w, info )
410  CALL chkxer( 'CHPCON', infot, nout, lerr, ok )
411  infot = 5
412  CALL chpcon( 'U', 1, a, ip, -anrm, rcond, w, info )
413  CALL chkxer( 'CHPCON', infot, nout, lerr, ok )
414  END IF
415 *
416 * Print a summary line.
417 *
418  CALL alaesm( path, ok, nout )
419 *
420  RETURN
421 *
422 * End of CERRHE
423 *
424  END
subroutine chetrs_rook(UPLO, N, NRHS, A, LDA, IPIV, B, LDB, INFO)
CHETRS_ROOK computes the solution to a system of linear equations A * X = B for HE matrices using fac...
Definition: chetrs_rook.f:138
subroutine checon_rook(UPLO, N, A, LDA, IPIV, ANORM, RCOND, WORK, INFO)
CHECON_ROOK estimates the reciprocal of the condition number fort HE matrices using factorization obt...
Definition: checon_rook.f:141
subroutine chetrf_rook(UPLO, N, A, LDA, IPIV, WORK, LWORK, INFO)
CHETRF_ROOK computes the factorization of a complex Hermitian indefinite matrix using the bounded Bun...
Definition: chetrf_rook.f:214
subroutine chetf2_rook(UPLO, N, A, LDA, IPIV, INFO)
CHETF2_ROOK computes the factorization of a complex Hermitian indefinite matrix using the bounded Bun...
Definition: chetf2_rook.f:196
subroutine chprfs(UPLO, N, NRHS, AP, AFP, IPIV, B, LDB, X, LDX, FERR, BERR, WORK, RWORK, INFO)
CHPRFS
Definition: chprfs.f:182
subroutine alaesm(PATH, OK, NOUT)
ALAESM
Definition: alaesm.f:65
subroutine chptri(UPLO, N, AP, IPIV, WORK, INFO)
CHPTRI
Definition: chptri.f:111
subroutine chptrs(UPLO, N, NRHS, AP, IPIV, B, LDB, INFO)
CHPTRS
Definition: chptrs.f:117
subroutine chetf2(UPLO, N, A, LDA, IPIV, INFO)
CHETF2 computes the factorization of a complex Hermitian matrix, using the diagonal pivoting method (...
Definition: chetf2.f:188
subroutine chkxer(SRNAMT, INFOT, NOUT, LERR, OK)
Definition: cblat2.f:3199
subroutine chetri_rook(UPLO, N, A, LDA, IPIV, WORK, INFO)
CHETRI_ROOK computes the inverse of HE matrix using the factorization obtained with the bounded Bunch...
Definition: chetri_rook.f:130
subroutine chptrf(UPLO, N, AP, IPIV, INFO)
CHPTRF
Definition: chptrf.f:161
subroutine cerrhe(PATH, NUNIT)
CERRHE
Definition: cerrhe.f:57
subroutine chetrs(UPLO, N, NRHS, A, LDA, IPIV, B, LDB, INFO)
CHETRS
Definition: chetrs.f:122
subroutine chetrf(UPLO, N, A, LDA, IPIV, WORK, LWORK, INFO)
CHETRF
Definition: chetrf.f:179
subroutine chetri(UPLO, N, A, LDA, IPIV, WORK, INFO)
CHETRI
Definition: chetri.f:116
subroutine checon(UPLO, N, A, LDA, IPIV, ANORM, RCOND, WORK, INFO)
CHECON
Definition: checon.f:127
subroutine chetri2(UPLO, N, A, LDA, IPIV, WORK, LWORK, INFO)
CHETRI2
Definition: chetri2.f:129
subroutine chpcon(UPLO, N, AP, IPIV, ANORM, RCOND, WORK, INFO)
CHPCON
Definition: chpcon.f:120
subroutine cherfs(UPLO, N, NRHS, A, LDA, AF, LDAF, IPIV, B, LDB, X, LDX, FERR, BERR, WORK, RWORK, INFO)
CHERFS
Definition: cherfs.f:194