3
* =========== DOCUMENTATION ===========
5
* Online html documentation available at
6
* http://www.netlib.org/lapack/explore-html/
9
*> Download IPARMQ + dependencies
10
*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/iparmq.f">
12
*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/iparmq.f">
14
*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/iparmq.f">
21
* INTEGER FUNCTION IPARMQ( ISPEC, NAME, OPTS, N, ILO, IHI, LWORK )
23
* .. Scalar Arguments ..
24
* INTEGER IHI, ILO, ISPEC, LWORK, N
25
* CHARACTER NAME*( * ), OPTS*( * )
33
*> This program sets problem and machine dependent parameters
34
*> useful for xHSEQR and its subroutines. It is called whenever
35
*> ILAENV is called with 12 <= ISPEC <= 16
43
*> ISPEC is integer scalar
44
*> ISPEC specifies which tunable parameter IPARMQ should
47
*> ISPEC=12: (INMIN) Matrices of order nmin or less
48
*> are sent directly to xLAHQR, the implicit
49
*> double shift QR algorithm. NMIN must be
52
*> ISPEC=13: (INWIN) Size of the deflation window.
53
*> This is best set greater than or equal to
54
*> the number of simultaneous shifts NS.
55
*> Larger matrices benefit from larger deflation
58
*> ISPEC=14: (INIBL) Determines when to stop nibbling and
59
*> invest in an (expensive) multi-shift QR sweep.
60
*> If the aggressive early deflation subroutine
61
*> finds LD converged eigenvalues from an order
62
*> NW deflation window and LD.GT.(NW*NIBBLE)/100,
63
*> then the next QR sweep is skipped and early
64
*> deflation is applied immediately to the
65
*> remaining active diagonal block. Setting
66
*> IPARMQ(ISPEC=14) = 0 causes TTQRE to skip a
67
*> multi-shift QR sweep whenever early deflation
68
*> finds a converged eigenvalue. Setting
69
*> IPARMQ(ISPEC=14) greater than or equal to 100
70
*> prevents TTQRE from skipping a multi-shift
73
*> ISPEC=15: (NSHFTS) The number of simultaneous shifts in
74
*> a multi-shift QR iteration.
76
*> ISPEC=16: (IACC22) IPARMQ is set to 0, 1 or 2 with the
77
*> following meanings.
78
*> 0: During the multi-shift QR sweep,
79
*> xLAQR5 does not accumulate reflections and
80
*> does not use matrix-matrix multiply to
81
*> update the far-from-diagonal matrix
83
*> 1: During the multi-shift QR sweep,
84
*> xLAQR5 and/or xLAQRaccumulates reflections and uses
85
*> matrix-matrix multiply to update the
86
*> far-from-diagonal matrix entries.
87
*> 2: During the multi-shift QR sweep.
88
*> xLAQR5 accumulates reflections and takes
89
*> advantage of 2-by-2 block structure during
90
*> matrix-matrix multiplies.
91
*> (If xTRMM is slower than xGEMM, then
92
*> IPARMQ(ISPEC=16)=1 may be more efficient than
93
*> IPARMQ(ISPEC=16)=2 despite the greater level of
94
*> arithmetic work implied by the latter choice.)
99
*> NAME is character string
100
*> Name of the calling subroutine
105
*> OPTS is character string
106
*> This is a concatenation of the string arguments to
112
*> N is integer scalar
113
*> N is the order of the Hessenberg matrix H.
124
*> It is assumed that H is already upper triangular
125
*> in rows and columns 1:ILO-1 and IHI+1:N.
130
*> LWORK is integer scalar
131
*> The amount of workspace available.
137
*> \author Univ. of Tennessee
138
*> \author Univ. of California Berkeley
139
*> \author Univ. of Colorado Denver
142
*> \date November 2011
144
*> \ingroup auxOTHERauxiliary
146
*> \par Further Details:
147
* =====================
151
*> Little is known about how best to choose these parameters.
152
*> It is possible to use different values of the parameters
153
*> for each of CHSEQR, DHSEQR, SHSEQR and ZHSEQR.
155
*> It is probably best to choose different parameters for
156
*> different matrices and different parameters at different
157
*> times during the iteration, but this has not been
158
*> implemented --- yet.
161
*> The best choices of most of the parameters depend
162
*> in an ill-understood way on the relative execution
163
*> rate of xLAQR3 and xLAQR5 and on the nature of each
164
*> particular eigenvalue problem. Experiment may be the
165
*> only practical way to determine which choices are most
168
*> Following is a list of default values supplied by IPARMQ.
169
*> These defaults may be adjusted in order to attain better
170
*> performance in any particular computational environment.
172
*> IPARMQ(ISPEC=12) The xLAHQR vs xLAQR0 crossover point.
173
*> Default: 75. (Must be at least 11.)
175
*> IPARMQ(ISPEC=13) Recommended deflation window size.
176
*> This depends on ILO, IHI and NS, the
177
*> number of simultaneous shifts returned
178
*> by IPARMQ(ISPEC=15). The default for
179
*> (IHI-ILO+1).LE.500 is NS. The default
180
*> for (IHI-ILO+1).GT.500 is 3*NS/2.
182
*> IPARMQ(ISPEC=14) Nibble crossover point. Default: 14.
184
*> IPARMQ(ISPEC=15) Number of simultaneous shifts, NS.
185
*> a multi-shift QR iteration.
187
*> If IHI-ILO+1 is ...
189
*> greater than ...but less ... the
190
*> or equal to ... than default is
197
*> 3000 6000 NS = 128
198
*> 6000 infinity NS = 256
200
*> (+) By default matrices of this order are
201
*> passed to the implicit double shift routine
202
*> xLAHQR. See IPARMQ(ISPEC=12) above. These
203
*> values of NS are used only in case of a rare
206
*> (**) The asterisks (**) indicate an ad-hoc
207
*> function increasing from 10 to 64.
209
*> IPARMQ(ISPEC=16) Select structured matrix multiply.
210
*> (See ISPEC=16 above for details.)
214
* =====================================================================
215
INTEGER FUNCTION IPARMQ( ISPEC, NAME, OPTS, N, ILO, IHI, LWORK )
217
* -- LAPACK auxiliary routine (version 3.4.0) --
218
* -- LAPACK is a software package provided by Univ. of Tennessee, --
219
* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
222
* .. Scalar Arguments ..
223
INTEGER IHI, ILO, ISPEC, LWORK, N
224
CHARACTER NAME*( * ), OPTS*( * )
226
* ================================================================
228
INTEGER INMIN, INWIN, INIBL, ISHFTS, IACC22
229
PARAMETER ( INMIN = 12, INWIN = 13, INIBL = 14,
230
$ ISHFTS = 15, IACC22 = 16 )
231
INTEGER NMIN, K22MIN, KACMIN, NIBBLE, KNWSWP
232
PARAMETER ( NMIN = 75, K22MIN = 14, KACMIN = 14,
233
$ NIBBLE = 14, KNWSWP = 500 )
235
PARAMETER ( TWO = 2.0 )
237
* .. Local Scalars ..
240
* .. Intrinsic Functions ..
241
INTRINSIC LOG, MAX, MOD, NINT, REAL
243
* .. Executable Statements ..
244
IF( ( ISPEC.EQ.ISHFTS ) .OR. ( ISPEC.EQ.INWIN ) .OR.
245
$ ( ISPEC.EQ.IACC22 ) ) THEN
247
* ==== Set the number simultaneous shifts ====
256
$ NS = MAX( 10, NH / NINT( LOG( REAL( NH ) ) / LOG( TWO ) ) )
263
NS = MAX( 2, NS-MOD( NS, 2 ) )
266
IF( ISPEC.EQ.INMIN ) THEN
269
* ===== Matrices of order smaller than NMIN get sent
270
* . to xLAHQR, the classic double shift algorithm.
271
* . This must be at least 11. ====
275
ELSE IF( ISPEC.EQ.INIBL ) THEN
277
* ==== INIBL: skip a multi-shift qr iteration and
278
* . whenever aggressive early deflation finds
279
* . at least (NIBBLE*(window size)/100) deflations. ====
283
ELSE IF( ISPEC.EQ.ISHFTS ) THEN
285
* ==== NSHFTS: The number of simultaneous shifts =====
289
ELSE IF( ISPEC.EQ.INWIN ) THEN
291
* ==== NW: deflation window size. ====
293
IF( NH.LE.KNWSWP ) THEN
299
ELSE IF( ISPEC.EQ.IACC22 ) THEN
301
* ==== IACC22: Whether to accumulate reflections
302
* . before updating the far-from-diagonal elements
303
* . and whether to use 2-by-2 block structure while
304
* . doing it. A small amount of work could be saved
305
* . by making this choice dependent also upon the
315
* ===== invalid value of ispec =====
320
* ==== End of IPARMQ ====