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
derrge.f
Go to the documentation of this file.
1  SUBROUTINE derrge( 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 * DERRGE tests the error exits for the DOUBLE PRECISION 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, lw
33  parameter( nmax = 4, lw = 3*nmax )
34 * ..
35 * .. Local Scalars ..
36  CHARACTER*2 c2
37  INTEGER i, info, j
38  DOUBLE PRECISION anrm, ccond, rcond
39 * ..
40 * .. Local Arrays ..
41  INTEGER ip( nmax ), iw( nmax )
42  INTEGER hl( 2 ), hpiv( 2 )
43  DOUBLE PRECISION a( nmax, nmax ), af( nmax, nmax ), b( nmax ),
44  $ r1( nmax ), r2( nmax ), w( lw ), x( nmax )
45 * ..
46 * .. External Functions ..
47  LOGICAL lsamen
48  EXTERNAL lsamen
49 * ..
50 * .. External Subroutines ..
51  EXTERNAL alaesm, chkxer,
52  $ dgetrf, dgetrs
53 * ..
54 * .. Scalars in Common ..
55  LOGICAL lerr, ok
56  CHARACTER*32 srnamt
57  INTEGER infot, nout
58 * ..
59 * .. Common blocks ..
60  common / infoc / infot, nout, ok, lerr
61  common / srnamc / srnamt
62 * ..
63 * .. Intrinsic Functions ..
64  INTRINSIC dble
65 * ..
66 * .. Executable Statements ..
67 *
68  nout = nunit
69  WRITE( nout, fmt = * )
70  c2 = path( 2: 3 )
71 *
72 * Disable PLASMA warnings/errors
73 *
74  CALL plasma_disable( plasma_warnings, info )
75  CALL plasma_disable( plasma_errors, info )
76 *
77 * Set the variables to innocuous values.
78 *
79  DO 20 j = 1, nmax
80  DO 10 i = 1, nmax
81  a( i, j ) = 1.d0 / dble( i+j )
82  af( i, j ) = 1.d0 / dble( i+j )
83  10 continue
84  b( j ) = 0.d0
85  r1( j ) = 0.d0
86  r2( j ) = 0.d0
87  w( j ) = 0.d0
88  x( j ) = 0.d0
89  ip( j ) = j
90  iw( j ) = j
91  20 continue
92  ok = .true.
93 *
94  IF( lsamen( 2, c2, 'GE' ) ) THEN
95 *
96 * ALLOCATE L and IPIV
97 *
99  $ 2, 1, hl, hpiv, info )
100 *
101 *
102 * Test error exits of the routines that use the LU decomposition
103 * of a general matrix.
104 *
105 * DGETRF
106 *
107  srnamt = 'DGETRF'
108  infot = 1
109  CALL plasma_dgetrf_incpiv( -1, 0, a, 1, hl, hpiv, info )
110  CALL chkxer( 'DGETRF', infot, nout, info, ok )
111  infot = 2
112  CALL plasma_dgetrf_incpiv( 0, -1, a, 1, hl, hpiv, info )
113  CALL chkxer( 'DGETRF', infot, nout, info, ok )
114  infot = 4
115  CALL plasma_dgetrf_incpiv( 2, 1, a, 1, hl, hpiv, info )
116  CALL chkxer( 'DGETRF', infot, nout, info, ok )
117 *
118 * DGETRS
119 *
120  srnamt = 'DGETRS'
121  infot = 103
122  CALL plasma_dgetrs_incpiv( '/', -1, 0, a, 1, hl, hpiv,
123  $ b, 1, info )
124  CALL chkxer( 'DGETRS', infot, nout, info, ok )
125  infot = 2
126  CALL plasma_dgetrs_incpiv( plasmanotrans, -1, 0, a, 1, hl,
127  $ hpiv, b, 1, info )
128  CALL chkxer( 'DGETRS', infot, nout, info, ok )
129  infot = 3
130  CALL plasma_dgetrs_incpiv( plasmanotrans, 0, -1, a, 1, hl,
131  $ hpiv, b, 1, info )
132  CALL chkxer( 'DGETRS', infot, nout, info, ok )
133  infot = 5
134  CALL plasma_dgetrs_incpiv( plasmanotrans, 2, 1, a, 1, hl,
135  $ hpiv, b, 2, info )
136  CALL chkxer( 'DGETRS', infot, nout, info, ok )
137  infot = 9
138  CALL plasma_dgetrs_incpiv( plasmanotrans, 2, 1, a, 2, hl,
139  $ hpiv, b, 1, info )
140  CALL chkxer( 'DGETRS', 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 * DGETRF
149 *
150  srnamt = 'DGETRF'
151  infot = 1
152  CALL plasma_dgetrf( -1, 0, a, 1, ip, info )
153  CALL chkxer( 'DGETRF', infot, nout, info, ok )
154  infot = 2
155  CALL plasma_dgetrf( 0, -1, a, 1, ip, info )
156  CALL chkxer( 'DGETRF', infot, nout, info, ok )
157  infot = 4
158  CALL plasma_dgetrf( 2, 1, a, 1, ip, info )
159  CALL chkxer( 'DGETRF', infot, nout, info, ok )
160 *
161 * DGETRS
162 *
163  srnamt = 'DGETRS'
164  infot = 1
165  CALL plasma_dgetrs( '/', 0, 0, a, 1, ip,
166  $ b, 1, info )
167  CALL chkxer( 'DGETRS', infot, nout, info, ok )
168  infot = 2
169  CALL plasma_dgetrs( plasmanotrans, -1, 0, a, 1, ip,
170  $ b, 1, info )
171  CALL chkxer( 'DGETRS', infot, nout, info, ok )
172  infot = 3
173  CALL plasma_dgetrs( plasmanotrans, 0, -1, a, 1, ip,
174  $ b, 1, info )
175  CALL chkxer( 'DGETRS', infot, nout, info, ok )
176  infot = 5
177  CALL plasma_dgetrs( plasmanotrans, 2, 1, a, 1, ip,
178  $ b, 2, info )
179  CALL chkxer( 'DGETRS', infot, nout, info, ok )
180  infot = 8
181  CALL plasma_dgetrs( plasmanotrans, 2, 1, a, 2, ip,
182  $ b, 1, info )
183  CALL chkxer( 'DGETRS', 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 DERRGE
199 *
200  END