slazq3.f.html
来自「famous linear algebra library (LAPACK) p」· HTML 代码 · 共 327 行 · 第 1/2 页
HTML
327 行
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>slazq3.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="SLAZQ3.1"></a><a href="slazq3.f.html#SLAZQ3.1">SLAZQ3</a>( I0, N0, Z, PP, DMIN, SIGMA, DESIG, QMAX, NFAIL,
$ ITER, NDIV, IEEE, TTYPE, DMIN1, DMIN2, DN, DN1,
$ DN2, TAU )
<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, TTYPE
REAL DESIG, DMIN, DMIN1, DMIN2, DN, DN1, DN2, QMAX,
$ SIGMA, TAU
<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="SLAZQ3.22"></a><a href="slazq3.f.html#SLAZQ3.1">SLAZQ3</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"> IEEE (input) LOGICAL
</span><span class="comment">*</span><span class="comment"> Flag for IEEE or non IEEE arithmetic (passed to <a name="SLASQ5.63"></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"> TTYPE (input/output) INTEGER
</span><span class="comment">*</span><span class="comment"> Shift type. TTYPE is passed as an argument in order to save
</span><span class="comment">*</span><span class="comment"> its value between calls to <a name="SLAZQ3.67"></a><a href="slazq3.f.html#SLAZQ3.1">SLAZQ3</a>
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> DMIN1 (input/output) REAL
</span><span class="comment">*</span><span class="comment"> DMIN2 (input/output) REAL
</span><span class="comment">*</span><span class="comment"> DN (input/output) REAL
</span><span class="comment">*</span><span class="comment"> DN1 (input/output) REAL
</span><span class="comment">*</span><span class="comment"> DN2 (input/output) REAL
</span><span class="comment">*</span><span class="comment"> TAU (input/output) REAL
</span><span class="comment">*</span><span class="comment"> These are passed as arguments in order to save their values
</span><span class="comment">*</span><span class="comment"> between calls to <a name="SLAZQ3.76"></a><a href="slazq3.f.html#SLAZQ3.1">SLAZQ3</a>
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> This is a thread safe version of <a name="SLASQ3.78"></a><a href="slasq3.f.html#SLASQ3.1">SLASQ3</a>, which passes TTYPE, DMIN1,
</span><span class="comment">*</span><span class="comment"> DMIN2, DN, DN1. DN2 and TAU through the argument list in place of
</span><span class="comment">*</span><span class="comment"> declaring them in a SAVE statment.
</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
REAL EPS, G, S, SAFMIN, T, TEMP, TOL, TOL2
<span class="comment">*</span><span class="comment"> ..
</span><span class="comment">*</span><span class="comment"> .. External Subroutines ..
</span> EXTERNAL <a name="SLASQ5.96"></a><a href="slasq5.f.html#SLASQ5.1">SLASQ5</a>, <a name="SLASQ6.96"></a><a href="slasq6.f.html#SLASQ6.1">SLASQ6</a>, <a name="SLAZQ4.96"></a><a href="slazq4.f.html#SLAZQ4.1">SLAZQ4</a>
<span class="comment">*</span><span class="comment"> ..
</span><span class="comment">*</span><span class="comment"> .. External Function ..
</span> REAL <a name="SLAMCH.99"></a><a href="slamch.f.html#SLAMCH.1">SLAMCH</a>
EXTERNAL <a name="SLAMCH.100"></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, MIN, SQRT
<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.108"></a><a href="slamch.f.html#SLAMCH.1">SLAMCH</a>( <span class="string">'Precision'</span> )
SAFMIN = <a name="SLAMCH.109"></a><a href="slamch.f.html#SLAMCH.1">SLAMCH</a>( <span class="string">'Safe minimum'</span> )
TOL = EPS*HUNDRD
TOL2 = TOL**2
G = ZERO
<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">
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?