LAPACK  3.4.2
LAPACK: Linear Algebra PACKage
 All Files Functions Groups
sdrvrf1.f
Go to the documentation of this file.
1 *> \brief \b SDRVRF1
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 SDRVRF1( NOUT, NN, NVAL, THRESH, A, LDA, ARF, WORK )
12 *
13 * .. Scalar Arguments ..
14 * INTEGER LDA, NN, NOUT
15 * REAL THRESH
16 * ..
17 * .. Array Arguments ..
18 * INTEGER NVAL( NN )
19 * REAL A( LDA, * ), ARF( * ), WORK( * )
20 * ..
21 *
22 *
23 *> \par Purpose:
24 * =============
25 *>
26 *> \verbatim
27 *>
28 *> SDRVRF1 tests the LAPACK RFP routines:
29 *> SLANSF
30 *> \endverbatim
31 *
32 * Arguments:
33 * ==========
34 *
35 *> \param[in] NOUT
36 *> \verbatim
37 *> NOUT is INTEGER
38 *> The unit number for output.
39 *> \endverbatim
40 *>
41 *> \param[in] NN
42 *> \verbatim
43 *> NN is INTEGER
44 *> The number of values of N contained in the vector NVAL.
45 *> \endverbatim
46 *>
47 *> \param[in] NVAL
48 *> \verbatim
49 *> NVAL is INTEGER array, dimension (NN)
50 *> The values of the matrix dimension N.
51 *> \endverbatim
52 *>
53 *> \param[in] THRESH
54 *> \verbatim
55 *> THRESH is REAL
56 *> The threshold value for the test ratios. A result is
57 *> included in the output file if RESULT >= THRESH. To have
58 *> every test ratio printed, use THRESH = 0.
59 *> \endverbatim
60 *>
61 *> \param[out] A
62 *> \verbatim
63 *> A is REAL array, dimension (LDA,NMAX)
64 *> \endverbatim
65 *>
66 *> \param[in] LDA
67 *> \verbatim
68 *> LDA is INTEGER
69 *> The leading dimension of the array A. LDA >= max(1,NMAX).
70 *> \endverbatim
71 *>
72 *> \param[out] ARF
73 *> \verbatim
74 *> ARF is REAL array, dimension ((NMAX*(NMAX+1))/2).
75 *> \endverbatim
76 *>
77 *> \param[out] WORK
78 *> \verbatim
79 *> WORK is REAL array, dimension ( NMAX )
80 *> \endverbatim
81 *
82 * Authors:
83 * ========
84 *
85 *> \author Univ. of Tennessee
86 *> \author Univ. of California Berkeley
87 *> \author Univ. of Colorado Denver
88 *> \author NAG Ltd.
89 *
90 *> \date November 2011
91 *
92 *> \ingroup single_lin
93 *
94 * =====================================================================
95  SUBROUTINE sdrvrf1( NOUT, NN, NVAL, THRESH, A, LDA, ARF, WORK )
96 *
97 * -- LAPACK test routine (version 3.4.0) --
98 * -- LAPACK is a software package provided by Univ. of Tennessee, --
99 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
100 * November 2011
101 *
102 * .. Scalar Arguments ..
103  INTEGER lda, nn, nout
104  REAL thresh
105 * ..
106 * .. Array Arguments ..
107  INTEGER nval( nn )
108  REAL a( lda, * ), arf( * ), work( * )
109 * ..
110 *
111 * =====================================================================
112 * ..
113 * .. Parameters ..
114  REAL one
115  parameter( one = 1.0e+0 )
116  INTEGER ntests
117  parameter( ntests = 1 )
118 * ..
119 * .. Local Scalars ..
120  CHARACTER uplo, cform, norm
121  INTEGER i, iform, iin, iit, info, inorm, iuplo, j, n,
122  + nerrs, nfail, nrun
123  REAL eps, large, norma, normarf, small
124 * ..
125 * .. Local Arrays ..
126  CHARACTER uplos( 2 ), forms( 2 ), norms( 4 )
127  INTEGER iseed( 4 ), iseedy( 4 )
128  REAL result( ntests )
129 * ..
130 * .. External Functions ..
131  REAL slamch, slansy, slansf, slarnd
132  EXTERNAL slamch, slansy, slansf, slarnd
133 * ..
134 * .. External Subroutines ..
135  EXTERNAL strttf
136 * ..
137 * .. Scalars in Common ..
138  CHARACTER*32 srnamt
139 * ..
140 * .. Common blocks ..
141  common / srnamc / srnamt
142 * ..
143 * .. Data statements ..
144  DATA iseedy / 1988, 1989, 1990, 1991 /
145  DATA uplos / 'U', 'L' /
146  DATA forms / 'N', 'T' /
147  DATA norms / 'M', '1', 'I', 'F' /
148 * ..
149 * .. Executable Statements ..
150 *
151 * Initialize constants and the random number seed.
152 *
153  nrun = 0
154  nfail = 0
155  nerrs = 0
156  info = 0
157  DO 10 i = 1, 4
158  iseed( i ) = iseedy( i )
159  10 continue
160 *
161  eps = slamch( 'Precision' )
162  small = slamch( 'Safe minimum' )
163  large = one / small
164  small = small * lda * lda
165  large = large / lda / lda
166 *
167  DO 130 iin = 1, nn
168 *
169  n = nval( iin )
170 *
171  DO 120 iit = 1, 3
172 * Nothing to do for N=0
173  IF ( n .EQ. 0 ) exit
174 
175 * Quick Return if possible
176  IF ( n .EQ. 0 ) exit
177 *
178 * IIT = 1 : random matrix
179 * IIT = 2 : random matrix scaled near underflow
180 * IIT = 3 : random matrix scaled near overflow
181 *
182  DO j = 1, n
183  DO i = 1, n
184  a( i, j) = slarnd( 2, iseed )
185  END DO
186  END DO
187 *
188  IF ( iit.EQ.2 ) THEN
189  DO j = 1, n
190  DO i = 1, n
191  a( i, j) = a( i, j ) * large
192  END DO
193  END DO
194  END IF
195 *
196  IF ( iit.EQ.3 ) THEN
197  DO j = 1, n
198  DO i = 1, n
199  a( i, j) = a( i, j) * small
200  END DO
201  END DO
202  END IF
203 *
204 * Do first for UPLO = 'U', then for UPLO = 'L'
205 *
206  DO 110 iuplo = 1, 2
207 *
208  uplo = uplos( iuplo )
209 *
210 * Do first for CFORM = 'N', then for CFORM = 'C'
211 *
212  DO 100 iform = 1, 2
213 *
214  cform = forms( iform )
215 *
216  srnamt = 'STRTTF'
217  CALL strttf( cform, uplo, n, a, lda, arf, info )
218 *
219 * Check error code from STRTTF
220 *
221  IF( info.NE.0 ) THEN
222  IF( nfail.EQ.0 .AND. nerrs.EQ.0 ) THEN
223  WRITE( nout, * )
224  WRITE( nout, fmt = 9999 )
225  END IF
226  WRITE( nout, fmt = 9998 ) srnamt, uplo, cform, n
227  nerrs = nerrs + 1
228  go to 100
229  END IF
230 *
231  DO 90 inorm = 1, 4
232 *
233 * Check all four norms: 'M', '1', 'I', 'F'
234 *
235  norm = norms( inorm )
236  normarf = slansf( norm, cform, uplo, n, arf, work )
237  norma = slansy( norm, uplo, n, a, lda, work )
238 *
239  result(1) = ( norma - normarf ) / norma / eps
240  nrun = nrun + 1
241 *
242  IF( result(1).GE.thresh ) THEN
243  IF( nfail.EQ.0 .AND. nerrs.EQ.0 ) THEN
244  WRITE( nout, * )
245  WRITE( nout, fmt = 9999 )
246  END IF
247  WRITE( nout, fmt = 9997 ) 'SLANSF',
248  + n, iit, uplo, cform, norm, result(1)
249  nfail = nfail + 1
250  END IF
251  90 continue
252  100 continue
253  110 continue
254  120 continue
255  130 continue
256 *
257 * Print a summary of the results.
258 *
259  IF ( nfail.EQ.0 ) THEN
260  WRITE( nout, fmt = 9996 ) 'SLANSF', nrun
261  ELSE
262  WRITE( nout, fmt = 9995 ) 'SLANSF', nfail, nrun
263  END IF
264  IF ( nerrs.NE.0 ) THEN
265  WRITE( nout, fmt = 9994 ) nerrs, 'SLANSF'
266  END IF
267 *
268  9999 format( 1x,
269 ' *** Error(s) or Failure(s) while testing SLANSF + ***')
270  9998 format( 1x, ' Error in ',a6,' with UPLO=''',a1,''', FORM=''',
271  + a1,''', N=',i5)
272  9997 format( 1x, ' Failure in ',a6,' N=',i5,' TYPE=',i5,' UPLO=''',
273  + a1, ''', FORM =''',a1,''', NORM=''',a1,''', test=',g12.5)
274  9996 format( 1x, 'All tests for ',a6,' auxiliary routine passed the ',
275  + 'threshold ( ',i5,' tests run)')
276  9995 format( 1x, a6, ' auxiliary routine: ',i5,' out of ',i5,
277  + ' tests failed to pass the threshold')
278  9994 format( 26x, i5,' error message recorded (',a6,')')
279 *
280  return
281 *
282 * End of SDRVRF1
283 *
284  END