iparmq.f.html
来自「famous linear algebra library (LAPACK) p」· HTML 代码 · 共 276 行 · 第 1/2 页
HTML
276 行
</span><span class="comment">*</span><span class="comment"> by <a name="IPARMQ.122"></a><a href="iparmq.f.html#IPARMQ.1">IPARMQ</a>(ISPEC=15). The default for
</span><span class="comment">*</span><span class="comment"> (IHI-ILO+1).LE.500 is NS. The default
</span><span class="comment">*</span><span class="comment"> for (IHI-ILO+1).GT.500 is 3*NS/2.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> <a name="IPARMQ.126"></a><a href="iparmq.f.html#IPARMQ.1">IPARMQ</a>(ISPEC=14) Nibble crossover point. Default: 14.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> <a name="IPARMQ.128"></a><a href="iparmq.f.html#IPARMQ.1">IPARMQ</a>(ISPEC=15) Number of simultaneous shifts, NS.
</span><span class="comment">*</span><span class="comment"> a multi-shift QR iteration.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> If IHI-ILO+1 is ...
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> greater than ...but less ... the
</span><span class="comment">*</span><span class="comment"> or equal to ... than default is
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> 0 30 NS = 2+
</span><span class="comment">*</span><span class="comment"> 30 60 NS = 4+
</span><span class="comment">*</span><span class="comment"> 60 150 NS = 10
</span><span class="comment">*</span><span class="comment"> 150 590 NS = **
</span><span class="comment">*</span><span class="comment"> 590 3000 NS = 64
</span><span class="comment">*</span><span class="comment"> 3000 6000 NS = 128
</span><span class="comment">*</span><span class="comment"> 6000 infinity NS = 256
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> (+) By default matrices of this order are
</span><span class="comment">*</span><span class="comment"> passed to the implicit double shift routine
</span><span class="comment">*</span><span class="comment"> xLAHQR. See <a name="IPARMQ.146"></a><a href="iparmq.f.html#IPARMQ.1">IPARMQ</a>(ISPEC=12) above. These
</span><span class="comment">*</span><span class="comment"> values of NS are used only in case of a rare
</span><span class="comment">*</span><span class="comment"> xLAHQR failure.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> (**) The asterisks (**) indicate an ad-hoc
</span><span class="comment">*</span><span class="comment"> function increasing from 10 to 64.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> <a name="IPARMQ.153"></a><a href="iparmq.f.html#IPARMQ.1">IPARMQ</a>(ISPEC=16) Select structured matrix multiply.
</span><span class="comment">*</span><span class="comment"> (See ISPEC=16 above for details.)
</span><span class="comment">*</span><span class="comment"> Default: 3.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> ================================================================
</span><span class="comment">*</span><span class="comment"> .. Parameters ..
</span> INTEGER INMIN, INWIN, INIBL, ISHFTS, IACC22
PARAMETER ( INMIN = 12, INWIN = 13, INIBL = 14,
$ ISHFTS = 15, IACC22 = 16 )
INTEGER NMIN, K22MIN, KACMIN, NIBBLE, KNWSWP
PARAMETER ( NMIN = 75, K22MIN = 14, KACMIN = 14,
$ NIBBLE = 14, KNWSWP = 500 )
REAL TWO
PARAMETER ( TWO = 2.0 )
<span class="comment">*</span><span class="comment"> ..
</span><span class="comment">*</span><span class="comment"> .. Local Scalars ..
</span> INTEGER NH, NS
<span class="comment">*</span><span class="comment"> ..
</span><span class="comment">*</span><span class="comment"> .. Intrinsic Functions ..
</span> INTRINSIC LOG, MAX, MOD, NINT, REAL
<span class="comment">*</span><span class="comment"> ..
</span><span class="comment">*</span><span class="comment"> .. Executable Statements ..
</span> IF( ( ISPEC.EQ.ISHFTS ) .OR. ( ISPEC.EQ.INWIN ) .OR.
$ ( ISPEC.EQ.IACC22 ) ) THEN
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> ==== Set the number simultaneous shifts ====
</span><span class="comment">*</span><span class="comment">
</span> NH = IHI - ILO + 1
NS = 2
IF( NH.GE.30 )
$ NS = 4
IF( NH.GE.60 )
$ NS = 10
IF( NH.GE.150 )
$ NS = MAX( 10, NH / NINT( LOG( REAL( NH ) ) / LOG( TWO ) ) )
IF( NH.GE.590 )
$ NS = 64
IF( NH.GE.3000 )
$ NS = 128
IF( NH.GE.6000 )
$ NS = 256
NS = MAX( 2, NS-MOD( NS, 2 ) )
END IF
<span class="comment">*</span><span class="comment">
</span> IF( ISPEC.EQ.INMIN ) THEN
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> ===== Matrices of order smaller than NMIN get sent
</span><span class="comment">*</span><span class="comment"> . to xLAHQR, the classic double shift algorithm.
</span><span class="comment">*</span><span class="comment"> . This must be at least 11. ====
</span><span class="comment">*</span><span class="comment">
</span> <a name="IPARMQ.204"></a><a href="iparmq.f.html#IPARMQ.1">IPARMQ</a> = NMIN
<span class="comment">*</span><span class="comment">
</span> ELSE IF( ISPEC.EQ.INIBL ) THEN
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> ==== INIBL: skip a multi-shift qr iteration and
</span><span class="comment">*</span><span class="comment"> . whenever aggressive early deflation finds
</span><span class="comment">*</span><span class="comment"> . at least (NIBBLE*(window size)/100) deflations. ====
</span><span class="comment">*</span><span class="comment">
</span> <a name="IPARMQ.212"></a><a href="iparmq.f.html#IPARMQ.1">IPARMQ</a> = NIBBLE
<span class="comment">*</span><span class="comment">
</span> ELSE IF( ISPEC.EQ.ISHFTS ) THEN
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> ==== NSHFTS: The number of simultaneous shifts =====
</span><span class="comment">*</span><span class="comment">
</span> <a name="IPARMQ.218"></a><a href="iparmq.f.html#IPARMQ.1">IPARMQ</a> = NS
<span class="comment">*</span><span class="comment">
</span> ELSE IF( ISPEC.EQ.INWIN ) THEN
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> ==== NW: deflation window size. ====
</span><span class="comment">*</span><span class="comment">
</span> IF( NH.LE.KNWSWP ) THEN
<a name="IPARMQ.225"></a><a href="iparmq.f.html#IPARMQ.1">IPARMQ</a> = NS
ELSE
<a name="IPARMQ.227"></a><a href="iparmq.f.html#IPARMQ.1">IPARMQ</a> = 3*NS / 2
END IF
<span class="comment">*</span><span class="comment">
</span> ELSE IF( ISPEC.EQ.IACC22 ) THEN
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> ==== IACC22: Whether to accumulate reflections
</span><span class="comment">*</span><span class="comment"> . before updating the far-from-diagonal elements
</span><span class="comment">*</span><span class="comment"> . and whether to use 2-by-2 block structure while
</span><span class="comment">*</span><span class="comment"> . doing it. A small amount of work could be saved
</span><span class="comment">*</span><span class="comment"> . by making this choice dependent also upon the
</span><span class="comment">*</span><span class="comment"> . NH=IHI-ILO+1.
</span><span class="comment">*</span><span class="comment">
</span> <a name="IPARMQ.239"></a><a href="iparmq.f.html#IPARMQ.1">IPARMQ</a> = 0
IF( NS.GE.KACMIN )
$ <a name="IPARMQ.241"></a><a href="iparmq.f.html#IPARMQ.1">IPARMQ</a> = 1
IF( NS.GE.K22MIN )
$ <a name="IPARMQ.243"></a><a href="iparmq.f.html#IPARMQ.1">IPARMQ</a> = 2
<span class="comment">*</span><span class="comment">
</span> ELSE
<span class="comment">*</span><span class="comment"> ===== invalid value of ispec =====
</span> <a name="IPARMQ.247"></a><a href="iparmq.f.html#IPARMQ.1">IPARMQ</a> = -1
<span class="comment">*</span><span class="comment">
</span> END IF
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> ==== End of <a name="IPARMQ.251"></a><a href="iparmq.f.html#IPARMQ.1">IPARMQ</a> ====
</span><span class="comment">*</span><span class="comment">
</span> END
</pre>
</body>
</html>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?