LAPACK  3.9.1
LAPACK: Linear Algebra PACKage

◆ iparmq()

integer function iparmq ( integer  ISPEC,
character, dimension( * )  NAME,
character, dimension( * )  OPTS,
integer  N,
integer  ILO,
integer  IHI,
integer  LWORK 
)

IPARMQ

Download IPARMQ + dependencies [TGZ] [ZIP] [TXT]

Purpose:
      This program sets problem and machine dependent parameters
      useful for xHSEQR and related subroutines for eigenvalue
      problems. It is called whenever
      IPARMQ is called with 12 <= ISPEC <= 16
Parameters
[in]ISPEC
          ISPEC is INTEGER
              ISPEC specifies which tunable parameter IPARMQ should
              return.

              ISPEC=12: (INMIN)  Matrices of order nmin or less
                        are sent directly to xLAHQR, the implicit
                        double shift QR algorithm.  NMIN must be
                        at least 11.

              ISPEC=13: (INWIN)  Size of the deflation window.
                        This is best set greater than or equal to
                        the number of simultaneous shifts NS.
                        Larger matrices benefit from larger deflation
                        windows.

              ISPEC=14: (INIBL) Determines when to stop nibbling and
                        invest in an (expensive) multi-shift QR sweep.
                        If the aggressive early deflation subroutine
                        finds LD converged eigenvalues from an order
                        NW deflation window and LD > (NW*NIBBLE)/100,
                        then the next QR sweep is skipped and early
                        deflation is applied immediately to the
                        remaining active diagonal block.  Setting
                        IPARMQ(ISPEC=14) = 0 causes TTQRE to skip a
                        multi-shift QR sweep whenever early deflation
                        finds a converged eigenvalue.  Setting
                        IPARMQ(ISPEC=14) greater than or equal to 100
                        prevents TTQRE from skipping a multi-shift
                        QR sweep.

              ISPEC=15: (NSHFTS) The number of simultaneous shifts in
                        a multi-shift QR iteration.

              ISPEC=16: (IACC22) IPARMQ is set to 0, 1 or 2 with the
                        following meanings.
                        0:  During the multi-shift QR/QZ sweep,
                            blocked eigenvalue reordering, blocked
                            Hessenberg-triangular reduction,
                            reflections and/or rotations are not
                            accumulated when updating the
                            far-from-diagonal matrix entries.
                        1:  During the multi-shift QR/QZ sweep,
                            blocked eigenvalue reordering, blocked
                            Hessenberg-triangular reduction,
                            reflections and/or rotations are
                            accumulated, and matrix-matrix
                            multiplication is used to update the
                            far-from-diagonal matrix entries.
                        2:  During the multi-shift QR/QZ sweep,
                            blocked eigenvalue reordering, blocked
                            Hessenberg-triangular reduction,
                            reflections and/or rotations are
                            accumulated, and 2-by-2 block structure
                            is exploited during matrix-matrix
                            multiplies.
                        (If xTRMM is slower than xGEMM, then
                        IPARMQ(ISPEC=16)=1 may be more efficient than
                        IPARMQ(ISPEC=16)=2 despite the greater level of
                        arithmetic work implied by the latter choice.)
[in]NAME
          NAME is CHARACTER string
               Name of the calling subroutine
[in]OPTS
          OPTS is CHARACTER string
               This is a concatenation of the string arguments to
               TTQRE.
[in]N
          N is INTEGER
               N is the order of the Hessenberg matrix H.
[in]ILO
          ILO is INTEGER
[in]IHI
          IHI is INTEGER
               It is assumed that H is already upper triangular
               in rows and columns 1:ILO-1 and IHI+1:N.
[in]LWORK
          LWORK is INTEGER
               The amount of workspace available.
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Further Details:
       Little is known about how best to choose these parameters.
       It is possible to use different values of the parameters
       for each of CHSEQR, DHSEQR, SHSEQR and ZHSEQR.

       It is probably best to choose different parameters for
       different matrices and different parameters at different
       times during the iteration, but this has not been
       implemented --- yet.


       The best choices of most of the parameters depend
       in an ill-understood way on the relative execution
       rate of xLAQR3 and xLAQR5 and on the nature of each
       particular eigenvalue problem.  Experiment may be the
       only practical way to determine which choices are most
       effective.

       Following is a list of default values supplied by IPARMQ.
       These defaults may be adjusted in order to attain better
       performance in any particular computational environment.

       IPARMQ(ISPEC=12) The xLAHQR vs xLAQR0 crossover point.
                        Default: 75. (Must be at least 11.)

       IPARMQ(ISPEC=13) Recommended deflation window size.
                        This depends on ILO, IHI and NS, the
                        number of simultaneous shifts returned
                        by IPARMQ(ISPEC=15).  The default for
                        (IHI-ILO+1) <= 500 is NS.  The default
                        for (IHI-ILO+1) > 500 is 3*NS/2.

       IPARMQ(ISPEC=14) Nibble crossover point.  Default: 14.

       IPARMQ(ISPEC=15) Number of simultaneous shifts, NS.
                        a multi-shift QR iteration.

                        If IHI-ILO+1 is ...

                        greater than      ...but less    ... the
                        or equal to ...      than        default is

                                0               30       NS =   2+
                               30               60       NS =   4+
                               60              150       NS =  10
                              150              590       NS =  **
                              590             3000       NS =  64
                             3000             6000       NS = 128
                             6000             infinity   NS = 256

                    (+)  By default matrices of this order are
                         passed to the implicit double shift routine
                         xLAHQR.  See IPARMQ(ISPEC=12) above.   These
                         values of NS are used only in case of a rare
                         xLAHQR failure.

                    (**) The asterisks (**) indicate an ad-hoc
                         function increasing from 10 to 64.

       IPARMQ(ISPEC=16) Select structured matrix multiply.
                        (See ISPEC=16 above for details.)
                        Default: 3.

Definition at line 221 of file iparmq.f.

222 *
223 * -- LAPACK auxiliary routine --
224 * -- LAPACK is a software package provided by Univ. of Tennessee, --
225 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
226 *
227 * .. Scalar Arguments ..
228  INTEGER IHI, ILO, ISPEC, LWORK, N
229  CHARACTER NAME*( * ), OPTS*( * )
230 *
231 * ================================================================
232 * .. Parameters ..
233  INTEGER INMIN, INWIN, INIBL, ISHFTS, IACC22
234  parameter( inmin = 12, inwin = 13, inibl = 14,
235  $ ishfts = 15, iacc22 = 16 )
236  INTEGER NMIN, K22MIN, KACMIN, NIBBLE, KNWSWP
237  parameter( nmin = 75, k22min = 14, kacmin = 14,
238  $ nibble = 14, knwswp = 500 )
239  REAL TWO
240  parameter( two = 2.0 )
241 * ..
242 * .. Local Scalars ..
243  INTEGER NH, NS
244  INTEGER I, IC, IZ
245  CHARACTER SUBNAM*6
246 * ..
247 * .. Intrinsic Functions ..
248  INTRINSIC log, max, mod, nint, real
249 * ..
250 * .. Executable Statements ..
251  IF( ( ispec.EQ.ishfts ) .OR. ( ispec.EQ.inwin ) .OR.
252  $ ( ispec.EQ.iacc22 ) ) THEN
253 *
254 * ==== Set the number simultaneous shifts ====
255 *
256  nh = ihi - ilo + 1
257  ns = 2
258  IF( nh.GE.30 )
259  $ ns = 4
260  IF( nh.GE.60 )
261  $ ns = 10
262  IF( nh.GE.150 )
263  $ ns = max( 10, nh / nint( log( real( nh ) ) / log( two ) ) )
264  IF( nh.GE.590 )
265  $ ns = 64
266  IF( nh.GE.3000 )
267  $ ns = 128
268  IF( nh.GE.6000 )
269  $ ns = 256
270  ns = max( 2, ns-mod( ns, 2 ) )
271  END IF
272 *
273  IF( ispec.EQ.inmin ) THEN
274 *
275 *
276 * ===== Matrices of order smaller than NMIN get sent
277 * . to xLAHQR, the classic double shift algorithm.
278 * . This must be at least 11. ====
279 *
280  iparmq = nmin
281 *
282  ELSE IF( ispec.EQ.inibl ) THEN
283 *
284 * ==== INIBL: skip a multi-shift qr iteration and
285 * . whenever aggressive early deflation finds
286 * . at least (NIBBLE*(window size)/100) deflations. ====
287 *
288  iparmq = nibble
289 *
290  ELSE IF( ispec.EQ.ishfts ) THEN
291 *
292 * ==== NSHFTS: The number of simultaneous shifts =====
293 *
294  iparmq = ns
295 *
296  ELSE IF( ispec.EQ.inwin ) THEN
297 *
298 * ==== NW: deflation window size. ====
299 *
300  IF( nh.LE.knwswp ) THEN
301  iparmq = ns
302  ELSE
303  iparmq = 3*ns / 2
304  END IF
305 *
306  ELSE IF( ispec.EQ.iacc22 ) THEN
307 *
308 * ==== IACC22: Whether to accumulate reflections
309 * . before updating the far-from-diagonal elements
310 * . and whether to use 2-by-2 block structure while
311 * . doing it. A small amount of work could be saved
312 * . by making this choice dependent also upon the
313 * . NH=IHI-ILO+1.
314 *
315 *
316 * Convert NAME to upper case if the first character is lower case.
317 *
318  iparmq = 0
319  subnam = name
320  ic = ichar( subnam( 1: 1 ) )
321  iz = ichar( 'Z' )
322  IF( iz.EQ.90 .OR. iz.EQ.122 ) THEN
323 *
324 * ASCII character set
325 *
326  IF( ic.GE.97 .AND. ic.LE.122 ) THEN
327  subnam( 1: 1 ) = char( ic-32 )
328  DO i = 2, 6
329  ic = ichar( subnam( i: i ) )
330  IF( ic.GE.97 .AND. ic.LE.122 )
331  $ subnam( i: i ) = char( ic-32 )
332  END DO
333  END IF
334 *
335  ELSE IF( iz.EQ.233 .OR. iz.EQ.169 ) THEN
336 *
337 * EBCDIC character set
338 *
339  IF( ( ic.GE.129 .AND. ic.LE.137 ) .OR.
340  $ ( ic.GE.145 .AND. ic.LE.153 ) .OR.
341  $ ( ic.GE.162 .AND. ic.LE.169 ) ) THEN
342  subnam( 1: 1 ) = char( ic+64 )
343  DO i = 2, 6
344  ic = ichar( subnam( i: i ) )
345  IF( ( ic.GE.129 .AND. ic.LE.137 ) .OR.
346  $ ( ic.GE.145 .AND. ic.LE.153 ) .OR.
347  $ ( ic.GE.162 .AND. ic.LE.169 ) )subnam( i:
348  $ i ) = char( ic+64 )
349  END DO
350  END IF
351 *
352  ELSE IF( iz.EQ.218 .OR. iz.EQ.250 ) THEN
353 *
354 * Prime machines: ASCII+128
355 *
356  IF( ic.GE.225 .AND. ic.LE.250 ) THEN
357  subnam( 1: 1 ) = char( ic-32 )
358  DO i = 2, 6
359  ic = ichar( subnam( i: i ) )
360  IF( ic.GE.225 .AND. ic.LE.250 )
361  $ subnam( i: i ) = char( ic-32 )
362  END DO
363  END IF
364  END IF
365 *
366  IF( subnam( 2:6 ).EQ.'GGHRD' .OR.
367  $ subnam( 2:6 ).EQ.'GGHD3' ) THEN
368  iparmq = 1
369  IF( nh.GE.k22min )
370  $ iparmq = 2
371  ELSE IF ( subnam( 4:6 ).EQ.'EXC' ) THEN
372  IF( nh.GE.kacmin )
373  $ iparmq = 1
374  IF( nh.GE.k22min )
375  $ iparmq = 2
376  ELSE IF ( subnam( 2:6 ).EQ.'HSEQR' .OR.
377  $ subnam( 2:5 ).EQ.'LAQR' ) THEN
378  IF( ns.GE.kacmin )
379  $ iparmq = 1
380  IF( ns.GE.k22min )
381  $ iparmq = 2
382  END IF
383 *
384  ELSE
385 * ===== invalid value of ispec =====
386  iparmq = -1
387 *
388  END IF
389 *
390 * ==== End of IPARMQ ====
391 *
integer function iparmq(ISPEC, NAME, OPTS, N, ILO, IHI, LWORK)
IPARMQ
Definition: iparmq.f:222
Here is the caller graph for this function: