<?xml-stylesheet type="text/xsl" href="../styles/pmathml.xsl"?>
<!-- saved from url=(0014)about:internet -->
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:dsi="http://www.w3.org/1999/xlink" xmlns:m="http://www.w3.org/1998/Math/MathML" xml:space="preserve"><head><meta http-equiv="Content-Type" content="text/html; charset=US-ASCII"/><title>F02BJF : NAG Library, Mark 22</title><link rel="stylesheet" href="../styles/libdoc.css" type="text/css"/><script type="text/javascript">
   function showLevel(_levelId){
    var thisLevel = document.getElementById(_levelId);
    var thisplus = document.getElementById( _levelId.concat('plus'));
    var thisminus = document.getElementById( _levelId.concat('minus'));
    if(thisLevel.style.display != "block"){
     thisLevel.style.display = "block";
     thisplus.style.display = "none";
     thisminus.style.display = "inline";
     }
    else{
     thisLevel.style.display = "none";
     thisminus.style.display = "none";
     thisplus.style.display = "inline";
     }
    }
  </script></head><body><hr/><div><a class="rout" href="../../pdf/F02/f02bjf.pdf">F02BJF (PDF version)</a></div><div><a class="chap" href="f02conts.xml">F02 Chapter Contents</a></div><div><a class="chapint" href="f02intro.xml">F02 Chapter Introduction</a></div>
<div><a class="htmltoc" href="../FRONTMATTER/manconts.xml">NAG Library Manual</a></div><hr/><h1 class="libdoc">NAG Library Routine Document<br/><br/>F02BJF</h1><div class="paramtext"><div class="header"><b>Note:</b>&#160; before using this routine, please read the Users' Note for your implementation to check the interpretation of <span class="bitalic">bold italicised</span> terms and other implementation-dependent details.</div></div> 
<div class="htmltoc">
<h2 class="htmltoc"><span class="htmltochead" onclick="showLevel('htmltoc');"><span class="htmltocplus" id="htmltocplus">+</span><span class="htmltocminus" id="htmltocminus">&#8722;</span></span>&#160;Contents</h2>
<div class="htmltocitem" id="htmltoc">
<div class="htmltoc">
<span class="htmltocplus">&#160;&#160;&#160;</span>
<a class="htmltoc" href="#purpose">1&#160;&#160;<b>Purpose</b></a>
</div><div class="htmltoc">
<span class="htmltocplus">&#160;&#160;&#160;</span>
<a class="htmltoc" href="#specification">2&#160;&#160;<b>Specification</b></a>
</div><div class="htmltoc">
<span class="htmltocplus">&#160;&#160;&#160;</span>
<a class="htmltoc" href="#description">3&#160;&#160;<b>Description</b></a>
</div><div class="htmltoc">
<span class="htmltocplus">&#160;&#160;&#160;</span>
<a class="htmltoc" href="#references">4&#160;&#160;<b>References</b></a>
</div><div class="htmltoc">
<span class="htmltocplus">&#160;&#160;&#160;</span>
<a class="htmltoc" href="#parameters">5&#160;&#160;<b>Parameters</b></a>
</div><div class="htmltoc">
<span class="htmltocplus">&#160;&#160;&#160;</span>
<a class="htmltoc" href="#errors">6&#160;&#160;<b>Error Indicators and Warnings</b></a>
</div><div class="htmltoc">
<span class="htmltocplus">&#160;&#160;&#160;</span>
<a class="htmltoc" href="#accuracy">7&#160;&#160;<b>Accuracy</b></a>
</div><div class="htmltoc">
<span class="htmltocplus">&#160;&#160;&#160;</span>
<a class="htmltoc" href="#fcomments">8&#160;&#160;<b>Further Comments</b></a>
</div><div class="htmltoc">
<span class="htmltoc" onclick="showLevel('tocexample');"><span class="htmltocplus" id="tocexampleplus">+</span><span class="htmltocminus" id="tocexampleminus">&#8722;</span></span>
<a class="htmltoc" href="#example">9&#160;&#160;<b>Example</b></a>
<div class="htmltocitem" id="tocexample">
<div class="htmltoc">
<span class="htmltocplus">&#160;&#160;&#160;</span>
<a class="htmltoc" href="#examtext">9.1&#160;&#160;<b>Program Text</b></a>
</div><div class="htmltoc">
<span class="htmltocplus">&#160;&#160;&#160;</span>
<a class="htmltoc" href="#examdata">9.2&#160;&#160;<b>Program Data</b></a>
</div><div class="htmltoc">
<span class="htmltocplus">&#160;&#160;&#160;</span>
<a class="htmltoc" href="#examresults">9.3&#160;&#160;<b>Program Results</b></a>
</div>
</div>
</div>
</div>
</div><h2 class="standard"><a class="sec" name="purpose" id="purpose"/>1&#160;&#160;Purpose</h2>
<div class="paramtext">F02BJF calculates all the eigenvalues and, if required, all the eigenvectors of the generalized eigenproblem  <m:math><m:mi>A</m:mi><m:mi>x</m:mi><m:mo>=</m:mo><m:mi>&#955;</m:mi><m:mi>B</m:mi><m:mi>x</m:mi></m:math>, where <m:math><m:mi>A</m:mi></m:math>&#160;and <m:math><m:mi>B</m:mi></m:math>&#160;are real, square matrices, using the <m:math><m:mi>Q</m:mi><m:mi>Z</m:mi></m:math>&#160;algorithm.</div><h2 class="standard"><a class="sec" name="specification" id="specification"/>2&#160;&#160;Specification</h2>
<table class="fspec"><tr><td class="tdfspec1">SUBROUTINE&#160;F02BJF&#160;(</td><td class="tdfspec2"><a class="arg" href="#N">N</a>, <a class="arg" href="#A">A</a>, <a class="arg" href="#LDA">LDA</a>, <a class="arg" href="#B">B</a>, <a class="arg" href="#LDB">LDB</a>, <a class="arg" href="#EPS1">EPS1</a>, <a class="arg" href="#ALFR">ALFR</a>, <a class="arg" href="#ALFI">ALFI</a>, <a class="arg" href="#BETA">BETA</a>, <a class="arg" href="#MATV">MATV</a>, <a class="arg" href="#V">V</a>, <a class="arg" href="#LDV">LDV</a>, <a class="arg" href="#ITER">ITER</a>, <a class="arg" href="#IFAIL">IFAIL</a>)</td></tr><tr><td class="tdfspec1">INTEGER</td><td class="tdfspec2">N, LDA, LDB, LDV, ITER(N), IFAIL</td></tr><tr><td class="tdfspec1"><b><i>double&#160;precision</i></b></td><td class="tdfspec2">A(LDA,N), B(LDB,N), EPS1, ALFR(N), ALFI(N), BETA(N), V(LDV,N)</td></tr><tr><td class="tdfspec1">LOGICAL</td><td class="tdfspec2">MATV</td></tr></table><h2 class="standard"><a class="sec" name="description" id="description"/>3&#160;&#160;Description</h2>
<div class="paramtext">All the eigenvalues and, if required, all the eigenvectors of the generalized eigenproblem <m:math><m:mi>A</m:mi><m:mi>x</m:mi><m:mo>=</m:mo><m:mi>&#955;</m:mi>  <m:mi>B</m:mi><m:mi>x</m:mi></m:math>, where <m:math><m:mi>A</m:mi></m:math>&#160;and <m:math><m:mi>B</m:mi></m:math>&#160;are real, square matrices, are determined using the  <m:math><m:mi>Q</m:mi><m:mi>Z</m:mi></m:math>&#160;algorithm.  The <m:math><m:mi>Q</m:mi><m:mi>Z</m:mi></m:math>&#160;algorithm consists of four stages:
<table class="standard-100"><tr>
<td style="width:2.1em;" valign="baseline">(i)</td>
<td valign="top"><m:math><m:mi>A</m:mi></m:math>&#160;is reduced to upper Hessenberg form and at the same time <m:math><m:mi>B</m:mi></m:math>&#160;is reduced to upper triangular form.</td>
</tr><tr>
<td style="width:2.1em;" valign="baseline">(ii)</td>
<td valign="top"><m:math><m:mi>A</m:mi></m:math>&#160;is further reduced to quasi-triangular form while the triangular form of <m:math><m:mi>B</m:mi></m:math>&#160;is maintained.</td>
</tr><tr>
<td style="width:2.1em;" valign="baseline">(iii)</td>
<td valign="top">The quasi-triangular form of <m:math><m:mi>A</m:mi></m:math>&#160;is reduced to triangular form and the eigenvalues extracted.  F02BJF does not actually produce the eigenvalues <m:math><m:msub><m:mi>&#955;</m:mi><m:mi>j</m:mi></m:msub></m:math>, but instead returns  <m:math><m:msub><m:mi>&#945;</m:mi><m:mi>j</m:mi></m:msub></m:math>&#160;and <m:math><m:msub><m:mi>&#946;</m:mi><m:mi>j</m:mi></m:msub></m:math>&#160;such that

<div class="formula"><table class="formula"><tr><td class="formula"><m:math display="block">
<m:msub><m:mi>&#955;</m:mi><m:mi>j</m:mi></m:msub><m:mo>=</m:mo><m:msub><m:mi>&#945;</m:mi><m:mi>j</m:mi></m:msub><m:mo>/</m:mo><m:msub><m:mi>&#946;</m:mi><m:mi>j</m:mi></m:msub><m:mtext>, &#8195;</m:mtext><m:mi>j</m:mi><m:mo>=</m:mo><m:mn>1</m:mn><m:mo>,</m:mo><m:mn>2</m:mn><m:mo>,</m:mo><m:mo>&#8230;</m:mo><m:mo>,</m:mo><m:mi>n</m:mi><m:mtext>.</m:mtext>
</m:math></td><td class="formula2"/></tr></table></div>

The division by <m:math><m:msub><m:mi>&#946;</m:mi><m:mi>j</m:mi></m:msub></m:math>&#160;becomes the responsibility of your program, since <m:math><m:msub><m:mi>&#946;</m:mi><m:mi>j</m:mi></m:msub></m:math>&#160;may be zero, indicating an infinite eigenvalue.  Pairs of complex eigenvalues occur with  <m:math><m:msub><m:mi>&#945;</m:mi><m:mi>j</m:mi></m:msub><m:mo>/</m:mo><m:msub><m:mi>&#946;</m:mi><m:mi>j</m:mi></m:msub></m:math>&#160;and  <m:math><m:msub><m:mi>&#945;</m:mi><m:mrow><m:mi>j</m:mi><m:mo>+</m:mo><m:mn>1</m:mn></m:mrow></m:msub><m:mo>/</m:mo><m:msub><m:mi>&#946;</m:mi><m:mrow><m:mi>j</m:mi><m:mo>+</m:mo><m:mn>1</m:mn></m:mrow></m:msub></m:math>&#160;complex conjugates, even though  <m:math><m:msub><m:mi>&#945;</m:mi><m:mi>j</m:mi></m:msub></m:math>&#160;and <m:math><m:msub><m:mi>&#945;</m:mi><m:mrow><m:mi>j</m:mi><m:mo>+</m:mo><m:mn>1</m:mn></m:mrow></m:msub></m:math>&#160;are not conjugate.</td>
</tr><tr>
<td style="width:2.1em;" valign="baseline">(iv)</td>
<td valign="top">If the eigenvectors are required (<m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#MATV"><m:mi mathcolor="#EE0000" mathvariant="bold">MATV</m:mi></m:maction><m:mo>=</m:mo><m:mi mathvariant="normal">.TRUE.</m:mi></m:math>), they are obtained from the triangular matrices and then transformed back into the original co-ordinate system.</td>
</tr></table>
</div><h2 class="standard"><a class="sec" name="references" id="references"/>4&#160;&#160;References</h2><div class="paramtext"><a name="ref107" id="ref107"/>Moler C B and Stewart G W (1973)  An algorithm for generalized matrix eigenproblems <i>SIAM J. Numer. Anal.</i> <b>10</b> 241&#8211;256 </div>
<div class="paramtext"><a name="ref108" id="ref108"/>Ward R C (1975)  The combination shift <m:math><m:mrow><m:mi>Q</m:mi><m:mi>Z</m:mi></m:mrow></m:math>&#160;algorithm <i>SIAM J. Numer. Anal.</i> <b>12</b> 835&#8211;853 </div>
<div class="paramtext"><a name="ref109" id="ref109"/>Wilkinson J H (1979)  Kronecker's canonical form and the <m:math><m:mrow><m:mi>Q</m:mi><m:mi>Z</m:mi></m:mrow></m:math>&#160;algorithm <i>Linear Algebra Appl.</i> <b>28</b> 285&#8211;303 </div><h2 class="standard"><a class="sec" name="parameters" id="parameters"/>5&#160;&#160;Parameters</h2>
<dl><dt class="paramhead"><a name="N" id="N"/>1: &#160;&#160;&#8194; N &#8211; INTEGER<span class="pclass">Input</span></dt><dd><div class="paramtext"><i>On entry</i>: 



<m:math><m:mi>n</m:mi></m:math>, the order of the matrices <m:math><m:mi>A</m:mi></m:math>&#160;and <m:math><m:mi>B</m:mi></m:math>.</div></dd><dt class="paramhead"><a name="A" id="A"/>2: &#160;&#160;&#8194; A(<a class="arg" href="#LDA">LDA</a>,<a class="arg" href="#N">N</a>) &#8211; <span class="bitalic">double precision</span> array<span class="pclass">Input/Output</span></dt><dd><div class="paramtext"><i>On entry</i>: the <m:math><m:mi>n</m:mi></m:math>&#160;by <m:math><m:mi>n</m:mi></m:math>&#160;matrix <m:math><m:mi>A</m:mi></m:math>.</div>
<div class="paramtext"><i>On exit</i>: <a class="arg" href="#A">A</a> is overwritten.</div></dd><dt class="paramhead"><a name="LDA" id="LDA"/>3: &#160;&#160;&#8194; LDA &#8211; INTEGER<span class="pclass">Input</span></dt><dd><div class="paramtext"><i>On entry</i>: the first dimension of the array <a class="arg" href="#A">A</a> as declared in the (sub)program from which F02BJF is called.</div><div class="paramtext"><i>Constraint</i>:
  <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#LDA"><m:mi mathcolor="#EE0000" mathvariant="bold">LDA</m:mi></m:maction><m:mo>&#8805;</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#N"><m:mi mathcolor="#EE0000" mathvariant="bold">N</m:mi></m:maction></m:math>.
</div></dd><dt class="paramhead"><a name="B" id="B"/>4: &#160;&#160;&#8194; B(<a class="arg" href="#LDB">LDB</a>,<a class="arg" href="#N">N</a>) &#8211; <span class="bitalic">double precision</span> array<span class="pclass">Input/Output</span></dt><dd><div class="paramtext"><i>On entry</i>: the <m:math><m:mi>n</m:mi></m:math>&#160;by <m:math><m:mi>n</m:mi></m:math>&#160;matrix <m:math><m:mi>B</m:mi></m:math>.</div>
<div class="paramtext"><i>On exit</i>: <a class="arg" href="#B">B</a> is overwritten.</div></dd><dt class="paramhead"><a name="LDB" id="LDB"/>5: &#160;&#160;&#8194; LDB &#8211; INTEGER<span class="pclass">Input</span></dt><dd><div class="paramtext"><i>On entry</i>: the first dimension of the array <a class="arg" href="#B">B</a> as declared in the (sub)program from which F02BJF is called.</div><div class="paramtext"><i>Constraint</i>:
  <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#LDB"><m:mi mathcolor="#EE0000" mathvariant="bold">LDB</m:mi></m:maction><m:mo>&#8805;</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#N"><m:mi mathcolor="#EE0000" mathvariant="bold">N</m:mi></m:maction></m:math>.
</div></dd><dt class="paramhead"><a name="EPS1" id="EPS1"/>6: &#160;&#160;&#8194; EPS1 &#8211; <span class="bitalic">double precision</span><span class="pclass">Input</span></dt><dd><div class="paramtext"><i>On entry</i>: the tolerance used to determine negligible elements. 

<dl>
<dt class="paramval"><m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#EPS1"><m:mi mathcolor="#EE0000" mathvariant="bold">EPS1</m:mi></m:maction><m:mo>&gt;</m:mo><m:mn>0.0</m:mn></m:math></dt>
<dd>An element will be considered negligible if it is less than <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#EPS1"><m:mi mathcolor="#EE0000" mathvariant="bold">EPS1</m:mi></m:maction><m:mo>&#215;</m:mo><m:mtext/></m:math>the norm of its matrix.</dd>
<dt class="paramval"><m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#EPS1"><m:mi mathcolor="#EE0000" mathvariant="bold">EPS1</m:mi></m:maction><m:mo>&#8804;</m:mo><m:mn>0.0</m:mn></m:math></dt>
<dd><span class="bitalic">machine precision</span> is used in place of <a class="arg" href="#EPS1">EPS1</a>.</dd></dl>
<div class="paramtext">A positive value of <a class="arg" href="#EPS1">EPS1</a> may result in faster execution but less accurate results.</div>
</div></dd><dt class="paramhead"><a name="ALFR" id="ALFR"/>7: &#160;&#160;&#8194; ALFR(<a class="arg" href="#N">N</a>) &#8211; <span class="bitalic">double precision</span> array<span class="pclass">Output</span></dt><dt class="multi-paramhead"><a name="ALFI" id="ALFI"/>8: &#160;&#160;&#8194; ALFI(<a class="arg" href="#N">N</a>) &#8211; <span class="bitalic">double precision</span> array<span class="pclass">Output</span></dt><dd><div class="paramtext"><i>On exit</i>: the real and imaginary parts of <m:math><m:msub><m:mi>&#945;</m:mi><m:mi>j</m:mi></m:msub></m:math>, for <m:math><m:mi>j</m:mi><m:mo>=</m:mo><m:mn>1</m:mn><m:mo>,</m:mo><m:mn>2</m:mn><m:mo>,</m:mo><m:mo>&#8230;</m:mo><m:mo>,</m:mo><m:mi>n</m:mi></m:math>.</div></dd><dt class="paramhead"><a name="BETA" id="BETA"/>9: &#160;&#160;&#8194; BETA(<a class="arg" href="#N">N</a>) &#8211; <span class="bitalic">double precision</span> array<span class="pclass">Output</span></dt><dd><div class="paramtext"><i>On exit</i>: <m:math><m:msub><m:mi>&#946;</m:mi><m:mi>j</m:mi></m:msub></m:math>, for <m:math><m:mi>j</m:mi><m:mo>=</m:mo><m:mn>1</m:mn><m:mo>,</m:mo><m:mn>2</m:mn><m:mo>,</m:mo><m:mo>&#8230;</m:mo><m:mo>,</m:mo><m:mi>n</m:mi></m:math>.</div></dd><dt class="paramhead"><a name="MATV" id="MATV"/>10: &#8194; MATV &#8211; LOGICAL<span class="pclass">Input</span></dt><dd><div class="paramtext"><i>On entry</i>: must be set .TRUE. if the eigenvectors are required, otherwise .FALSE..</div></dd><dt class="paramhead"><a name="V" id="V"/>11: &#8194; V(<a class="arg" href="#LDV">LDV</a>,<a class="arg" href="#N">N</a>) &#8211; <span class="bitalic">double precision</span> array<span class="pclass">Output</span></dt><dd><div class="paramtext"><i>On exit</i>: if <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#MATV"><m:mi mathcolor="#EE0000" mathvariant="bold">MATV</m:mi></m:maction><m:mo>=</m:mo><m:mi mathvariant="normal">.TRUE.</m:mi></m:math>, 
<table class="standard-90"><tr>
<td style="width:1.5em;" valign="baseline">&#8211;</td>
<td valign="top">if the <m:math><m:mi>j</m:mi></m:math>th eigenvalue is real, the <m:math><m:mi>j</m:mi></m:math>th column of <a class="arg" href="#V">V</a> contains its eigenvector;</td>
</tr><tr>
<td style="width:1.5em;" valign="baseline">&#8211;</td>
<td valign="top">if the <m:math><m:mi>j</m:mi></m:math>th and <m:math><m:mfenced separators=""><m:mi>j</m:mi><m:mo>+</m:mo><m:mn>1</m:mn></m:mfenced></m:math>th eigenvalues form a complex pair, the <m:math><m:mi>j</m:mi></m:math>th and <m:math><m:mfenced separators=""><m:mi>j</m:mi><m:mo>+</m:mo><m:mn>1</m:mn></m:mfenced></m:math>th columns of <a class="arg" href="#V">V</a> contain the real and imaginary parts of the eigenvector associated with the first eigenvalue of the pair. The conjugate of this vector is the eigenvector for the conjugate eigenvalue.</td>
</tr></table> 
<div class="paramtext">Each eigenvector is normalized so that the component of largest modulus is real and the sum of squares of the moduli equal one.</div>
<div class="paramtext">If <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#MATV"><m:mi mathcolor="#EE0000" mathvariant="bold">MATV</m:mi></m:maction><m:mo>=</m:mo><m:mi mathvariant="normal">.FALSE.</m:mi></m:math>, <a class="arg" href="#V">V</a> is not used.</div>
</div></dd><dt class="paramhead"><a name="LDV" id="LDV"/>12: &#8194; LDV &#8211; INTEGER<span class="pclass">Input</span></dt><dd><div class="paramtext"><i>On entry</i>: the first dimension of the array <a class="arg" href="#V">V</a> as declared in the (sub)program from which F02BJF is called.</div><div class="paramtext"><i>Constraint</i>:
  <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#LDV"><m:mi mathcolor="#EE0000" mathvariant="bold">LDV</m:mi></m:maction><m:mo>&#8805;</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#N"><m:mi mathcolor="#EE0000" mathvariant="bold">N</m:mi></m:maction></m:math>.
</div></dd><dt class="paramhead"><a name="ITER" id="ITER"/>13: &#8194; ITER(<a class="arg" href="#N">N</a>) &#8211; INTEGER array<span class="pclass">Output</span></dt><dd><div class="paramtext"><i>On exit</i>: <m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#ITER"><m:mi mathcolor="#EE0000" mathvariant="bold">ITER</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mi>j</m:mi></m:mfenced></m:mrow></m:math>&#160;contains the number of iterations needed to obtain the <m:math><m:mi>j</m:mi></m:math>th eigenvalue. Note that the eigenvalues are obtained in reverse order, starting with the <m:math><m:mi>n</m:mi></m:math>th.</div></dd><dt class="paramhead"><a name="IFAIL" id="IFAIL"/>14: &#8194; IFAIL &#8211; INTEGER<span class="pclass">Input/Output</span></dt><dd>
<div class="paramtext"><i>On entry</i>: <a class="arg" href="#IFAIL">IFAIL</a> must be set to <m:math><m:mn>0</m:mn></m:math>, <m:math><m:mrow><m:mo>-</m:mo><m:mn>1</m:mn></m:mrow><m:mtext>&#8203; or &#8203;</m:mtext><m:mn>1</m:mn></m:math>. If you are unfamiliar with this parameter you should refer to <a class="sec" href="../GENINT/essint.xml#library3">Section 3.3</a> in  the Essential Introduction for details.</div>
<div class="paramtext"><i>On exit</i>: <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#IFAIL"><m:mi mathcolor="#EE0000" mathvariant="bold">IFAIL</m:mi></m:maction><m:mo>=</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#errors"><m:mn mathcolor="#003399" mathvariant="bold">0</m:mn></m:maction></m:math>&#160;unless the routine detects an error (see <a class="sec" href="#errors">Section 6</a>). <div class="paramtext">For environments where it might be inappropriate to halt program execution when an error is detected, the value <m:math><m:mrow><m:mo>-</m:mo><m:mn>1</m:mn></m:mrow><m:mtext>&#8203; or &#8203;</m:mtext><m:mn>1</m:mn></m:math>&#160;is recommended.  If the output of error messages is undesirable, then the value <m:math><m:mn>1</m:mn></m:math>&#160;is recommended.  Otherwise, if you are not familiar with this parameter, the recommended value is <m:math><m:mn>0</m:mn></m:math>.  <b>When the value <m:math><m:mrow><m:mo>-</m:mo><m:mn mathvariant="bold">1</m:mn></m:mrow><m:mtext>&#8203; or &#8203;</m:mtext><m:mn mathvariant="bold">1</m:mn></m:math>&#160;is used it is essential to test the value of <a class="arg" href="#IFAIL">IFAIL</a> on exit.</b></div></div></dd></dl><h2 class="standard"><a class="sec" name="errors" id="errors"/>6&#160;&#160;Error Indicators and Warnings</h2>
<div class="paramtext">If on entry <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#IFAIL"><m:mi mathcolor="#EE0000" mathvariant="bold">IFAIL</m:mi></m:maction><m:mo>=</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#errors"><m:mn mathcolor="#003399" mathvariant="bold">0</m:mn></m:maction></m:math>&#160;or <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#errors"><m:mn mathcolor="#003399" mathvariant="bold">-1</m:mn></m:maction></m:math>, explanatory error messages are output on the current error message unit (as defined by <a class="rout" href="../X04/x04aaf.xml">X04AAF</a>).</div><div class="paramtext">Errors or warnings detected by the routine:</div>
<dl class="ifail">
<dt class="errorhead"><a name="IFeqi" id="IFeqi"/><m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#IFAIL"><m:mi mathcolor="#EE0000" mathvariant="bold">IFAIL</m:mi></m:maction><m:mo>=</m:mo><m:mi>i</m:mi></m:math></dt>
<dd>
<div class="paramtext">More than <m:math><m:mn>30</m:mn><m:mo>&#215;</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#N"><m:mi mathcolor="#EE0000" mathvariant="bold">N</m:mi></m:maction></m:math>&#160;iterations are required to determine all the diagonal <m:math><m:mn>1</m:mn></m:math>&#160;by <m:math><m:mn>1</m:mn></m:math>&#160;or <m:math><m:mn>2</m:mn></m:math>&#160;by <m:math><m:mn>2</m:mn></m:math>&#160;blocks of the quasi-triangular form in the second step of the <m:math><m:mi>Q</m:mi><m:mi>Z</m:mi></m:math>&#160;algorithm.  <a class="arg" href="#IFAIL">IFAIL</a> is set to the index <m:math><m:mi>i</m:mi></m:math>&#160;of the eigenvalue at which this failure occurs.  If the soft failure option is used, <m:math><m:msub><m:mi>&#945;</m:mi><m:mi>j</m:mi></m:msub></m:math>&#160;and <m:math><m:msub><m:mi>&#946;</m:mi><m:mi>j</m:mi></m:msub></m:math>&#160;are correct for <m:math><m:mi>j</m:mi><m:mo>=</m:mo><m:mi>i</m:mi><m:mo>+</m:mo><m:mn>1</m:mn><m:mo>,</m:mo><m:mi>i</m:mi><m:mo>+</m:mo><m:mn>2</m:mn><m:mo>,</m:mo><m:mo>&#8230;</m:mo><m:mo>,</m:mo><m:mi>n</m:mi></m:math>, but <a class="arg" href="#V">V</a> does not contain any correct eigenvectors.</div>
</dd>
</dl><h2 class="standard"><a class="sec" name="accuracy" id="accuracy"/>7&#160;&#160;Accuracy</h2>
<div class="paramtext">The computed eigenvalues are always exact for a problem <m:math><m:mfenced separators=""><m:mi>A</m:mi><m:mo>+</m:mo><m:mi>E</m:mi></m:mfenced><m:mi>x</m:mi><m:mo>=</m:mo><m:mi>&#955;</m:mi><m:mfenced separators=""><m:mi>B</m:mi><m:mo>+</m:mo><m:mi>F</m:mi></m:mfenced><m:mi>x</m:mi></m:math>, where <m:math><m:mfenced open="&#8214;" close="&#8214;" separators=""><m:mi>E</m:mi></m:mfenced><m:mo>/</m:mo><m:mfenced open="&#8214;" close="&#8214;" separators=""><m:mi>A</m:mi></m:mfenced></m:math>&#160;and <m:math><m:mfenced open="&#8214;" close="&#8214;" separators=""><m:mi>F</m:mi></m:mfenced><m:mo>/</m:mo><m:mfenced open="&#8214;" close="&#8214;" separators=""><m:mi>B</m:mi></m:mfenced></m:math>&#160;are both of the order of <m:math><m:mrow><m:mi>max</m:mi><m:mspace width="0.125em"/><m:mfenced separators=""><m:maction actiontype="link" dsi:type="simple" dsi:href="#EPS1"><m:mi mathcolor="#EE0000" mathvariant="bold">EPS1</m:mi></m:maction><m:mo>,</m:mo><m:mi>&#949;</m:mi></m:mfenced></m:mrow></m:math>, <m:math><m:mi>&#949;</m:mi></m:math>&#160;being the <span class="bitalic">machine precision</span>.</div><div class="paramtext"><b>Note:</b>&#160; interpretation of results obtained with the <m:math><m:mi>Q</m:mi><m:mi>Z</m:mi></m:math>&#160;algorithm often requires a clear understanding of the effects of small changes in the original data.  These effects are reviewed in <a class="ref" href="#ref109">Wilkinson (1979)</a>, in relation to the significance of small values of <m:math><m:msub><m:mi>&#945;</m:mi><m:mi>j</m:mi></m:msub></m:math>&#160;and <m:math><m:msub><m:mi>&#946;</m:mi><m:mi>j</m:mi></m:msub></m:math>.  It should be noted that if <m:math><m:msub><m:mi>&#945;</m:mi><m:mi>j</m:mi></m:msub></m:math>&#160;and <m:math><m:msub><m:mi>&#946;</m:mi><m:mi>j</m:mi></m:msub></m:math>&#160;are <b>both</b> small for any <m:math><m:mi>j</m:mi></m:math>, it may be that no reliance can be placed on <b>any</b> of the computed eigenvalues  <m:math><m:msub><m:mi>&#955;</m:mi><m:mi>i</m:mi></m:msub><m:mo>=</m:mo><m:msub><m:mi>&#945;</m:mi><m:mi>i</m:mi></m:msub><m:mo>/</m:mo><m:msub><m:mi>&#946;</m:mi><m:mi>i</m:mi></m:msub></m:math>.  You are recommended to study <a class="ref" href="#ref109">Wilkinson (1979)</a> and, if in difficulty, to seek expert advice on determining the sensitivity of the eigenvalues to perturbations in the data.</div><h2 class="standard"><a class="sec" name="fcomments" id="fcomments"/>8&#160;&#160;Further Comments</h2>
<div class="paramtext">The time taken by F02BJF is approximately proportional to <m:math><m:msup><m:mi>n</m:mi><m:mn>3</m:mn></m:msup></m:math>&#160;and also depends on the value chosen for parameter <a class="arg" href="#EPS1">EPS1</a>.</div><h2 class="standard"><a class="sec" name="example" id="example"/>9&#160;&#160;Example</h2>
<div class="paramtext">This example finds all the eigenvalues and eigenvectors of <m:math><m:mi>A</m:mi><m:mi>x</m:mi><m:mo>=</m:mo><m:mi>&#955;</m:mi><m:mi>B</m:mi><m:mi>x</m:mi></m:math>&#160;where

<div class="formula"><table class="formula"><tr><td class="formula"><m:math display="block">
<m:mi>A</m:mi><m:mo>=</m:mo><m:mfenced><m:mtable columnalign="right">
  <m:mtr>
   <m:mtd><m:mn>3.9</m:mn></m:mtd>
   <m:mtd><m:mn>12.5</m:mn></m:mtd>
   <m:mtd><m:mrow><m:mo>-</m:mo><m:mn>34.5</m:mn></m:mrow></m:mtd>
   <m:mtd><m:mrow><m:mo>-</m:mo><m:mn>0.5</m:mn></m:mrow></m:mtd>
  </m:mtr><m:mtr>
   <m:mtd><m:mn>4.3</m:mn></m:mtd>
   <m:mtd><m:mn>21.5</m:mn></m:mtd>
   <m:mtd><m:mrow><m:mo>-</m:mo><m:mn>47.5</m:mn></m:mrow></m:mtd>
   <m:mtd><m:mn>7.5</m:mn></m:mtd>
  </m:mtr><m:mtr>
   <m:mtd><m:mn>4.3</m:mn></m:mtd>
   <m:mtd><m:mn>21.5</m:mn></m:mtd>
   <m:mtd><m:mrow><m:mo>-</m:mo><m:mn>43.5</m:mn></m:mrow></m:mtd>
   <m:mtd><m:mn>3.5</m:mn></m:mtd>
  </m:mtr><m:mtr>
   <m:mtd><m:mn>4.4</m:mn></m:mtd>
   <m:mtd><m:mn>26.0</m:mn></m:mtd>
   <m:mtd><m:mrow><m:mo>-</m:mo><m:mn>46.0</m:mn></m:mrow></m:mtd>
   <m:mtd><m:mn>6.0</m:mn></m:mtd>
  </m:mtr>
 </m:mtable></m:mfenced>
<m:mtext>&#8195; and &#8195;</m:mtext>
 <m:mi>B</m:mi><m:mo>=</m:mo><m:mfenced><m:mtable columnalign="right">
  <m:mtr>
   <m:mtd><m:mn>1</m:mn></m:mtd>
   <m:mtd><m:mn>2</m:mn></m:mtd>
   <m:mtd><m:mrow><m:mo>-</m:mo><m:mn>3</m:mn></m:mrow></m:mtd>
   <m:mtd><m:mn>1</m:mn></m:mtd>
  </m:mtr><m:mtr>
   <m:mtd><m:mn>1</m:mn></m:mtd>
   <m:mtd><m:mn>3</m:mn></m:mtd>
   <m:mtd><m:mrow><m:mo>-</m:mo><m:mn>5</m:mn></m:mrow></m:mtd>
   <m:mtd><m:mn>4</m:mn></m:mtd>
  </m:mtr><m:mtr>
   <m:mtd><m:mn>1</m:mn></m:mtd>
   <m:mtd><m:mn>3</m:mn></m:mtd>
   <m:mtd><m:mrow><m:mo>-</m:mo><m:mn>4</m:mn></m:mrow></m:mtd>
   <m:mtd><m:mn>3</m:mn></m:mtd>
  </m:mtr><m:mtr>
   <m:mtd><m:mn>1</m:mn></m:mtd>
   <m:mtd><m:mn>3</m:mn></m:mtd>
   <m:mtd><m:mrow><m:mo>-</m:mo><m:mn>4</m:mn></m:mrow></m:mtd>
   <m:mtd><m:mn>4</m:mn></m:mtd>
  </m:mtr>
 </m:mtable></m:mfenced>
<m:mtext>.</m:mtext>
</m:math></td><td class="formula2"/></tr></table></div></div><h3 class="standard"><a class="sec" name="examtext" id="examtext"/>9.1&#160;&#160;Program Text</h3>
<p><a class="verbatimref" href="../../examples/source/f02bjfe.f">Program Text (f02bjfe.f)</a></p><h3 class="standard"><a class="sec" name="examdata" id="examdata"/>9.2&#160;&#160;Program Data</h3>
<p><a class="verbatimref" href="../../examples/data/f02bjfe.d">Program&#160;Data (f02bjfe.d)</a></p><h3 class="standard"><a class="sec" name="examresults" id="examresults"/>9.3&#160;&#160;Program Results</h3>
<p><a class="verbatimref" href="../../examples/baseresults/f02bjfe.r">Program Results (f02bjfe.r)</a></p>
<hr/><div><a class="rout" href="../../pdf/F02/f02bjf.pdf">F02BJF (PDF version)</a></div><div><a class="chap" href="f02conts.xml">F02 Chapter Contents</a></div><div><a class="chapint" href="f02intro.xml">F02 Chapter Introduction</a></div>
<div><a class="htmltoc" href="../FRONTMATTER/manconts.xml">NAG Library Manual</a></div>
<div><hr/><a class="genint" href="../FRONTMATTER/copyright.xml">&#169; The Numerical Algorithms Group Ltd, Oxford, UK. 2009</a></div></body></html>
