1*> \brief \b SERRGE 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 SERRGE( 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*> SERRGE tests the error exits for the REAL routines 25*> for general matrices. 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*> \ingroup single_lin 52* 53* ===================================================================== 54 SUBROUTINE SERRGE( PATH, NUNIT ) 55* 56* -- LAPACK test routine -- 57* -- LAPACK is a software package provided by Univ. of Tennessee, -- 58* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..-- 59* 60* .. Scalar Arguments .. 61 CHARACTER*3 PATH 62 INTEGER NUNIT 63* .. 64* 65* ===================================================================== 66* 67* .. Parameters .. 68 INTEGER NMAX, LW 69 PARAMETER ( NMAX = 4, LW = 3*NMAX ) 70* .. 71* .. Local Scalars .. 72 CHARACTER*2 C2 73 INTEGER I, INFO, J 74 REAL ANRM, CCOND, RCOND 75* .. 76* .. Local Arrays .. 77 INTEGER IP( NMAX ), IW( NMAX ) 78 REAL A( NMAX, NMAX ), AF( NMAX, NMAX ), B( NMAX ), 79 $ R1( NMAX ), R2( NMAX ), W( LW ), X( NMAX ) 80* .. 81* .. External Functions .. 82 LOGICAL LSAMEN 83 EXTERNAL LSAMEN 84* .. 85* .. External Subroutines .. 86 EXTERNAL ALAESM, CHKXER, SGBCON, SGBEQU, SGBRFS, SGBTF2, 87 $ SGBTRF, SGBTRS, SGECON, SGEEQU, SGERFS, SGETF2, 88 $ SGETRF, SGETRI, SGETRS 89* .. 90* .. Scalars in Common .. 91 LOGICAL LERR, OK 92 CHARACTER*32 SRNAMT 93 INTEGER INFOT, NOUT 94* .. 95* .. Common blocks .. 96 COMMON / INFOC / INFOT, NOUT, OK, LERR 97 COMMON / SRNAMC / SRNAMT 98* .. 99* .. Intrinsic Functions .. 100 INTRINSIC REAL 101* .. 102* .. Executable Statements .. 103* 104 NOUT = NUNIT 105 WRITE( NOUT, FMT = * ) 106 C2 = PATH( 2: 3 ) 107* 108* Set the variables to innocuous values. 109* 110 DO 20 J = 1, NMAX 111 DO 10 I = 1, NMAX 112 A( I, J ) = 1. / REAL( I+J ) 113 AF( I, J ) = 1. / REAL( I+J ) 114 10 CONTINUE 115 B( J ) = 0. 116 R1( J ) = 0. 117 R2( J ) = 0. 118 W( J ) = 0. 119 X( J ) = 0. 120 IP( J ) = J 121 IW( J ) = J 122 20 CONTINUE 123 OK = .TRUE. 124* 125 IF( LSAMEN( 2, C2, 'GE' ) ) THEN 126* 127* Test error exits of the routines that use the LU decomposition 128* of a general matrix. 129* 130* SGETRF 131* 132 SRNAMT = 'SGETRF' 133 INFOT = 1 134 CALL SGETRF( -1, 0, A, 1, IP, INFO ) 135 CALL CHKXER( 'SGETRF', INFOT, NOUT, LERR, OK ) 136 INFOT = 2 137 CALL SGETRF( 0, -1, A, 1, IP, INFO ) 138 CALL CHKXER( 'SGETRF', INFOT, NOUT, LERR, OK ) 139 INFOT = 4 140 CALL SGETRF( 2, 1, A, 1, IP, INFO ) 141 CALL CHKXER( 'SGETRF', INFOT, NOUT, LERR, OK ) 142* 143* SGETF2 144* 145 SRNAMT = 'SGETF2' 146 INFOT = 1 147 CALL SGETF2( -1, 0, A, 1, IP, INFO ) 148 CALL CHKXER( 'SGETF2', INFOT, NOUT, LERR, OK ) 149 INFOT = 2 150 CALL SGETF2( 0, -1, A, 1, IP, INFO ) 151 CALL CHKXER( 'SGETF2', INFOT, NOUT, LERR, OK ) 152 INFOT = 4 153 CALL SGETF2( 2, 1, A, 1, IP, INFO ) 154 CALL CHKXER( 'SGETF2', INFOT, NOUT, LERR, OK ) 155* 156* SGETRI 157* 158 SRNAMT = 'SGETRI' 159 INFOT = 1 160 CALL SGETRI( -1, A, 1, IP, W, LW, INFO ) 161 CALL CHKXER( 'SGETRI', INFOT, NOUT, LERR, OK ) 162 INFOT = 3 163 CALL SGETRI( 2, A, 1, IP, W, LW, INFO ) 164 CALL CHKXER( 'SGETRI', INFOT, NOUT, LERR, OK ) 165* 166* SGETRS 167* 168 SRNAMT = 'SGETRS' 169 INFOT = 1 170 CALL SGETRS( '/', 0, 0, A, 1, IP, B, 1, INFO ) 171 CALL CHKXER( 'SGETRS', INFOT, NOUT, LERR, OK ) 172 INFOT = 2 173 CALL SGETRS( 'N', -1, 0, A, 1, IP, B, 1, INFO ) 174 CALL CHKXER( 'SGETRS', INFOT, NOUT, LERR, OK ) 175 INFOT = 3 176 CALL SGETRS( 'N', 0, -1, A, 1, IP, B, 1, INFO ) 177 CALL CHKXER( 'SGETRS', INFOT, NOUT, LERR, OK ) 178 INFOT = 5 179 CALL SGETRS( 'N', 2, 1, A, 1, IP, B, 2, INFO ) 180 CALL CHKXER( 'SGETRS', INFOT, NOUT, LERR, OK ) 181 INFOT = 8 182 CALL SGETRS( 'N', 2, 1, A, 2, IP, B, 1, INFO ) 183 CALL CHKXER( 'SGETRS', INFOT, NOUT, LERR, OK ) 184* 185* SGERFS 186* 187 SRNAMT = 'SGERFS' 188 INFOT = 1 189 CALL SGERFS( '/', 0, 0, A, 1, AF, 1, IP, B, 1, X, 1, R1, R2, W, 190 $ IW, INFO ) 191 CALL CHKXER( 'SGERFS', INFOT, NOUT, LERR, OK ) 192 INFOT = 2 193 CALL SGERFS( 'N', -1, 0, A, 1, AF, 1, IP, B, 1, X, 1, R1, R2, 194 $ W, IW, INFO ) 195 CALL CHKXER( 'SGERFS', INFOT, NOUT, LERR, OK ) 196 INFOT = 3 197 CALL SGERFS( 'N', 0, -1, A, 1, AF, 1, IP, B, 1, X, 1, R1, R2, 198 $ W, IW, INFO ) 199 CALL CHKXER( 'SGERFS', INFOT, NOUT, LERR, OK ) 200 INFOT = 5 201 CALL SGERFS( 'N', 2, 1, A, 1, AF, 2, IP, B, 2, X, 2, R1, R2, W, 202 $ IW, INFO ) 203 CALL CHKXER( 'SGERFS', INFOT, NOUT, LERR, OK ) 204 INFOT = 7 205 CALL SGERFS( 'N', 2, 1, A, 2, AF, 1, IP, B, 2, X, 2, R1, R2, W, 206 $ IW, INFO ) 207 CALL CHKXER( 'SGERFS', INFOT, NOUT, LERR, OK ) 208 INFOT = 10 209 CALL SGERFS( 'N', 2, 1, A, 2, AF, 2, IP, B, 1, X, 2, R1, R2, W, 210 $ IW, INFO ) 211 CALL CHKXER( 'SGERFS', INFOT, NOUT, LERR, OK ) 212 INFOT = 12 213 CALL SGERFS( 'N', 2, 1, A, 2, AF, 2, IP, B, 2, X, 1, R1, R2, W, 214 $ IW, INFO ) 215 CALL CHKXER( 'SGERFS', INFOT, NOUT, LERR, OK ) 216* 217* SGECON 218* 219 SRNAMT = 'SGECON' 220 INFOT = 1 221 CALL SGECON( '/', 0, A, 1, ANRM, RCOND, W, IW, INFO ) 222 CALL CHKXER( 'SGECON', INFOT, NOUT, LERR, OK ) 223 INFOT = 2 224 CALL SGECON( '1', -1, A, 1, ANRM, RCOND, W, IW, INFO ) 225 CALL CHKXER( 'SGECON', INFOT, NOUT, LERR, OK ) 226 INFOT = 4 227 CALL SGECON( '1', 2, A, 1, ANRM, RCOND, W, IW, INFO ) 228 CALL CHKXER( 'SGECON', INFOT, NOUT, LERR, OK ) 229* 230* SGEEQU 231* 232 SRNAMT = 'SGEEQU' 233 INFOT = 1 234 CALL SGEEQU( -1, 0, A, 1, R1, R2, RCOND, CCOND, ANRM, INFO ) 235 CALL CHKXER( 'SGEEQU', INFOT, NOUT, LERR, OK ) 236 INFOT = 2 237 CALL SGEEQU( 0, -1, A, 1, R1, R2, RCOND, CCOND, ANRM, INFO ) 238 CALL CHKXER( 'SGEEQU', INFOT, NOUT, LERR, OK ) 239 INFOT = 4 240 CALL SGEEQU( 2, 2, A, 1, R1, R2, RCOND, CCOND, ANRM, INFO ) 241 CALL CHKXER( 'SGEEQU', INFOT, NOUT, LERR, OK ) 242* 243 ELSE IF( LSAMEN( 2, C2, 'GB' ) ) THEN 244* 245* Test error exits of the routines that use the LU decomposition 246* of a general band matrix. 247* 248* SGBTRF 249* 250 SRNAMT = 'SGBTRF' 251 INFOT = 1 252 CALL SGBTRF( -1, 0, 0, 0, A, 1, IP, INFO ) 253 CALL CHKXER( 'SGBTRF', INFOT, NOUT, LERR, OK ) 254 INFOT = 2 255 CALL SGBTRF( 0, -1, 0, 0, A, 1, IP, INFO ) 256 CALL CHKXER( 'SGBTRF', INFOT, NOUT, LERR, OK ) 257 INFOT = 3 258 CALL SGBTRF( 1, 1, -1, 0, A, 1, IP, INFO ) 259 CALL CHKXER( 'SGBTRF', INFOT, NOUT, LERR, OK ) 260 INFOT = 4 261 CALL SGBTRF( 1, 1, 0, -1, A, 1, IP, INFO ) 262 CALL CHKXER( 'SGBTRF', INFOT, NOUT, LERR, OK ) 263 INFOT = 6 264 CALL SGBTRF( 2, 2, 1, 1, A, 3, IP, INFO ) 265 CALL CHKXER( 'SGBTRF', INFOT, NOUT, LERR, OK ) 266* 267* SGBTF2 268* 269 SRNAMT = 'SGBTF2' 270 INFOT = 1 271 CALL SGBTF2( -1, 0, 0, 0, A, 1, IP, INFO ) 272 CALL CHKXER( 'SGBTF2', INFOT, NOUT, LERR, OK ) 273 INFOT = 2 274 CALL SGBTF2( 0, -1, 0, 0, A, 1, IP, INFO ) 275 CALL CHKXER( 'SGBTF2', INFOT, NOUT, LERR, OK ) 276 INFOT = 3 277 CALL SGBTF2( 1, 1, -1, 0, A, 1, IP, INFO ) 278 CALL CHKXER( 'SGBTF2', INFOT, NOUT, LERR, OK ) 279 INFOT = 4 280 CALL SGBTF2( 1, 1, 0, -1, A, 1, IP, INFO ) 281 CALL CHKXER( 'SGBTF2', INFOT, NOUT, LERR, OK ) 282 INFOT = 6 283 CALL SGBTF2( 2, 2, 1, 1, A, 3, IP, INFO ) 284 CALL CHKXER( 'SGBTF2', INFOT, NOUT, LERR, OK ) 285* 286* SGBTRS 287* 288 SRNAMT = 'SGBTRS' 289 INFOT = 1 290 CALL SGBTRS( '/', 0, 0, 0, 1, A, 1, IP, B, 1, INFO ) 291 CALL CHKXER( 'SGBTRS', INFOT, NOUT, LERR, OK ) 292 INFOT = 2 293 CALL SGBTRS( 'N', -1, 0, 0, 1, A, 1, IP, B, 1, INFO ) 294 CALL CHKXER( 'SGBTRS', INFOT, NOUT, LERR, OK ) 295 INFOT = 3 296 CALL SGBTRS( 'N', 1, -1, 0, 1, A, 1, IP, B, 1, INFO ) 297 CALL CHKXER( 'SGBTRS', INFOT, NOUT, LERR, OK ) 298 INFOT = 4 299 CALL SGBTRS( 'N', 1, 0, -1, 1, A, 1, IP, B, 1, INFO ) 300 CALL CHKXER( 'SGBTRS', INFOT, NOUT, LERR, OK ) 301 INFOT = 5 302 CALL SGBTRS( 'N', 1, 0, 0, -1, A, 1, IP, B, 1, INFO ) 303 CALL CHKXER( 'SGBTRS', INFOT, NOUT, LERR, OK ) 304 INFOT = 7 305 CALL SGBTRS( 'N', 2, 1, 1, 1, A, 3, IP, B, 2, INFO ) 306 CALL CHKXER( 'SGBTRS', INFOT, NOUT, LERR, OK ) 307 INFOT = 10 308 CALL SGBTRS( 'N', 2, 0, 0, 1, A, 1, IP, B, 1, INFO ) 309 CALL CHKXER( 'SGBTRS', INFOT, NOUT, LERR, OK ) 310* 311* SGBRFS 312* 313 SRNAMT = 'SGBRFS' 314 INFOT = 1 315 CALL SGBRFS( '/', 0, 0, 0, 0, A, 1, AF, 1, IP, B, 1, X, 1, R1, 316 $ R2, W, IW, INFO ) 317 CALL CHKXER( 'SGBRFS', INFOT, NOUT, LERR, OK ) 318 INFOT = 2 319 CALL SGBRFS( 'N', -1, 0, 0, 0, A, 1, AF, 1, IP, B, 1, X, 1, R1, 320 $ R2, W, IW, INFO ) 321 CALL CHKXER( 'SGBRFS', INFOT, NOUT, LERR, OK ) 322 INFOT = 3 323 CALL SGBRFS( 'N', 1, -1, 0, 0, A, 1, AF, 1, IP, B, 1, X, 1, R1, 324 $ R2, W, IW, INFO ) 325 CALL CHKXER( 'SGBRFS', INFOT, NOUT, LERR, OK ) 326 INFOT = 4 327 CALL SGBRFS( 'N', 1, 0, -1, 0, A, 1, AF, 1, IP, B, 1, X, 1, R1, 328 $ R2, W, IW, INFO ) 329 CALL CHKXER( 'SGBRFS', INFOT, NOUT, LERR, OK ) 330 INFOT = 5 331 CALL SGBRFS( 'N', 1, 0, 0, -1, A, 1, AF, 1, IP, B, 1, X, 1, R1, 332 $ R2, W, IW, INFO ) 333 CALL CHKXER( 'SGBRFS', INFOT, NOUT, LERR, OK ) 334 INFOT = 7 335 CALL SGBRFS( 'N', 2, 1, 1, 1, A, 2, AF, 4, IP, B, 2, X, 2, R1, 336 $ R2, W, IW, INFO ) 337 CALL CHKXER( 'SGBRFS', INFOT, NOUT, LERR, OK ) 338 INFOT = 9 339 CALL SGBRFS( 'N', 2, 1, 1, 1, A, 3, AF, 3, IP, B, 2, X, 2, R1, 340 $ R2, W, IW, INFO ) 341 CALL CHKXER( 'SGBRFS', INFOT, NOUT, LERR, OK ) 342 INFOT = 12 343 CALL SGBRFS( 'N', 2, 0, 0, 1, A, 1, AF, 1, IP, B, 1, X, 2, R1, 344 $ R2, W, IW, INFO ) 345 CALL CHKXER( 'SGBRFS', INFOT, NOUT, LERR, OK ) 346 INFOT = 14 347 CALL SGBRFS( 'N', 2, 0, 0, 1, A, 1, AF, 1, IP, B, 2, X, 1, R1, 348 $ R2, W, IW, INFO ) 349 CALL CHKXER( 'SGBRFS', INFOT, NOUT, LERR, OK ) 350* 351* SGBCON 352* 353 SRNAMT = 'SGBCON' 354 INFOT = 1 355 CALL SGBCON( '/', 0, 0, 0, A, 1, IP, ANRM, RCOND, W, IW, INFO ) 356 CALL CHKXER( 'SGBCON', INFOT, NOUT, LERR, OK ) 357 INFOT = 2 358 CALL SGBCON( '1', -1, 0, 0, A, 1, IP, ANRM, RCOND, W, IW, 359 $ INFO ) 360 CALL CHKXER( 'SGBCON', INFOT, NOUT, LERR, OK ) 361 INFOT = 3 362 CALL SGBCON( '1', 1, -1, 0, A, 1, IP, ANRM, RCOND, W, IW, 363 $ INFO ) 364 CALL CHKXER( 'SGBCON', INFOT, NOUT, LERR, OK ) 365 INFOT = 4 366 CALL SGBCON( '1', 1, 0, -1, A, 1, IP, ANRM, RCOND, W, IW, 367 $ INFO ) 368 CALL CHKXER( 'SGBCON', INFOT, NOUT, LERR, OK ) 369 INFOT = 6 370 CALL SGBCON( '1', 2, 1, 1, A, 3, IP, ANRM, RCOND, W, IW, INFO ) 371 CALL CHKXER( 'SGBCON', INFOT, NOUT, LERR, OK ) 372* 373* SGBEQU 374* 375 SRNAMT = 'SGBEQU' 376 INFOT = 1 377 CALL SGBEQU( -1, 0, 0, 0, A, 1, R1, R2, RCOND, CCOND, ANRM, 378 $ INFO ) 379 CALL CHKXER( 'SGBEQU', INFOT, NOUT, LERR, OK ) 380 INFOT = 2 381 CALL SGBEQU( 0, -1, 0, 0, A, 1, R1, R2, RCOND, CCOND, ANRM, 382 $ INFO ) 383 CALL CHKXER( 'SGBEQU', INFOT, NOUT, LERR, OK ) 384 INFOT = 3 385 CALL SGBEQU( 1, 1, -1, 0, A, 1, R1, R2, RCOND, CCOND, ANRM, 386 $ INFO ) 387 CALL CHKXER( 'SGBEQU', INFOT, NOUT, LERR, OK ) 388 INFOT = 4 389 CALL SGBEQU( 1, 1, 0, -1, A, 1, R1, R2, RCOND, CCOND, ANRM, 390 $ INFO ) 391 CALL CHKXER( 'SGBEQU', INFOT, NOUT, LERR, OK ) 392 INFOT = 6 393 CALL SGBEQU( 2, 2, 1, 1, A, 2, R1, R2, RCOND, CCOND, ANRM, 394 $ INFO ) 395 CALL CHKXER( 'SGBEQU', INFOT, NOUT, LERR, OK ) 396 END IF 397* 398* Print a summary line. 399* 400 CALL ALAESM( PATH, OK, NOUT ) 401* 402 RETURN 403* 404* End of SERRGE 405* 406 END 407