LAPACK  3.4.2
LAPACK: Linear Algebra PACKage
 All Files Functions Groups
serrls.f
Go to the documentation of this file.
1 *> \brief \b SERRLS
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 SERRLS( 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 *> SERRLS tests the error exits for the REAL least squares
25 *> driver routines (SGELS, SGELSS, SGELSX, SGELSY, SGELSD).
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 2011
52 *
53 *> \ingroup single_lin
54 *
55 * =====================================================================
56  SUBROUTINE serrls( PATH, NUNIT )
57 *
58 * -- LAPACK test routine (version 3.4.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 2011
62 *
63 * .. Scalar Arguments ..
64  CHARACTER*3 path
65  INTEGER nunit
66 * ..
67 *
68 * =====================================================================
69 *
70 * .. Parameters ..
71  INTEGER nmax
72  parameter( nmax = 2 )
73 * ..
74 * .. Local Scalars ..
75  CHARACTER*2 c2
76  INTEGER info, irnk
77  REAL rcond
78 * ..
79 * .. Local Arrays ..
80  INTEGER ip( nmax )
81  REAL a( nmax, nmax ), b( nmax, nmax ), s( nmax ),
82  $ w( nmax )
83 * ..
84 * .. External Functions ..
85  LOGICAL lsamen
86  EXTERNAL lsamen
87 * ..
88 * .. External Subroutines ..
89  EXTERNAL alaesm, chkxer, sgels, sgelsd, sgelss, sgelsx,
90  $ sgelsy
91 * ..
92 * .. Scalars in Common ..
93  LOGICAL lerr, ok
94  CHARACTER*32 srnamt
95  INTEGER infot, nout
96 * ..
97 * .. Common blocks ..
98  common / infoc / infot, nout, ok, lerr
99  common / srnamc / srnamt
100 * ..
101 * .. Executable Statements ..
102 *
103  nout = nunit
104  WRITE( nout, fmt = * )
105  c2 = path( 2: 3 )
106  a( 1, 1 ) = 1.0e+0
107  a( 1, 2 ) = 2.0e+0
108  a( 2, 2 ) = 3.0e+0
109  a( 2, 1 ) = 4.0e+0
110  ok = .true.
111 *
112  IF( lsamen( 2, c2, 'LS' ) ) THEN
113 *
114 * Test error exits for the least squares driver routines.
115 *
116 * SGELS
117 *
118  srnamt = 'SGELS '
119  infot = 1
120  CALL sgels( '/', 0, 0, 0, a, 1, b, 1, w, 1, info )
121  CALL chkxer( 'SGELS ', infot, nout, lerr, ok )
122  infot = 2
123  CALL sgels( 'N', -1, 0, 0, a, 1, b, 1, w, 1, info )
124  CALL chkxer( 'SGELS ', infot, nout, lerr, ok )
125  infot = 3
126  CALL sgels( 'N', 0, -1, 0, a, 1, b, 1, w, 1, info )
127  CALL chkxer( 'SGELS ', infot, nout, lerr, ok )
128  infot = 4
129  CALL sgels( 'N', 0, 0, -1, a, 1, b, 1, w, 1, info )
130  CALL chkxer( 'SGELS ', infot, nout, lerr, ok )
131  infot = 6
132  CALL sgels( 'N', 2, 0, 0, a, 1, b, 2, w, 2, info )
133  CALL chkxer( 'SGELS ', infot, nout, lerr, ok )
134  infot = 8
135  CALL sgels( 'N', 2, 0, 0, a, 2, b, 1, w, 2, info )
136  CALL chkxer( 'SGELS ', infot, nout, lerr, ok )
137  infot = 10
138  CALL sgels( 'N', 1, 1, 0, a, 1, b, 1, w, 1, info )
139  CALL chkxer( 'SGELS ', infot, nout, lerr, ok )
140 *
141 * SGELSS
142 *
143  srnamt = 'SGELSS'
144  infot = 1
145  CALL sgelss( -1, 0, 0, a, 1, b, 1, s, rcond, irnk, w, 1, info )
146  CALL chkxer( 'SGELSS', infot, nout, lerr, ok )
147  infot = 2
148  CALL sgelss( 0, -1, 0, a, 1, b, 1, s, rcond, irnk, w, 1, info )
149  CALL chkxer( 'SGELSS', infot, nout, lerr, ok )
150  infot = 3
151  CALL sgelss( 0, 0, -1, a, 1, b, 1, s, rcond, irnk, w, 1, info )
152  CALL chkxer( 'SGELSS', infot, nout, lerr, ok )
153  infot = 5
154  CALL sgelss( 2, 0, 0, a, 1, b, 2, s, rcond, irnk, w, 2, info )
155  CALL chkxer( 'SGELSS', infot, nout, lerr, ok )
156  infot = 7
157  CALL sgelss( 2, 0, 0, a, 2, b, 1, s, rcond, irnk, w, 2, info )
158  CALL chkxer( 'SGELSS', infot, nout, lerr, ok )
159 *
160 * SGELSX
161 *
162  srnamt = 'SGELSX'
163  infot = 1
164  CALL sgelsx( -1, 0, 0, a, 1, b, 1, ip, rcond, irnk, w, info )
165  CALL chkxer( 'SGELSX', infot, nout, lerr, ok )
166  infot = 2
167  CALL sgelsx( 0, -1, 0, a, 1, b, 1, ip, rcond, irnk, w, info )
168  CALL chkxer( 'SGELSX', infot, nout, lerr, ok )
169  infot = 3
170  CALL sgelsx( 0, 0, -1, a, 1, b, 1, ip, rcond, irnk, w, info )
171  CALL chkxer( 'SGELSX', infot, nout, lerr, ok )
172  infot = 5
173  CALL sgelsx( 2, 0, 0, a, 1, b, 2, ip, rcond, irnk, w, info )
174  CALL chkxer( 'SGELSX', infot, nout, lerr, ok )
175  infot = 7
176  CALL sgelsx( 2, 0, 0, a, 2, b, 1, ip, rcond, irnk, w, info )
177  CALL chkxer( 'SGELSX', infot, nout, lerr, ok )
178 *
179 * SGELSY
180 *
181  srnamt = 'SGELSY'
182  infot = 1
183  CALL sgelsy( -1, 0, 0, a, 1, b, 1, ip, rcond, irnk, w, 10,
184  $ info )
185  CALL chkxer( 'SGELSY', infot, nout, lerr, ok )
186  infot = 2
187  CALL sgelsy( 0, -1, 0, a, 1, b, 1, ip, rcond, irnk, w, 10,
188  $ info )
189  CALL chkxer( 'SGELSY', infot, nout, lerr, ok )
190  infot = 3
191  CALL sgelsy( 0, 0, -1, a, 1, b, 1, ip, rcond, irnk, w, 10,
192  $ info )
193  CALL chkxer( 'SGELSY', infot, nout, lerr, ok )
194  infot = 5
195  CALL sgelsy( 2, 0, 0, a, 1, b, 2, ip, rcond, irnk, w, 10,
196  $ info )
197  CALL chkxer( 'SGELSY', infot, nout, lerr, ok )
198  infot = 7
199  CALL sgelsy( 2, 0, 0, a, 2, b, 1, ip, rcond, irnk, w, 10,
200  $ info )
201  CALL chkxer( 'SGELSY', infot, nout, lerr, ok )
202  infot = 12
203  CALL sgelsy( 2, 2, 1, a, 2, b, 2, ip, rcond, irnk, w, 1, info )
204  CALL chkxer( 'SGELSY', infot, nout, lerr, ok )
205 *
206 * SGELSD
207 *
208  srnamt = 'SGELSD'
209  infot = 1
210  CALL sgelsd( -1, 0, 0, a, 1, b, 1, s, rcond, irnk, w, 10,
211  $ ip, info )
212  CALL chkxer( 'SGELSD', infot, nout, lerr, ok )
213  infot = 2
214  CALL sgelsd( 0, -1, 0, a, 1, b, 1, s, rcond, irnk, w, 10,
215  $ ip, info )
216  CALL chkxer( 'SGELSD', infot, nout, lerr, ok )
217  infot = 3
218  CALL sgelsd( 0, 0, -1, a, 1, b, 1, s, rcond, irnk, w, 10,
219  $ ip, info )
220  CALL chkxer( 'SGELSD', infot, nout, lerr, ok )
221  infot = 5
222  CALL sgelsd( 2, 0, 0, a, 1, b, 2, s, rcond, irnk, w, 10,
223  $ ip, info )
224  CALL chkxer( 'SGELSD', infot, nout, lerr, ok )
225  infot = 7
226  CALL sgelsd( 2, 0, 0, a, 2, b, 1, s, rcond, irnk, w, 10,
227  $ ip, info )
228  CALL chkxer( 'SGELSD', infot, nout, lerr, ok )
229  infot = 12
230  CALL sgelsd( 2, 2, 1, a, 2, b, 2, s, rcond, irnk, w, 1, ip,
231  $ info )
232  CALL chkxer( 'SGELSD', infot, nout, lerr, ok )
233  END IF
234 *
235 * Print a summary line.
236 *
237  CALL alaesm( path, ok, nout )
238 *
239  return
240 *
241 * End of SERRLS
242 *
243  END