claed8.f.html

来自「famous linear algebra library (LAPACK) p」· HTML 代码 · 共 388 行 · 第 1/2 页

HTML
388
字号
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
 <head>
  <title>claed8.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="CLAED8.1"></a><a href="claed8.f.html#CLAED8.1">CLAED8</a>( K, N, QSIZ, Q, LDQ, D, RHO, CUTPNT, Z, DLAMDA,
     $                   Q2, LDQ2, W, INDXP, INDX, INDXQ, PERM, GIVPTR,
     $                   GIVCOL, GIVNUM, INFO )
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  -- LAPACK 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>      INTEGER            CUTPNT, GIVPTR, INFO, K, LDQ, LDQ2, N, QSIZ
      REAL               RHO
<span class="comment">*</span><span class="comment">     ..
</span><span class="comment">*</span><span class="comment">     .. Array Arguments ..
</span>      INTEGER            GIVCOL( 2, * ), INDX( * ), INDXP( * ),
     $                   INDXQ( * ), PERM( * )
      REAL               D( * ), DLAMDA( * ), GIVNUM( 2, * ), W( * ),
     $                   Z( * )
      COMPLEX            Q( LDQ, * ), Q2( LDQ2, * )
<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="CLAED8.24"></a><a href="claed8.f.html#CLAED8.1">CLAED8</a> merges the two sets of eigenvalues together into a single
</span><span class="comment">*</span><span class="comment">  sorted set.  Then it tries to deflate the size of the problem.
</span><span class="comment">*</span><span class="comment">  There are two ways in which deflation can occur:  when two or more
</span><span class="comment">*</span><span class="comment">  eigenvalues are close together or if there is a tiny element in the
</span><span class="comment">*</span><span class="comment">  Z vector.  For each such occurrence the order of the related secular
</span><span class="comment">*</span><span class="comment">  equation problem is reduced by one.
</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">  K      (output) INTEGER
</span><span class="comment">*</span><span class="comment">         Contains the number of non-deflated eigenvalues.
</span><span class="comment">*</span><span class="comment">         This is the order of the related secular equation.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  N      (input) INTEGER
</span><span class="comment">*</span><span class="comment">         The dimension of the symmetric tridiagonal matrix.  N &gt;= 0.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  QSIZ   (input) INTEGER
</span><span class="comment">*</span><span class="comment">         The dimension of the unitary matrix used to reduce
</span><span class="comment">*</span><span class="comment">         the dense or band matrix to tridiagonal form.
</span><span class="comment">*</span><span class="comment">         QSIZ &gt;= N if ICOMPQ = 1.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  Q      (input/output) COMPLEX array, dimension (LDQ,N)
</span><span class="comment">*</span><span class="comment">         On entry, Q contains the eigenvectors of the partially solved
</span><span class="comment">*</span><span class="comment">         system which has been previously updated in matrix
</span><span class="comment">*</span><span class="comment">         multiplies with other partially solved eigensystems.
</span><span class="comment">*</span><span class="comment">         On exit, Q contains the trailing (N-K) updated eigenvectors
</span><span class="comment">*</span><span class="comment">         (those which were deflated) in its last N-K columns.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  LDQ    (input) INTEGER
</span><span class="comment">*</span><span class="comment">         The leading dimension of the array Q.  LDQ &gt;= max( 1, N ).
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  D      (input/output) REAL array, dimension (N)
</span><span class="comment">*</span><span class="comment">         On entry, D contains the eigenvalues of the two submatrices to
</span><span class="comment">*</span><span class="comment">         be combined.  On exit, D contains the trailing (N-K) updated
</span><span class="comment">*</span><span class="comment">         eigenvalues (those which were deflated) sorted into increasing
</span><span class="comment">*</span><span class="comment">         order.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  RHO    (input/output) REAL
</span><span class="comment">*</span><span class="comment">         Contains the off diagonal element associated with the rank-1
</span><span class="comment">*</span><span class="comment">         cut which originally split the two submatrices which are now
</span><span class="comment">*</span><span class="comment">         being recombined. RHO is modified during the computation to
</span><span class="comment">*</span><span class="comment">         the value required by <a name="SLAED3.66"></a><a href="slaed3.f.html#SLAED3.1">SLAED3</a>.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  CUTPNT (input) INTEGER
</span><span class="comment">*</span><span class="comment">         Contains the location of the last eigenvalue in the leading
</span><span class="comment">*</span><span class="comment">         sub-matrix.  MIN(1,N) &lt;= CUTPNT &lt;= N.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  Z      (input) REAL array, dimension (N)
</span><span class="comment">*</span><span class="comment">         On input this vector contains the updating vector (the last
</span><span class="comment">*</span><span class="comment">         row of the first sub-eigenvector matrix and the first row of
</span><span class="comment">*</span><span class="comment">         the second sub-eigenvector matrix).  The contents of Z are
</span><span class="comment">*</span><span class="comment">         destroyed during the updating process.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  DLAMDA (output) REAL array, dimension (N)
</span><span class="comment">*</span><span class="comment">         Contains a copy of the first K eigenvalues which will be used
</span><span class="comment">*</span><span class="comment">         by <a name="SLAED3.80"></a><a href="slaed3.f.html#SLAED3.1">SLAED3</a> to form the secular equation.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  Q2     (output) COMPLEX array, dimension (LDQ2,N)
</span><span class="comment">*</span><span class="comment">         If ICOMPQ = 0, Q2 is not referenced.  Otherwise,
</span><span class="comment">*</span><span class="comment">         Contains a copy of the first K eigenvectors which will be used
</span><span class="comment">*</span><span class="comment">         by <a name="SLAED7.85"></a><a href="slaed7.f.html#SLAED7.1">SLAED7</a> in a matrix multiply (SGEMM) to update the new
</span><span class="comment">*</span><span class="comment">         eigenvectors.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  LDQ2   (input) INTEGER
</span><span class="comment">*</span><span class="comment">         The leading dimension of the array Q2.  LDQ2 &gt;= max( 1, N ).
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  W      (output) REAL array, dimension (N)
</span><span class="comment">*</span><span class="comment">         This will hold the first k values of the final
</span><span class="comment">*</span><span class="comment">         deflation-altered z-vector and will be passed to <a name="SLAED3.93"></a><a href="slaed3.f.html#SLAED3.1">SLAED3</a>.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  INDXP  (workspace) INTEGER array, dimension (N)
</span><span class="comment">*</span><span class="comment">         This will contain the permutation used to place deflated
</span><span class="comment">*</span><span class="comment">         values of D at the end of the array. On output INDXP(1:K)
</span><span class="comment">*</span><span class="comment">         points to the nondeflated D-values and INDXP(K+1:N)
</span><span class="comment">*</span><span class="comment">         points to the deflated eigenvalues.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  INDX   (workspace) INTEGER array, dimension (N)
</span><span class="comment">*</span><span class="comment">         This will contain the permutation used to sort the contents of
</span><span class="comment">*</span><span class="comment">         D into ascending order.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  INDXQ  (input) INTEGER array, dimension (N)
</span><span class="comment">*</span><span class="comment">         This contains the permutation which separately sorts the two
</span><span class="comment">*</span><span class="comment">         sub-problems in D into ascending order.  Note that elements in
</span><span class="comment">*</span><span class="comment">         the second half of this permutation must first have CUTPNT
</span><span class="comment">*</span><span class="comment">         added to their values in order to be accurate.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  PERM   (output) INTEGER array, dimension (N)
</span><span class="comment">*</span><span class="comment">         Contains the permutations (from deflation and sorting) to be
</span><span class="comment">*</span><span class="comment">         applied to each eigenblock.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  GIVPTR (output) INTEGER
</span><span class="comment">*</span><span class="comment">         Contains the number of Givens rotations which took place in
</span><span class="comment">*</span><span class="comment">         this subproblem.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  GIVCOL (output) INTEGER array, dimension (2, N)
</span><span class="comment">*</span><span class="comment">         Each pair of numbers indicates a pair of columns to take place
</span><span class="comment">*</span><span class="comment">         in a Givens rotation.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  GIVNUM (output) REAL array, dimension (2, N)
</span><span class="comment">*</span><span class="comment">         Each number indicates the S value to be used in the
</span><span class="comment">*</span><span class="comment">         corresponding Givens rotation.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  INFO   (output) INTEGER
</span><span class="comment">*</span><span class="comment">          = 0:  successful exit.
</span><span class="comment">*</span><span class="comment">          &lt; 0:  if INFO = -i, the i-th argument had an illegal value.
</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               MONE, ZERO, ONE, TWO, EIGHT
      PARAMETER          ( MONE = -1.0E0, ZERO = 0.0E0, ONE = 1.0E0,
     $                   TWO = 2.0E0, EIGHT = 8.0E0 )
<span class="comment">*</span><span class="comment">     ..
</span><span class="comment">*</span><span class="comment">     .. Local Scalars ..
</span>      INTEGER            I, IMAX, J, JLAM, JMAX, JP, K2, N1, N1P1, N2
      REAL               C, EPS, S, T, TAU, TOL
<span class="comment">*</span><span class="comment">     ..
</span><span class="comment">*</span><span class="comment">     .. External Functions ..
</span>      INTEGER            ISAMAX
      REAL               <a name="SLAMCH.144"></a><a href="slamch.f.html#SLAMCH.1">SLAMCH</a>, <a name="SLAPY2.144"></a><a href="slapy2.f.html#SLAPY2.1">SLAPY2</a>
      EXTERNAL           ISAMAX, <a name="SLAMCH.145"></a><a href="slamch.f.html#SLAMCH.1">SLAMCH</a>, <a name="SLAPY2.145"></a><a href="slapy2.f.html#SLAPY2.1">SLAPY2</a>
<span class="comment">*</span><span class="comment">     ..
</span><span class="comment">*</span><span class="comment">     .. External Subroutines ..
</span>      EXTERNAL           CCOPY, <a name="CLACPY.148"></a><a href="clacpy.f.html#CLACPY.1">CLACPY</a>, CSROT, SCOPY, <a name="SLAMRG.148"></a><a href="slamrg.f.html#SLAMRG.1">SLAMRG</a>, SSCAL,
     $                   <a name="XERBLA.149"></a><a href="xerbla.f.html#XERBLA.1">XERBLA</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">     .. Executable Statements ..
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">     Test the input parameters.
</span><span class="comment">*</span><span class="comment">
</span>      INFO = 0
<span class="comment">*</span><span class="comment">
</span>      IF( N.LT.0 ) THEN
         INFO = -2
      ELSE IF( QSIZ.LT.N ) THEN
         INFO = -3
      ELSE IF( LDQ.LT.MAX( 1, N ) ) THEN
         INFO = -5
      ELSE IF( CUTPNT.LT.MIN( 1, N ) .OR. CUTPNT.GT.N ) THEN
         INFO = -8
      ELSE IF( LDQ2.LT.MAX( 1, N ) ) THEN
         INFO = -12
      END IF
      IF( INFO.NE.0 ) THEN
         CALL <a name="XERBLA.172"></a><a href="xerbla.f.html#XERBLA.1">XERBLA</a>( <span class="string">'<a name="CLAED8.172"></a><a href="claed8.f.html#CLAED8.1">CLAED8</a>'</span>, -INFO )
         RETURN
      END IF
<span class="comment">*</span><span class="comment">

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?