3 integer iparmq_(integer *ispec, char *name__, char *opts, integer *n, integer
4 *ilo, integer *ihi, integer *lwork)
6 /* System generated locals */
7 integer ret_val, i__1, i__2;
10 /* Builtin functions */
11 double log(doublereal);
12 integer i_nint(real *);
18 /* -- LAPACK auxiliary routine (version 3.1) -- */
19 /* Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd.. */
22 /* .. Scalar Arguments .. */
27 /* This program sets problem and machine dependent parameters */
28 /* useful for xHSEQR and its subroutines. It is called whenever */
29 /* ILAENV is called with 12 <= ISPEC <= 16 */
34 /* ISPEC (input) integer scalar */
35 /* ISPEC specifies which tunable parameter IPARMQ should */
38 /* ISPEC=12: (INMIN) Matrices of order nmin or less */
39 /* are sent directly to xLAHQR, the implicit */
40 /* double shift QR algorithm. NMIN must be */
43 /* ISPEC=13: (INWIN) Size of the deflation window. */
44 /* This is best set greater than or equal to */
45 /* the number of simultaneous shifts NS. */
46 /* Larger matrices benefit from larger deflation */
49 /* ISPEC=14: (INIBL) Determines when to stop nibbling and */
50 /* invest in an (expensive) multi-shift QR sweep. */
51 /* If the aggressive early deflation subroutine */
52 /* finds LD converged eigenvalues from an order */
53 /* NW deflation window and LD.GT.(NW*NIBBLE)/100, */
54 /* then the next QR sweep is skipped and early */
55 /* deflation is applied immediately to the */
56 /* remaining active diagonal block. Setting */
57 /* IPARMQ(ISPEC=14) = 0 causes TTQRE to skip a */
58 /* multi-shift QR sweep whenever early deflation */
59 /* finds a converged eigenvalue. Setting */
60 /* IPARMQ(ISPEC=14) greater than or equal to 100 */
61 /* prevents TTQRE from skipping a multi-shift */
64 /* ISPEC=15: (NSHFTS) The number of simultaneous shifts in */
65 /* a multi-shift QR iteration. */
67 /* ISPEC=16: (IACC22) IPARMQ is set to 0, 1 or 2 with the */
68 /* following meanings. */
69 /* 0: During the multi-shift QR sweep, */
70 /* xLAQR5 does not accumulate reflections and */
71 /* does not use matrix-matrix multiply to */
72 /* update the far-from-diagonal matrix */
74 /* 1: During the multi-shift QR sweep, */
75 /* xLAQR5 and/or xLAQRaccumulates reflections and uses */
76 /* matrix-matrix multiply to update the */
77 /* far-from-diagonal matrix entries. */
78 /* 2: During the multi-shift QR sweep. */
79 /* xLAQR5 accumulates reflections and takes */
80 /* advantage of 2-by-2 block structure during */
81 /* matrix-matrix multiplies. */
82 /* (If xTRMM is slower than xGEMM, then */
83 /* IPARMQ(ISPEC=16)=1 may be more efficient than */
84 /* IPARMQ(ISPEC=16)=2 despite the greater level of */
85 /* arithmetic work implied by the latter choice.) */
87 /* NAME (input) character string */
88 /* Name of the calling subroutine */
90 /* OPTS (input) character string */
91 /* This is a concatenation of the string arguments to */
94 /* N (input) integer scalar */
95 /* N is the order of the Hessenberg matrix H. */
97 /* ILO (input) INTEGER */
98 /* IHI (input) INTEGER */
99 /* It is assumed that H is already upper triangular */
100 /* in rows and columns 1:ILO-1 and IHI+1:N. */
102 /* LWORK (input) integer scalar */
103 /* The amount of workspace available. */
105 /* Further Details */
106 /* =============== */
108 /* Little is known about how best to choose these parameters. */
109 /* It is possible to use different values of the parameters */
110 /* for each of CHSEQR, DHSEQR, SHSEQR and ZHSEQR. */
112 /* It is probably best to choose different parameters for */
113 /* different matrices and different parameters at different */
114 /* times during the iteration, but this has not been */
115 /* implemented --- yet. */
118 /* The best choices of most of the parameters depend */
119 /* in an ill-understood way on the relative execution */
120 /* rate of xLAQR3 and xLAQR5 and on the nature of each */
121 /* particular eigenvalue problem. Experiment may be the */
122 /* only practical way to determine which choices are most */
125 /* Following is a list of default values supplied by IPARMQ. */
126 /* These defaults may be adjusted in order to attain better */
127 /* performance in any particular computational environment. */
129 /* IPARMQ(ISPEC=12) The xLAHQR vs xLAQR0 crossover point. */
130 /* Default: 75. (Must be at least 11.) */
132 /* IPARMQ(ISPEC=13) Recommended deflation window size. */
133 /* This depends on ILO, IHI and NS, the */
134 /* number of simultaneous shifts returned */
135 /* by IPARMQ(ISPEC=15). The default for */
136 /* (IHI-ILO+1).LE.500 is NS. The default */
137 /* for (IHI-ILO+1).GT.500 is 3*NS/2. */
139 /* IPARMQ(ISPEC=14) Nibble crossover point. Default: 14. */
141 /* IPARMQ(ISPEC=15) Number of simultaneous shifts, NS. */
142 /* a multi-shift QR iteration. */
144 /* If IHI-ILO+1 is ... */
146 /* greater than ...but less ... the */
147 /* or equal to ... than default is */
152 /* 150 590 NS = ** */
153 /* 590 3000 NS = 64 */
154 /* 3000 6000 NS = 128 */
155 /* 6000 infinity NS = 256 */
157 /* (+) By default matrices of this order are */
158 /* passed to the implicit double shift routine */
159 /* xLAHQR. See IPARMQ(ISPEC=12) above. These */
160 /* values of NS are used only in case of a rare */
161 /* xLAHQR failure. */
163 /* (**) The asterisks (**) indicate an ad-hoc */
164 /* function increasing from 10 to 64. */
166 /* IPARMQ(ISPEC=16) Select structured matrix multiply. */
167 /* (See ISPEC=16 above for details.) */
170 /* ================================================================ */
171 /* .. Parameters .. */
173 /* .. Local Scalars .. */
175 /* .. Intrinsic Functions .. */
177 /* .. Executable Statements .. */
178 if (*ispec == 15 || *ispec == 13 || *ispec == 16) {
180 /* ==== Set the number simultaneous shifts ==== */
182 nh = *ihi - *ilo + 1;
192 r__1 = (real)(log((doublereal) nh) / log(2.));
193 i__1 = 10, i__2 = nh / i_nint(&r__1);
206 i__1 = 2, i__2 = ns - ns % 2;
213 /* ===== Matrices of order smaller than NMIN get sent */
214 /* . to xLAHQR, the classic double shift algorithm. */
215 /* . This must be at least 11. ==== */
219 } else if (*ispec == 14) {
221 /* ==== INIBL: skip a multi-shift qr iteration and */
222 /* . whenever aggressive early deflation finds */
223 /* . at least (NIBBLE*(window size)/100) deflations. ==== */
227 } else if (*ispec == 15) {
229 /* ==== NSHFTS: The number of simultaneous shifts ===== */
233 } else if (*ispec == 13) {
235 /* ==== NW: deflation window size. ==== */
240 ret_val = ns * 3 / 2;
243 } else if (*ispec == 16) {
245 /* ==== IACC22: Whether to accumulate reflections */
246 /* . before updating the far-from-diagonal elements */
247 /* . and whether to use 2-by-2 block structure while */
248 /* . doing it. A small amount of work could be saved */
249 /* . by making this choice dependent also upon the */
250 /* . NH=IHI-ILO+1. */
261 /* ===== invalid value of ispec ===== */
266 /* ==== End of IPARMQ ==== */