LAPACK  3.5.0
LAPACK: Linear Algebra PACKage
iparmq.f File Reference

Go to the source code of this file.

Functions/Subroutines

integer function iparmq (ISPEC, NAME, OPTS, N, ILO, IHI, LWORK)
 IPARMQ More...
 

Function/Subroutine Documentation

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 its subroutines. It is called whenever 
      ILAENV is called with 12 <= ISPEC <= 16
Parameters
[in]ISPEC
          ISPEC is integer scalar
              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.GT.(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 sweep,
                            xLAQR5 does not accumulate reflections and
                            does not use matrix-matrix multiply to
                            update the far-from-diagonal matrix
                            entries.
                        1:  During the multi-shift QR sweep,
                            xLAQR5 and/or xLAQRaccumulates reflections and uses
                            matrix-matrix multiply to update the
                            far-from-diagonal matrix entries.
                        2:  During the multi-shift QR sweep.
                            xLAQR5 accumulates reflections and takes
                            advantage of 2-by-2 block structure 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 scalar
               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 scalar
               The amount of workspace available.
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Date
November 2011
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).LE.500 is NS.  The default
                        for (IHI-ILO+1).GT.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 216 of file iparmq.f.

216 *
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..--
220 * November 2011
221 *
222 * .. Scalar Arguments ..
223  INTEGER ihi, ilo, ispec, lwork, n
224  CHARACTER name*( * ), opts*( * )
225 *
226 * ================================================================
227 * .. Parameters ..
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 )
234  REAL two
235  parameter( two = 2.0 )
236 * ..
237 * .. Local Scalars ..
238  INTEGER nh, ns
239 * ..
240 * .. Intrinsic Functions ..
241  INTRINSIC log, max, mod, nint, real
242 * ..
243 * .. Executable Statements ..
244  IF( ( ispec.EQ.ishfts ) .OR. ( ispec.EQ.inwin ) .OR.
245  $ ( ispec.EQ.iacc22 ) ) THEN
246 *
247 * ==== Set the number simultaneous shifts ====
248 *
249  nh = ihi - ilo + 1
250  ns = 2
251  IF( nh.GE.30 )
252  $ ns = 4
253  IF( nh.GE.60 )
254  $ ns = 10
255  IF( nh.GE.150 )
256  $ ns = max( 10, nh / nint( log( REAL( NH ) ) / log( two ) ) )
257  IF( nh.GE.590 )
258  $ ns = 64
259  IF( nh.GE.3000 )
260  $ ns = 128
261  IF( nh.GE.6000 )
262  $ ns = 256
263  ns = max( 2, ns-mod( ns, 2 ) )
264  END IF
265 *
266  IF( ispec.EQ.inmin ) THEN
267 *
268 *
269 * ===== Matrices of order smaller than NMIN get sent
270 * . to xLAHQR, the classic double shift algorithm.
271 * . This must be at least 11. ====
272 *
273  iparmq = nmin
274 *
275  ELSE IF( ispec.EQ.inibl ) THEN
276 *
277 * ==== INIBL: skip a multi-shift qr iteration and
278 * . whenever aggressive early deflation finds
279 * . at least (NIBBLE*(window size)/100) deflations. ====
280 *
281  iparmq = nibble
282 *
283  ELSE IF( ispec.EQ.ishfts ) THEN
284 *
285 * ==== NSHFTS: The number of simultaneous shifts =====
286 *
287  iparmq = ns
288 *
289  ELSE IF( ispec.EQ.inwin ) THEN
290 *
291 * ==== NW: deflation window size. ====
292 *
293  IF( nh.LE.knwswp ) THEN
294  iparmq = ns
295  ELSE
296  iparmq = 3*ns / 2
297  END IF
298 *
299  ELSE IF( ispec.EQ.iacc22 ) THEN
300 *
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
306 * . NH=IHI-ILO+1.
307 *
308  iparmq = 0
309  IF( ns.GE.kacmin )
310  $ iparmq = 1
311  IF( ns.GE.k22min )
312  $ iparmq = 2
313 *
314  ELSE
315 * ===== invalid value of ispec =====
316  iparmq = -1
317 *
318  END IF
319 *
320 * ==== End of IPARMQ ====
321 *
integer function iparmq(ISPEC, NAME, OPTS, N, ILO, IHI, LWORK)
IPARMQ
Definition: iparmq.f:216

Here is the caller graph for this function: