LAPACK  3.4.2
LAPACK: Linear Algebra PACKage
 All Files Functions Groups
derrls.f
Go to the documentation of this file.
1 *> \brief \b DERRLS
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 DERRLS( 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 *> DERRLS tests the error exits for the DOUBLE PRECISION least squares
25 *> driver routines (DGELS, 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 double_lin
54 *
55 * =====================================================================
56  SUBROUTINE derrls( 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  DOUBLE PRECISION rcond
78 * ..
79 * .. Local Arrays ..
80  INTEGER ip( nmax )
81  DOUBLE PRECISION 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, dgels, dgelsd, dgelss, dgelsx,
90  $ dgelsy
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.0d+0
107  a( 1, 2 ) = 2.0d+0
108  a( 2, 2 ) = 3.0d+0
109  a( 2, 1 ) = 4.0d+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 * DGELS
117 *
118  srnamt = 'DGELS '
119  infot = 1
120  CALL dgels( '/', 0, 0, 0, a, 1, b, 1, w, 1, info )
121  CALL chkxer( 'DGELS ', infot, nout, lerr, ok )
122  infot = 2
123  CALL dgels( 'N', -1, 0, 0, a, 1, b, 1, w, 1, info )
124  CALL chkxer( 'DGELS ', infot, nout, lerr, ok )
125  infot = 3
126  CALL dgels( 'N', 0, -1, 0, a, 1, b, 1, w, 1, info )
127  CALL chkxer( 'DGELS ', infot, nout, lerr, ok )
128  infot = 4
129  CALL dgels( 'N', 0, 0, -1, a, 1, b, 1, w, 1, info )
130  CALL chkxer( 'DGELS ', infot, nout, lerr, ok )
131  infot = 6
132  CALL dgels( 'N', 2, 0, 0, a, 1, b, 2, w, 2, info )
133  CALL chkxer( 'DGELS ', infot, nout, lerr, ok )
134  infot = 8
135  CALL dgels( 'N', 2, 0, 0, a, 2, b, 1, w, 2, info )
136  CALL chkxer( 'DGELS ', infot, nout, lerr, ok )
137  infot = 10
138  CALL dgels( 'N', 1, 1, 0, a, 1, b, 1, w, 1, info )
139  CALL chkxer( 'DGELS ', infot, nout, lerr, ok )
140 *
141 * DGELSS
142 *
143  srnamt = 'DGELSS'
144  infot = 1
145  CALL dgelss( -1, 0, 0, a, 1, b, 1, s, rcond, irnk, w, 1, info )
146  CALL chkxer( 'DGELSS', infot, nout, lerr, ok )
147  infot = 2
148  CALL dgelss( 0, -1, 0, a, 1, b, 1, s, rcond, irnk, w, 1, info )
149  CALL chkxer( 'DGELSS', infot, nout, lerr, ok )
150  infot = 3
151  CALL dgelss( 0, 0, -1, a, 1, b, 1, s, rcond, irnk, w, 1, info )
152  CALL chkxer( 'DGELSS', infot, nout, lerr, ok )
153  infot = 5
154  CALL dgelss( 2, 0, 0, a, 1, b, 2, s, rcond, irnk, w, 2, info )
155  CALL chkxer( 'DGELSS', infot, nout, lerr, ok )
156  infot = 7
157  CALL dgelss( 2, 0, 0, a, 2, b, 1, s, rcond, irnk, w, 2, info )
158  CALL chkxer( 'DGELSS', infot, nout, lerr, ok )
159 *
160 * DGELSX
161 *
162  srnamt = 'DGELSX'
163  infot = 1
164  CALL dgelsx( -1, 0, 0, a, 1, b, 1, ip, rcond, irnk, w, info )
165  CALL chkxer( 'DGELSX', infot, nout, lerr, ok )
166  infot = 2
167  CALL dgelsx( 0, -1, 0, a, 1, b, 1, ip, rcond, irnk, w, info )
168  CALL chkxer( 'DGELSX', infot, nout, lerr, ok )
169  infot = 3
170  CALL dgelsx( 0, 0, -1, a, 1, b, 1, ip, rcond, irnk, w, info )
171  CALL chkxer( 'DGELSX', infot, nout, lerr, ok )
172  infot = 5
173  CALL dgelsx( 2, 0, 0, a, 1, b, 2, ip, rcond, irnk, w, info )
174  CALL chkxer( 'DGELSX', infot, nout, lerr, ok )
175  infot = 7
176  CALL dgelsx( 2, 0, 0, a, 2, b, 1, ip, rcond, irnk, w, info )
177  CALL chkxer( 'DGELSX', infot, nout, lerr, ok )
178 *
179 * DGELSY
180 *
181  srnamt = 'DGELSY'
182  infot = 1
183  CALL dgelsy( -1, 0, 0, a, 1, b, 1, ip, rcond, irnk, w, 10,
184  $ info )
185  CALL chkxer( 'DGELSY', infot, nout, lerr, ok )
186  infot = 2
187  CALL dgelsy( 0, -1, 0, a, 1, b, 1, ip, rcond, irnk, w, 10,
188  $ info )
189  CALL chkxer( 'DGELSY', infot, nout, lerr, ok )
190  infot = 3
191  CALL dgelsy( 0, 0, -1, a, 1, b, 1, ip, rcond, irnk, w, 10,
192  $ info )
193  CALL chkxer( 'DGELSY', infot, nout, lerr, ok )
194  infot = 5
195  CALL dgelsy( 2, 0, 0, a, 1, b, 2, ip, rcond, irnk, w, 10,
196  $ info )
197  CALL chkxer( 'DGELSY', infot, nout, lerr, ok )
198  infot = 7
199  CALL dgelsy( 2, 0, 0, a, 2, b, 1, ip, rcond, irnk, w, 10,
200  $ info )
201  CALL chkxer( 'DGELSY', infot, nout, lerr, ok )
202  infot = 12
203  CALL dgelsy( 2, 2, 1, a, 2, b, 2, ip, rcond, irnk, w, 1, info )
204  CALL chkxer( 'DGELSY', infot, nout, lerr, ok )
205 *
206 * DGELSD
207 *
208  srnamt = 'DGELSD'
209  infot = 1
210  CALL dgelsd( -1, 0, 0, a, 1, b, 1, s, rcond, irnk, w, 10, ip,
211  $ info )
212  CALL chkxer( 'DGELSD', infot, nout, lerr, ok )
213  infot = 2
214  CALL dgelsd( 0, -1, 0, a, 1, b, 1, s, rcond, irnk, w, 10, ip,
215  $ info )
216  CALL chkxer( 'DGELSD', infot, nout, lerr, ok )
217  infot = 3
218  CALL dgelsd( 0, 0, -1, a, 1, b, 1, s, rcond, irnk, w, 10, ip,
219  $ info )
220  CALL chkxer( 'DGELSD', infot, nout, lerr, ok )
221  infot = 5
222  CALL dgelsd( 2, 0, 0, a, 1, b, 2, s, rcond, irnk, w, 10, ip,
223  $ info )
224  CALL chkxer( 'DGELSD', infot, nout, lerr, ok )
225  infot = 7
226  CALL dgelsd( 2, 0, 0, a, 2, b, 1, s, rcond, irnk, w, 10, ip,
227  $ info )
228  CALL chkxer( 'DGELSD', infot, nout, lerr, ok )
229  infot = 12
230  CALL dgelsd( 2, 2, 1, a, 2, b, 2, s, rcond, irnk, w, 1, ip,
231  $ info )
232  CALL chkxer( 'DGELSD', 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 DERRLS
242 *
243  END