slasq3.f.html
来自「famous linear algebra library (LAPACK) p」· HTML 代码 · 共 320 行 · 第 1/2 页
HTML
320 行
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>slasq3.f</title>
<meta name="generator" content="emacs 21.3.1; htmlfontify 0.20">
<style type="text/css"><!--
body { background: rgb(255, 255, 255); color: rgb(0, 0, 0); font-style: normal; font-weight: 500; font-stretch: normal; font-family: adobe-courier; font-size: 11pt; text-decoration: none; }
span.default { background: rgb(255, 255, 255); color: rgb(0, 0, 0); font-style: normal; font-weight: 500; font-stretch: normal; font-family: adobe-courier; font-size: 11pt; text-decoration: none; }
span.default a { background: rgb(255, 255, 255); color: rgb(0, 0, 0); font-style: normal; font-weight: 500; font-stretch: normal; font-family: adobe-courier; font-size: 11pt; text-decoration: underline; }
span.string { color: rgb(188, 143, 143); background: rgb(255, 255, 255); font-style: normal; font-weight: 500; font-stretch: normal; font-family: adobe-courier; font-size: 11pt; text-decoration: none; }
span.string a { color: rgb(188, 143, 143); background: rgb(255, 255, 255); font-style: normal; font-weight: 500; font-stretch: normal; font-family: adobe-courier; font-size: 11pt; text-decoration: underline; }
span.comment { color: rgb(178, 34, 34); background: rgb(255, 255, 255); font-style: normal; font-weight: 500; font-stretch: normal; font-family: adobe-courier; font-size: 11pt; text-decoration: none; }
span.comment a { color: rgb(178, 34, 34); background: rgb(255, 255, 255); font-style: normal; font-weight: 500; font-stretch: normal; font-family: adobe-courier; font-size: 11pt; text-decoration: underline; }
--></style>
</head>
<body>
<pre>
SUBROUTINE <a name="SLASQ3.1"></a><a href="slasq3.f.html#SLASQ3.1">SLASQ3</a>( I0, N0, Z, PP, DMIN, SIGMA, DESIG, QMAX, NFAIL,
$ ITER, NDIV, IEEE )
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> -- LAPACK auxiliary routine (version 3.1) --
</span><span class="comment">*</span><span class="comment"> Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd..
</span><span class="comment">*</span><span class="comment"> November 2006
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> .. Scalar Arguments ..
</span> LOGICAL IEEE
INTEGER I0, ITER, N0, NDIV, NFAIL, PP
REAL DESIG, DMIN, QMAX, SIGMA
<span class="comment">*</span><span class="comment"> ..
</span><span class="comment">*</span><span class="comment"> .. Array Arguments ..
</span> REAL Z( * )
<span class="comment">*</span><span class="comment"> ..
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> Purpose
</span><span class="comment">*</span><span class="comment"> =======
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> <a name="SLASQ3.20"></a><a href="slasq3.f.html#SLASQ3.1">SLASQ3</a> checks for deflation, computes a shift (TAU) and calls dqds.
</span><span class="comment">*</span><span class="comment"> In case of failure it changes shifts, and tries again until output
</span><span class="comment">*</span><span class="comment"> is positive.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> Arguments
</span><span class="comment">*</span><span class="comment"> =========
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> I0 (input) INTEGER
</span><span class="comment">*</span><span class="comment"> First index.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> N0 (input) INTEGER
</span><span class="comment">*</span><span class="comment"> Last index.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> Z (input) REAL array, dimension ( 4*N )
</span><span class="comment">*</span><span class="comment"> Z holds the qd array.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> PP (input) INTEGER
</span><span class="comment">*</span><span class="comment"> PP=0 for ping, PP=1 for pong.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> DMIN (output) REAL
</span><span class="comment">*</span><span class="comment"> Minimum value of d.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> SIGMA (output) REAL
</span><span class="comment">*</span><span class="comment"> Sum of shifts used in current segment.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> DESIG (input/output) REAL
</span><span class="comment">*</span><span class="comment"> Lower order part of SIGMA
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> QMAX (input) REAL
</span><span class="comment">*</span><span class="comment"> Maximum value of q.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> NFAIL (output) INTEGER
</span><span class="comment">*</span><span class="comment"> Number of times shift was too big.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> ITER (output) INTEGER
</span><span class="comment">*</span><span class="comment"> Number of iterations.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> NDIV (output) INTEGER
</span><span class="comment">*</span><span class="comment"> Number of divisions.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> TTYPE (output) INTEGER
</span><span class="comment">*</span><span class="comment"> Shift type.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> IEEE (input) LOGICAL
</span><span class="comment">*</span><span class="comment"> Flag for IEEE or non IEEE arithmetic (passed to <a name="SLASQ5.64"></a><a href="slasq5.f.html#SLASQ5.1">SLASQ5</a>).
</span><span class="comment">*</span><span class="comment">
</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> REAL CBIAS
PARAMETER ( CBIAS = 1.50E0 )
REAL ZERO, QURTR, HALF, ONE, TWO, HUNDRD
PARAMETER ( ZERO = 0.0E0, QURTR = 0.250E0, HALF = 0.5E0,
$ ONE = 1.0E0, TWO = 2.0E0, HUNDRD = 100.0E0 )
<span class="comment">*</span><span class="comment"> ..
</span><span class="comment">*</span><span class="comment"> .. Local Scalars ..
</span> INTEGER IPN4, J4, N0IN, NN, TTYPE
REAL DMIN1, DMIN2, DN, DN1, DN2, EPS, S, SAFMIN, T,
$ TAU, TEMP, TOL, TOL2
<span class="comment">*</span><span class="comment"> ..
</span><span class="comment">*</span><span class="comment"> .. External Subroutines ..
</span> EXTERNAL <a name="SLASQ4.81"></a><a href="slasq4.f.html#SLASQ4.1">SLASQ4</a>, <a name="SLASQ5.81"></a><a href="slasq5.f.html#SLASQ5.1">SLASQ5</a>, <a name="SLASQ6.81"></a><a href="slasq6.f.html#SLASQ6.1">SLASQ6</a>
<span class="comment">*</span><span class="comment"> ..
</span><span class="comment">*</span><span class="comment"> .. External Function ..
</span> REAL <a name="SLAMCH.84"></a><a href="slamch.f.html#SLAMCH.1">SLAMCH</a>
EXTERNAL <a name="SLAMCH.85"></a><a href="slamch.f.html#SLAMCH.1">SLAMCH</a>
<span class="comment">*</span><span class="comment"> ..
</span><span class="comment">*</span><span class="comment"> .. Intrinsic Functions ..
</span> INTRINSIC ABS, MAX, MIN, SQRT
<span class="comment">*</span><span class="comment"> ..
</span><span class="comment">*</span><span class="comment"> .. Save statement ..
</span> SAVE TTYPE
SAVE DMIN1, DMIN2, DN, DN1, DN2, TAU
<span class="comment">*</span><span class="comment"> ..
</span><span class="comment">*</span><span class="comment"> .. Data statement ..
</span> DATA TTYPE / 0 /
DATA DMIN1 / ZERO /, DMIN2 / ZERO /, DN / ZERO /,
$ DN1 / ZERO /, DN2 / ZERO /, TAU / ZERO /
<span class="comment">*</span><span class="comment"> ..
</span><span class="comment">*</span><span class="comment"> .. Executable Statements ..
</span><span class="comment">*</span><span class="comment">
</span> N0IN = N0
EPS = <a name="SLAMCH.102"></a><a href="slamch.f.html#SLAMCH.1">SLAMCH</a>( <span class="string">'Precision'</span> )
SAFMIN = <a name="SLAMCH.103"></a><a href="slamch.f.html#SLAMCH.1">SLAMCH</a>( <span class="string">'Safe minimum'</span> )
TOL = EPS*HUNDRD
TOL2 = TOL**2
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> Check for deflation.
</span><span class="comment">*</span><span class="comment">
</span> 10 CONTINUE
<span class="comment">*</span><span class="comment">
</span> IF( N0.LT.I0 )
$ RETURN
IF( N0.EQ.I0 )
$ GO TO 20
NN = 4*N0 + PP
IF( N0.EQ.( I0+1 ) )
$ GO TO 40
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> Check whether E(N0-1) is negligible, 1 eigenvalue.
</span><span class="comment">*</span><span class="comment">
</span> IF( Z( NN-5 ).GT.TOL2*( SIGMA+Z( NN-3 ) ) .AND.
$ Z( NN-2*PP-4 ).GT.TOL2*Z( NN-7 ) )
$ GO TO 30
<span class="comment">*</span><span class="comment">
</span> 20 CONTINUE
<span class="comment">*</span><span class="comment">
</span> Z( 4*N0-3 ) = Z( 4*N0+PP-3 ) + SIGMA
N0 = N0 - 1
GO TO 10
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> Check whether E(N0-2) is negligible, 2 eigenvalues.
</span><span class="comment">*</span><span class="comment">
</span> 30 CONTINUE
<span class="comment">*</span><span class="comment">
</span> IF( Z( NN-9 ).GT.TOL2*SIGMA .AND.
$ Z( NN-2*PP-8 ).GT.TOL2*Z( NN-11 ) )
$ GO TO 50
<span class="comment">*</span><span class="comment">
</span> 40 CONTINUE
<span class="comment">*</span><span class="comment">
</span> IF( Z( NN-3 ).GT.Z( NN-7 ) ) THEN
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?