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
serrqr.f
Go to the documentation of this file.
1  SUBROUTINE serrqr( 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 * SERRQR tests the error exits for the REAL routines
18 * that use the QR decomposition of a general matrix.
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 = 2 )
34 * ..
35 * .. Local Scalars ..
36  INTEGER i, info, j
37 * ..
38 * .. Local Arrays ..
39  REAL a( nmax, nmax ), af( nmax, nmax ), b( nmax ),
40  $ w( nmax ), x( nmax )
41  INTEGER ht( 2 )
42 * ..
43 * .. External Subroutines ..
44  EXTERNAL alaesm, chkxer, sgeqr2, sgeqrf, sorg2r,
45  $ sorgqr, sorm2r, sormqr
46 * ..
47 * .. Scalars in Common ..
48  LOGICAL lerr, ok
49  CHARACTER*32 srnamt
50  INTEGER infot, nout
51 * ..
52 * .. Common blocks ..
53  common / infoc / infot, nout, ok, lerr
54  common / srnamc / srnamt
55 * ..
56 * .. Intrinsic Functions ..
57  INTRINSIC real
58 * ..
59 * .. Executable Statements ..
60 *
61  nout = nunit
62  WRITE( nout, fmt = * )
63 *
64 * Disable PLASMA warnings/errors
65 *
66  CALL plasma_disable( plasma_warnings, info )
67  CALL plasma_disable( plasma_errors, info )
68 *
69 * Set the variables to innocuous values.
70 *
71  DO 20 j = 1, nmax
72  DO 10 i = 1, nmax
73  a( i, j ) = 1. / REAL( i+j )
74  af( i, j ) = 1. / REAL( i+j )
75  10 continue
76  b( j ) = 0.
77  w( j ) = 0.
78  x( j ) = 0.
79  20 continue
80  ok = .true.
81 *
82 * Allocate HT
83 *
84  CALL plasma_alloc_workspace_sgeqrf( 2, 2, ht, info )
85 
86 *
87 * Error exits for QR factorization
88 *
89 * SGEQRF
90 *
91  srnamt = 'SGEQRF'
92  infot = 1
93  CALL plasma_sgeqrf( -1, 0, a, 1, ht, info )
94  CALL chkxer( 'SGEQRF', infot, nout, info, ok )
95  infot = 2
96  CALL plasma_sgeqrf( 0, -1, a, 1, ht, info )
97  CALL chkxer( 'SGEQRF', infot, nout, info, ok )
98  infot = 4
99  CALL plasma_sgeqrf( 2, 1, a, 1, ht, info )
100  CALL chkxer( 'SGEQRF', infot, nout, info, ok )
101 *
102 * SGEQRS
103 *
104 *
105  srnamt = 'SGEQRS'
106  infot = 1
107  CALL plasma_sgeqrs( -1, 0, 0, a, 1, x, b, 1, info )
108  CALL chkxer( 'SGEQRS', infot, nout, info, ok )
109  infot = 2
110  CALL plasma_sgeqrs( 0, -1, 0, a, 1, x, b, 1, info )
111  CALL chkxer( 'SGEQRS', infot, nout, info, ok )
112  infot = 2
113  CALL plasma_sgeqrs( 1, 2, 0, a, 2, x, b, 2, info )
114  CALL chkxer( 'SGEQRS', infot, nout, info, ok )
115  infot = 3
116  CALL plasma_sgeqrs( 0, 0, -1, a, 1, x, b, 1, info )
117  CALL chkxer( 'SGEQRS', infot, nout, info, ok )
118  infot = 5
119  CALL plasma_sgeqrs( 2, 1, 0, a, 1, x, b, 2, info )
120  CALL chkxer( 'SGEQRS', infot, nout, info, ok )
121  infot = 8
122  CALL plasma_sgeqrs( 2, 1, 0, a, 2, x, b, 1, info )
123  CALL chkxer( 'SGEQRS', infot, nout, info, ok )
124 *
125 * SORGQR
126 *
127  srnamt = 'SORGQR'
128  infot = 1
129  CALL plasma_sorgqr( -1, 0, 0, a, 1, ht, w, 1, info )
130  CALL chkxer( 'SORGQR', infot, nout, info, ok )
131  infot = 2
132  CALL plasma_sorgqr( 0, -1, 0, a, 1, ht, w, 1, info )
133  CALL chkxer( 'SORGQR', infot, nout, info, ok )
134  infot = 2
135  CALL plasma_sorgqr( 1, 2, 0, a, 1, ht, w, 2, info )
136  CALL chkxer( 'SORGQR', infot, nout, info, ok )
137  infot = 3
138  CALL plasma_sorgqr( 0, 0, -1, a, 1, ht, w, 1, info )
139  CALL chkxer( 'SORGQR', infot, nout, info, ok )
140  infot = 3
141  CALL plasma_sorgqr( 1, 1, 2, a, 1, ht, w, 1, info )
142  CALL chkxer( 'SORGQR', infot, nout, info, ok )
143  infot = 5
144  CALL plasma_sorgqr( 2, 2, 0, a, 1, ht, w, 2, info )
145  CALL chkxer( 'SORGQR', infot, nout, info, ok )
146  infot = 8
147  CALL plasma_sorgqr( 2, 2, 0, a, 2, ht, w, 1, info )
148  CALL chkxer( 'SORGQR', infot, nout, info, ok )
149 *
150 * PLASMA_SORMQR
151 *
152  srnamt = 'SORMQR'
153  infot = 1
154  CALL plasma_sormqr( '/', plasmatrans, 0, 0, 0, a, 1, ht, af, 1,
155  4 info )
156  CALL chkxer( 'SORMQR', infot, nout, info, ok )
157  infot = 2
158  CALL plasma_sormqr( plasmaleft, '/', 0, 0, 0, a, 1, ht, af, 1,
159  4 info )
160  CALL chkxer( 'SORMQR', infot, nout, info, ok )
161  infot = 3
162  CALL plasma_sormqr( plasmaleft, plasmatrans, -1, 0, 0, a, 1, ht,
163  4 af, 1, info )
164  CALL chkxer( 'SORMQR', infot, nout, info, ok )
165  infot = 4
166  CALL plasma_sormqr( plasmaleft, plasmatrans, 0, -1, 0, a, 1, ht,
167  4 af, 1, info )
168  CALL chkxer( 'SORMQR', infot, nout, info, ok )
169  infot = 5
170  CALL plasma_sormqr( plasmaleft, plasmatrans, 0, 0, -1, a, 1, ht,
171  4 af, 1, info )
172  CALL chkxer( 'SORMQR', infot, nout, info, ok )
173 * INFOT = 5
174 * CALL PLASMA_SORMQR( PLASMALEFT, PLASMATRANS, 0, 1, 1, A, 1, HT,
175 * 4 AF, 1, INFO )
176 * CALL CHKXER( 'SORMQR', INFOT, NOUT, INFO, OK )
177 * INFOT = 5
178 * CALL PLASMA_SORMQR( PLASMALEFT, PLASMATRANS, 1, 0, 1, A, 1, HT,
179 * 4 AF, 1, INFO )
180 * CALL CHKXER( 'SORMQR', INFOT, NOUT, INFO, OK )
181 * INFOT = 7
182 * CALL PLASMA_SORMQR( PLASMALEFT, PLASMATRANS, 2, 1, 0, A, 1, HT,
183 * 4 AF, 2, INFO )
184 * CALL CHKXER( 'SORMQR', INFOT, NOUT, INFO, OK )
185 * INFOT = 7
186 * CALL PLASMA_SORMQR( PLASMALEFT, PLASMATRANS, 1, 2, 0, A, 1, HT,
187 * 4 AF, 1, INFO )
188 * CALL CHKXER( 'SORMQR', INFOT, NOUT, INFO, OK )
189 * INFOT = 10
190 * CALL PLASMA_SORMQR( PLASMALEFT, PLASMATRANS, 1, 2, 0, A, 1, HT,
191 * 4 AF, 1, INFO )
192 * CALL CHKXER( 'SORMQR', INFOT, NOUT, INFO, OK )
193 * INFOT = 10
194 * CALL PLASMA_SORMQR( PLASMALEFT, PLASMATRANS, 2, 1, 0, A, 1, HT,
195 * 4 AF, 2, INFO )
196 * CALL CHKXER( 'SORMQR', INFOT, NOUT, INFO, OK )
197 *
198 * Print a summary line.
199 *
200  CALL alaesm( path, ok, nout )
201 *
202 * Deallocate HT
203 *
204  CALL plasma_dealloc_handle( ht, info )
205 *
206 * Enable PLASMA warnings/errors
207 *
208  CALL plasma_enable( plasma_warnings, info )
209  CALL plasma_enable( plasma_errors, info )
210 *
211  return
212 *
213 * End of SERRQR
214 *
215  END