serrqr.f 8.17 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252
!!!
!
! -- Inria
! -- (C) Copyright 2012
!
! This software is a computer program whose purpose is to process
! Matrices Over Runtime Systems @ Exascale (MORSE). More information
! can be found on the following website: http://www.inria.fr/en/teams/morse.
! 
! This software is governed by the CeCILL-B license under French law and
! abiding by the rules of distribution of free software.  You can  use, 
! modify and/ or redistribute the software under the terms of the CeCILL-B
! license as circulated by CEA, CNRS and INRIA at the following URL
! "http://www.cecill.info". 
! 
! As a counterpart to the access to the source code and  rights to copy,
! modify and redistribute granted by the license, users are provided only
! with a limited warranty  and the software's author,  the holder of the
! economic rights,  and the successive licensors  have only  limited
! liability. 
! 
! In this respect, the user's attention is drawn to the risks associated
! with loading,  using,  modifying and/or developing or reproducing the
! software by the user in light of its specific status of free software,
! that may mean  that it is complicated to manipulate,  and  that  also
! therefore means  that it is reserved for developers  and  experienced
! professionals having in-depth computer knowledge. Users are therefore
! encouraged to load and test the software's suitability as regards their
! requirements in conditions enabling the security of their systems and/or 
! data to be ensured and,  more generally, to use and operate it in the 
! same conditions as regards security. 
! 
! The fact that you are presently reading this means that you have had
! knowledge of the CeCILL-B license and that you accept its terms.
!
!!!

      SUBROUTINE SERRQR( PATH, NUNIT )
*
      INCLUDE 'morse_fortran.h'
*
*  -- LAPACK test routine (version 3.1) --
*     Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd..
*     November 2006
*
*     .. Scalar Arguments ..
      CHARACTER*3        PATH
      INTEGER            NUNIT
*     ..
*
*  Purpose
*  =======
*
*  SERRQR tests the error exits for the REAL routines
*  that use the QR decomposition of a general matrix.
*
*  Arguments
*  =========
*
*  PATH    (input) CHARACTER*3
*          The LAPACK path name for the routines to be tested.
*
*  NUNIT   (input) INTEGER
*          The unit number for output.
*
*  =====================================================================
*
*     .. Parameters ..
      INTEGER            NMAX
      PARAMETER          ( NMAX = 2 )
*     ..
*     .. Local Scalars ..
      INTEGER            I, INFO, J
*     ..
*     .. Local Arrays ..
      REAL               A( NMAX, NMAX ), AF( NMAX, NMAX ), B( NMAX ),
     $                   W( NMAX ), X( NMAX )
      INTEGER           HT( 2 )
*     ..
*     .. External Subroutines ..
      EXTERNAL           ALAESM, CHKXER, SGEQR2, SGEQRF, SORG2R,
     $                   SORGQR, SORM2R, SORMQR
*     ..
*     .. Scalars in Common ..
      LOGICAL            LERR, OK
      CHARACTER*32       SRNAMT
      INTEGER            INFOT, NOUT
*     ..
*     .. Common blocks ..
      COMMON             / INFOC / INFOT, NOUT, OK, LERR
      COMMON             / SRNAMC / SRNAMT
*     ..
*     .. Intrinsic Functions ..
      INTRINSIC          REAL
*     ..
*     .. Executable Statements ..
*
      NOUT = NUNIT
      WRITE( NOUT, FMT = * )
*
*     Disable MORSE warnings/errors
* 
      CALL MORSE_DISABLE( MORSE_WARNINGS, INFO )
      CALL MORSE_DISABLE( MORSE_ERRORS,   INFO )
*
*     Set the variables to innocuous values.
*
      DO 20 J = 1, NMAX
         DO 10 I = 1, NMAX
            A( I, J ) = 1. / REAL( I+J )
            AF( I, J ) = 1. / REAL( I+J )
   10    CONTINUE
         B( J ) = 0.
         W( J ) = 0.
         X( J ) = 0.
   20 CONTINUE
      OK = .TRUE.
*
*     Allocate HT
*
      CALL MORSE_ALLOC_WORKSPACE_SGEQRF( 2, 2, HT, INFO )

*
*     Error exits for QR factorization
*
*     SGEQRF
*
      SRNAMT = 'SGEQRF'
      INFOT = 1
      CALL MORSE_SGEQRF( -1, 0, A, 1, HT, INFO )
      CALL CHKXER( 'SGEQRF', INFOT, NOUT, INFO, OK )
      INFOT = 2
      CALL MORSE_SGEQRF( 0, -1, A, 1, HT, INFO )
      CALL CHKXER( 'SGEQRF', INFOT, NOUT, INFO, OK )
      INFOT = 4
      CALL MORSE_SGEQRF( 2, 1, A, 1, HT, INFO )
      CALL CHKXER( 'SGEQRF', INFOT, NOUT, INFO, OK )
*
*     SGEQRS
*
*
      SRNAMT = 'SGEQRS'
      INFOT = 1
      CALL MORSE_SGEQRS( -1, 0, 0, A, 1, X, B, 1, INFO )
      CALL CHKXER( 'SGEQRS', INFOT, NOUT, INFO, OK )
      INFOT = 2
      CALL MORSE_SGEQRS( 0, -1, 0, A, 1, X, B, 1, INFO )
      CALL CHKXER( 'SGEQRS', INFOT, NOUT, INFO, OK )
      INFOT = 2
      CALL MORSE_SGEQRS( 1, 2, 0, A, 2, X, B, 2, INFO )
      CALL CHKXER( 'SGEQRS', INFOT, NOUT, INFO, OK )
      INFOT = 3
      CALL MORSE_SGEQRS( 0, 0, -1, A, 1, X, B, 1, INFO )
      CALL CHKXER( 'SGEQRS', INFOT, NOUT, INFO, OK )
      INFOT = 5
      CALL MORSE_SGEQRS( 2, 1, 0, A, 1, X, B, 2, INFO )
      CALL CHKXER( 'SGEQRS', INFOT, NOUT, INFO, OK )
      INFOT = 8
      CALL MORSE_SGEQRS( 2, 1, 0, A, 2, X, B, 1, INFO )
      CALL CHKXER( 'SGEQRS', INFOT, NOUT, INFO, OK )
*
*     SORGQR
*
      SRNAMT = 'SORGQR'
      INFOT = 1
      CALL MORSE_SORGQR( -1, 0, 0, A, 1, HT, W, 1, INFO )
      CALL CHKXER( 'SORGQR', INFOT, NOUT, INFO, OK )
      INFOT = 2
      CALL MORSE_SORGQR( 0, -1, 0, A, 1, HT, W, 1, INFO )
      CALL CHKXER( 'SORGQR', INFOT, NOUT, INFO, OK )
      INFOT = 2
      CALL MORSE_SORGQR( 1, 2, 0, A, 1, HT, W, 2, INFO )
      CALL CHKXER( 'SORGQR', INFOT, NOUT, INFO, OK )
      INFOT = 3
      CALL MORSE_SORGQR( 0, 0, -1, A, 1, HT, W, 1, INFO )
      CALL CHKXER( 'SORGQR', INFOT, NOUT, INFO, OK )
      INFOT = 3
      CALL MORSE_SORGQR( 1, 1, 2, A, 1, HT, W, 1, INFO )
      CALL CHKXER( 'SORGQR', INFOT, NOUT, INFO, OK )
      INFOT = 5
      CALL MORSE_SORGQR( 2, 2, 0, A, 1, HT, W, 2, INFO )
      CALL CHKXER( 'SORGQR', INFOT, NOUT, INFO, OK )
      INFOT = 8
      CALL MORSE_SORGQR( 2, 2, 0, A, 2, HT, W, 1, INFO )
      CALL CHKXER( 'SORGQR', INFOT, NOUT, INFO, OK )
*
*     MORSE_SORMQR
*
      SRNAMT = 'SORMQR'
      INFOT = 1
      CALL MORSE_SORMQR( '/', MORSETRANS, 0, 0, 0, A, 1, HT, AF, 1,
     4                   INFO )
      CALL CHKXER( 'SORMQR', INFOT, NOUT, INFO, OK )
      INFOT = 2
      CALL MORSE_SORMQR( MORSELEFT, '/', 0, 0, 0, A, 1, HT, AF, 1,
     4                   INFO )
      CALL CHKXER( 'SORMQR', INFOT, NOUT, INFO, OK )
      INFOT = 3
      CALL MORSE_SORMQR( MORSELEFT, MORSETRANS, -1, 0, 0, A, 1, HT,
     4                   AF, 1, INFO )
      CALL CHKXER( 'SORMQR', INFOT, NOUT, INFO, OK )
      INFOT = 4
      CALL MORSE_SORMQR( MORSELEFT, MORSETRANS, 0, -1, 0, A, 1, HT,
     4                   AF, 1, INFO )
      CALL CHKXER( 'SORMQR', INFOT, NOUT, INFO, OK )
      INFOT = 5
      CALL MORSE_SORMQR( MORSELEFT, MORSETRANS, 0, 0, -1, A, 1, HT,
     4                   AF, 1, INFO )
      CALL CHKXER( 'SORMQR', INFOT, NOUT, INFO, OK )
*      INFOT = 5
*      CALL MORSE_SORMQR( MORSELEFT, MORSETRANS, 0, 1, 1, A, 1, HT,
*     4                   AF, 1, INFO )
*      CALL CHKXER( 'SORMQR', INFOT, NOUT, INFO, OK )
*      INFOT = 5
*      CALL MORSE_SORMQR( MORSELEFT, MORSETRANS, 1, 0, 1, A, 1, HT,
*     4                   AF, 1, INFO )
*      CALL CHKXER( 'SORMQR', INFOT, NOUT, INFO, OK )
*      INFOT = 7
*      CALL MORSE_SORMQR( MORSELEFT, MORSETRANS, 2, 1, 0, A, 1, HT,
*     4                   AF, 2, INFO )
*      CALL CHKXER( 'SORMQR', INFOT, NOUT, INFO, OK )
*      INFOT = 7
*      CALL MORSE_SORMQR( MORSELEFT, MORSETRANS, 1, 2, 0, A, 1, HT,
*     4                   AF, 1, INFO )
*      CALL CHKXER( 'SORMQR', INFOT, NOUT, INFO, OK )
*      INFOT = 10
*      CALL MORSE_SORMQR( MORSELEFT, MORSETRANS, 1, 2, 0, A, 1, HT,
*     4                   AF, 1, INFO )
*      CALL CHKXER( 'SORMQR', INFOT, NOUT, INFO, OK )
*      INFOT = 10
*      CALL MORSE_SORMQR( MORSELEFT, MORSETRANS, 2, 1, 0, A, 1, HT,
*     4                   AF, 2, INFO )
*      CALL CHKXER( 'SORMQR', INFOT, NOUT, INFO, OK )
*
*     Print a summary line.
*
      CALL ALAESM( PATH, OK, NOUT )
*
*     Deallocate HT
*
      CALL MORSE_DEALLOC_HANDLE( HT, INFO )
*
*     Enable MORSE warnings/errors
* 
      CALL MORSE_ENABLE( MORSE_WARNINGS, INFO )
      CALL MORSE_ENABLE( MORSE_ERRORS,   INFO )
*
      RETURN
*
*     End of SERRQR
*
      END