PLASMA  2.4.5
PLASMA - Parallel Linear Algebra for Scalable Multi-core Architectures
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
cerrge.f
Go to the documentation of this file.
1  SUBROUTINE cerrge( PATH, NUNIT )
2 *
3  include 'plasmaf.h'
4 *
5 * -- LAPACK test routine (version 3.1) --
6 * Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd..
7 * November 2006
8 *
9 * .. Scalar Arguments ..
10  CHARACTER*3 path
11  INTEGER nunit
12 * ..
13 *
14 * Purpose
15 * =======
16 *
17 * CERRGE tests the error exits for the COMPLEX routines
18 * for general matrices.
19 *
20 * Arguments
21 * =========
22 *
23 * PATH (input) CHARACTER*3
24 * The LAPACK path name for the routines to be tested.
25 *
26 * NUNIT (input) INTEGER
27 * The unit number for output.
28 *
29 * =====================================================================
30 *
31 * .. Parameters ..
32  INTEGER nmax
33  parameter( nmax = 4 )
34 * ..
35 * .. Local Scalars ..
36  CHARACTER*2 c2
37  INTEGER i, info, j
38  REAL anrm, ccond, rcond
39 * ..
40 * .. Local Arrays ..
41  INTEGER ip( nmax )
42  INTEGER hl( 2 ), hpiv( 2 )
43  REAL r( nmax ), r1( nmax ), r2( nmax )
44  COMPLEX a( nmax, nmax ), af( nmax, nmax ), b( nmax ),
45  $ w( 2*nmax ), x( nmax )
46 * ..
47 * .. External Functions ..
48  LOGICAL lsamen
49  EXTERNAL lsamen
50 * ..
51 * .. External Subroutines ..
52  EXTERNAL alaesm, cgbcon, cgbequ, cgbrfs, cgbtf2, cgbtrf,
53  $ cgbtrs, cgecon, cgeequ, cgerfs, cgetf2, cgetrf,
54  $ cgetri, cgetrs, chkxer
55 * ..
56 * .. Scalars in Common ..
57  LOGICAL lerr, ok
58  CHARACTER*32 srnamt
59  INTEGER infot, nout
60 * ..
61 * .. Common blocks ..
62  common / infoc / infot, nout, ok, lerr
63  common / srnamc / srnamt
64 * ..
65 * .. Intrinsic Functions ..
66  INTRINSIC cmplx, real
67 * ..
68 * .. Executable Statements ..
69 *
70  nout = nunit
71  WRITE( nout, fmt = * )
72  c2 = path( 2: 3 )
73 *
74 * Disable PLASMA warnings/errors
75 *
76  CALL plasma_disable( plasma_warnings, info )
77  CALL plasma_disable( plasma_errors, info )
78 *
79 * Set the variables to innocuous values.
80 *
81  DO 20 j = 1, nmax
82  DO 10 i = 1, nmax
83  a( i, j ) = cmplx( 1. / REAL( I+J ), -1. / REAL( I+J ) )
84  af( i, j ) = cmplx( 1. / REAL( I+J ), -1. / REAL( I+J ) )
85  10 continue
86  b( j ) = 0.
87  r1( j ) = 0.
88  r2( j ) = 0.
89  w( j ) = 0.
90  x( j ) = 0.
91  ip( j ) = j
92  20 continue
93  ok = .true.
94 *
95 * Test error exits of the routines that use the LU decomposition
96 * of a general matrix.
97 *
98  IF( lsamen( 2, c2, 'GE' ) ) THEN
99 *
100 * ALLOCATE L and IPIV
101 *
103  $ 2, 1, hl, hpiv, info )
104 *
105 * CGETRF
106 *
107  srnamt = 'CGETRF'
108  infot = 1
109  CALL plasma_cgetrf_incpiv( -1, 0, a, 1, hl, hpiv, info )
110  CALL chkxer( 'CGETRF', infot, nout, info, ok )
111  infot = 2
112  CALL plasma_cgetrf_incpiv( 0, -1, a, 1, hl, hpiv, info )
113  CALL chkxer( 'CGETRF', infot, nout, info, ok )
114  infot = 4
115  CALL plasma_cgetrf_incpiv( 2, 1, a, 1, hl, hpiv, info )
116  CALL chkxer( 'CGETRF', infot, nout, info, ok )
117 *
118 * CGETRS
119 *
120  srnamt = 'CGETRS'
121  infot = 103
122  CALL plasma_cgetrs_incpiv( '/', -1, 0, a, 1, hl, hpiv,
123  $ b, 1, info )
124  CALL chkxer( 'CGETRS', infot, nout, info, ok )
125  infot = 2
126  CALL plasma_cgetrs_incpiv( plasmanotrans, -1, 0, a, 1, hl,
127  $ hpiv, b, 1, info )
128  CALL chkxer( 'CGETRS', infot, nout, info, ok )
129  infot = 3
130  CALL plasma_cgetrs_incpiv( plasmanotrans, 0, -1, a, 1, hl,
131  $ hpiv, b, 1, info )
132  CALL chkxer( 'CGETRS', infot, nout, info, ok )
133  infot = 5
134  CALL plasma_cgetrs_incpiv( plasmanotrans, 2, 1, a, 1, hl,
135  $ hpiv, b, 2, info )
136  CALL chkxer( 'CGETRS', infot, nout, info, ok )
137  infot = 9
138  CALL plasma_cgetrs_incpiv( plasmanotrans, 2, 1, a, 2, hl,
139  $ hpiv, b, 1, info )
140  CALL chkxer( 'CGETRS', infot, nout, info, ok )
141 *
142 * DEALLOCATE L and IPIV
143 *
144  CALL plasma_dealloc_handle( hl, info )
145  CALL plasma_dealloc_handle( hpiv, info )
146 *
147 * LAPACK Interface
148 * CGETRF
149 *
150  srnamt = 'CGETRF'
151  infot = 1
152  CALL plasma_cgetrf( -1, 0, a, 1, ip, info )
153  CALL chkxer( 'CGETRF', infot, nout, info, ok )
154  infot = 2
155  CALL plasma_cgetrf( 0, -1, a, 1, ip, info )
156  CALL chkxer( 'CGETRF', infot, nout, info, ok )
157  infot = 4
158  CALL plasma_cgetrf( 2, 1, a, 1, ip, info )
159  CALL chkxer( 'CGETRF', infot, nout, info, ok )
160 *
161 * CGETRS
162 *
163  srnamt = 'CGETRS'
164  infot = 1
165  CALL plasma_cgetrs( '/', 0, 0, a, 1, ip,
166  $ b, 1, info )
167  CALL chkxer( 'CGETRS', infot, nout, info, ok )
168  infot = 2
169  CALL plasma_cgetrs( plasmanotrans, -1, 0, a, 1, ip,
170  $ b, 1, info )
171  CALL chkxer( 'CGETRS', infot, nout, info, ok )
172  infot = 3
173  CALL plasma_cgetrs( plasmanotrans, 0, -1, a, 1, ip,
174  $ b, 1, info )
175  CALL chkxer( 'CGETRS', infot, nout, info, ok )
176  infot = 5
177  CALL plasma_cgetrs( plasmanotrans, 2, 1, a, 1, ip,
178  $ b, 2, info )
179  CALL chkxer( 'CGETRS', infot, nout, info, ok )
180  infot = 8
181  CALL plasma_cgetrs( plasmanotrans, 2, 1, a, 2, ip,
182  $ b, 1, info )
183  CALL chkxer( 'CGETRS', infot, nout, info, ok )
184 *
185  ENDIF
186 *
187 * Print a summary line.
188 *
189  CALL alaesm( path, ok, nout )
190 *
191 * Enable PLASMA warnings/errors
192 *
193  CALL plasma_enable( plasma_warnings, info )
194  CALL plasma_enable( plasma_errors, info )
195 *
196  return
197 *
198 * End of CERRGE
199 *
200  END