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
serrge.f
Go to the documentation of this file.
1  SUBROUTINE serrge( 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 * SERRGE tests the error exits for the REAL 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  REAL anrm, ccond, rcond
39 * ..
40 * .. Local Arrays ..
41  INTEGER ip( nmax ), iw( nmax )
42  INTEGER hl( 2 ), hpiv( 2 )
43  REAL 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, sgbcon, sgbequ, sgbrfs, sgbtf2,
52  $ sgbtrf, sgbtrs, sgecon, sgeequ, sgerfs, sgetf2,
53  $ sgetrf, sgetri, sgetrs
54 * ..
55 * .. Scalars in Common ..
56  LOGICAL lerr, ok
57  CHARACTER*32 srnamt
58  INTEGER infot, nout
59 * ..
60 * .. Common blocks ..
61  common / infoc / infot, nout, ok, lerr
62  common / srnamc / srnamt
63 * ..
64 * .. Intrinsic Functions ..
65  INTRINSIC real
66 * ..
67 * .. Executable Statements ..
68 *
69  nout = nunit
70  WRITE( nout, fmt = * )
71  c2 = path( 2: 3 )
72 *
73 * Disable PLASMA warnings/errors
74 *
75  CALL plasma_disable( plasma_warnings, info )
76  CALL plasma_disable( plasma_errors, info )
77 *
78 * Set the variables to innocuous values.
79 *
80  DO 20 j = 1, nmax
81  DO 10 i = 1, nmax
82  a( i, j ) = 1. / REAL( i+j )
83  af( i, j ) = 1. / REAL( i+j )
84  10 continue
85  b( j ) = 0.
86  r1( j ) = 0.
87  r2( j ) = 0.
88  w( j ) = 0.
89  x( j ) = 0.
90  ip( j ) = j
91  iw( j ) = j
92  20 continue
93  ok = .true.
94 *
95  IF( lsamen( 2, c2, 'GE' ) ) THEN
96 *
97 * ALLOCATE L and IPIV
98 *
100  $ 2, 1, hl, hpiv, info )
101 *
102 * Test error exits of the routines that use the LU decomposition
103 * of a general matrix.
104 *
105 * SGETRF
106 *
107  srnamt = 'SGETRF'
108  infot = 1
109  CALL plasma_sgetrf_incpiv( -1, 0, a, 1, hl, hpiv, info )
110  CALL chkxer( 'SGETRF', infot, nout, info, ok )
111  infot = 2
112  CALL plasma_sgetrf_incpiv( 0, -1, a, 1, hl, hpiv, info )
113  CALL chkxer( 'SGETRF', infot, nout, info, ok )
114  infot = 4
115  CALL plasma_sgetrf_incpiv( 2, 1, a, 1, hl, hpiv, info )
116  CALL chkxer( 'SGETRF', infot, nout, info, ok )
117 *
118 * SGETRS
119 *
120  srnamt = 'SGETRS'
121  infot = 103
122  CALL plasma_sgetrs_incpiv( '/', -1, 0, a, 1, hl, hpiv,
123  $ b, 1, info )
124  CALL chkxer( 'SGETRS', infot, nout, info, ok )
125  infot = 2
126  CALL plasma_sgetrs_incpiv( plasmanotrans, -1, 0, a, 1, hl,
127  $ hpiv, b, 1, info )
128  CALL chkxer( 'SGETRS', infot, nout, info, ok )
129  infot = 3
130  CALL plasma_sgetrs_incpiv( plasmanotrans, 0, -1, a, 1, hl,
131  $ hpiv, b, 1, info )
132  CALL chkxer( 'SGETRS', infot, nout, info, ok )
133  infot = 5
134  CALL plasma_sgetrs_incpiv( plasmanotrans, 2, 1, a, 1, hl,
135  $ hpiv, b, 2, info )
136  CALL chkxer( 'SGETRS', infot, nout, info, ok )
137  infot = 9
138  CALL plasma_sgetrs_incpiv( plasmanotrans, 2, 1, a, 2, hl,
139  $ hpiv, b, 1, info )
140  CALL chkxer( 'SGETRS', 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 * SGETRF
149 *
150  srnamt = 'SGETRF'
151  infot = 1
152  CALL plasma_sgetrf( -1, 0, a, 1, ip, info )
153  CALL chkxer( 'SGETRF', infot, nout, info, ok )
154  infot = 2
155  CALL plasma_sgetrf( 0, -1, a, 1, ip, info )
156  CALL chkxer( 'SGETRF', infot, nout, info, ok )
157  infot = 4
158  CALL plasma_sgetrf( 2, 1, a, 1, ip, info )
159  CALL chkxer( 'SGETRF', infot, nout, info, ok )
160 *
161 * SGETRS
162 *
163  srnamt = 'SGETRS'
164  infot = 1
165  CALL plasma_sgetrs( '/', 0, 0, a, 1, ip, b, 1, info )
166  CALL chkxer( 'SGETRS', infot, nout, info, ok )
167  infot = 2
168  CALL plasma_sgetrs( plasmanotrans, -1, 0, a, 1, ip,
169  $ b, 1, info )
170  CALL chkxer( 'SGETRS', infot, nout, info, ok )
171  infot = 3
172  CALL plasma_sgetrs( plasmanotrans, 0, -1, a, 1, ip,
173  $ b, 1, info )
174  CALL chkxer( 'SGETRS', infot, nout, info, ok )
175  infot = 5
176  CALL plasma_sgetrs( plasmanotrans, 2, 1, a, 1, ip,
177  $ b, 2, info )
178  CALL chkxer( 'SGETRS', infot, nout, info, ok )
179  infot = 8
180  CALL plasma_sgetrs( plasmanotrans, 2, 1, a, 2, ip,
181  $ b, 1, info )
182  CALL chkxer( 'SGETRS', infot, nout, info, ok )
183 
184  ENDIF
185 *
186 * Print a summary line.
187 *
188  CALL alaesm( path, ok, nout )
189 *
190 * Enable PLASMA warnings/errors
191 *
192  CALL plasma_enable( plasma_warnings, info )
193  CALL plasma_enable( plasma_errors, info )
194 *
195  return
196 *
197 * End of SERRGE
198 *
199  END