<?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>F03 Chapter Introduction : NAG Library, Mark 23</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="chap" href="f03conts.xml">F03 Chapter Contents</a></div><div><a class="chapint" href="../../pdf/F03/f03intro.pdf">F03 Chapter Introduction (PDF version)</a></div>
<div><a class="htmltoc" href="../FRONTMATTER/manconts.xml">NAG Library Manual</a></div><hr/><h1 class="libdoc">NAG Library Chapter Introduction<br/><br/>F03 &#8211; Determinants</h1><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="#scope">1&#160;&#160;<b>Scope of the Chapter</b></a>
</div><div class="htmltoc">
<span class="htmltocplus">&#160;&#160;&#160;</span>
<a class="htmltoc" href="#background">2&#160;&#160;<b>Background to the Problems</b></a>
</div><div class="htmltoc">
<span class="htmltocplus">&#160;&#160;&#160;</span>
<a class="htmltoc" href="#available">3&#160;&#160;<b>Recommendations on Choice and Use of Available Routines</b></a>
</div><div class="htmltoc">
<span class="htmltocplus">&#160;&#160;&#160;</span>
<a class="htmltoc" href="#dtree">4&#160;&#160;<b>Decision Trees</b></a>
</div><div class="htmltoc">
<span class="htmltocplus">&#160;&#160;&#160;</span>
<a class="htmltoc" href="#index">5&#160;&#160;<b>Functionality Index</b></a>
</div><div class="htmltoc">
<span class="htmltocplus">&#160;&#160;&#160;</span>
<a class="htmltoc" href="#auxindex">6&#160;&#160;<b>Auxiliary Routines Associated with Library Routine Parameters</b></a>
</div><div class="htmltoc">
<span class="htmltocplus">&#160;&#160;&#160;</span>
<a class="htmltoc" href="#withdrawn">7&#160;&#160;<b>Routines Withdrawn or Scheduled for Withdrawal</b></a>
</div><div class="htmltoc">
<span class="htmltocplus">&#160;&#160;&#160;</span>
<a class="htmltoc" href="#references">8&#160;&#160;<b>References</b></a>
</div>
</div>
</div><h2 class="standard"><a class="sec" name="scope" id="scope"/>1&#160;&#160;Scope of the Chapter</h2>
<div class="paramtext">This chapter is concerned with the calculation of determinants of square matrices.</div><h2 class="standard"><a class="sec" name="background" id="background"/>2&#160;&#160;Background to the Problems</h2>
<div class="paramtext">The routines in this chapter compute the determinant of a square matrix  <m:math><m:mi>A</m:mi></m:math>.  The matrix is assumued to have first been decomposed into triangular factors

<div class="formula"><table class="formula"><tr><td class="formula"><m:math display="block">
 <m:mi>A</m:mi><m:mo>=</m:mo><m:mi>L</m:mi><m:mi>U</m:mi>
 <m:mtext>,</m:mtext>
</m:math></td><td class="formula2"/></tr></table></div>

using routines from <a class="chap" href="../F07/f07conts.xml">Chapter F07</a>.
</div><div class="paramtext">If <m:math><m:mi>A</m:mi></m:math>&#160;is positive definite, then <m:math><m:mi>U</m:mi><m:mo>=</m:mo><m:msup><m:mi>L</m:mi><m:mi mathvariant="normal">T</m:mi></m:msup></m:math>,  and the determinant is the product of the squares of the diagonal elements of <m:math><m:mi>L</m:mi></m:math>.  Otherwise, the routines in this chapter use the Dolittle form of the <m:math><m:mi>L</m:mi><m:mi>U</m:mi></m:math>&#160;decomposition, where <m:math><m:mi>L</m:mi></m:math>&#160;has unit elements on its diagonal.  The determinant is then the product of the diagonal elements of <m:math><m:mi>U</m:mi></m:math>, taking account of possible sign changes due to row interchanges.</div><div class="paramtext">To avoid overflow or underflow in the computation of the determinant, some scaling is associated with each multiplication in the product of the relevant diagonal elements.  The final value is represented by

<div class="formula"><table class="formula"><tr><td class="formula"><m:math display="block">
<m:mrow><m:mi>det</m:mi><m:mo>&#8289;</m:mo><m:mi>A</m:mi></m:mrow><m:mo>=</m:mo><m:mi>d</m:mi><m:mn>1</m:mn><m:mo>&#215;</m:mo><m:msup><m:mn>2</m:mn><m:mrow><m:mi>d</m:mi><m:mn>2</m:mn></m:mrow></m:msup>
</m:math></td><td class="formula2"/></tr></table></div>

where <m:math><m:mi>d</m:mi><m:mn>2</m:mn></m:math>&#160;is an integer and

<div class="formula"><table class="formula"><tr><td class="formula"><m:math display="block">
 <m:mfrac other="small"><m:mn>1</m:mn><m:mn>16</m:mn></m:mfrac><m:mo>&#8804;</m:mo><m:mfenced open="|" close="|" separators=""><m:mi>d</m:mi><m:mn>1</m:mn></m:mfenced><m:mo>&lt;</m:mo><m:mn>1</m:mn>
 <m:mtext>.</m:mtext>
</m:math></td><td class="formula2"/></tr></table></div></div><div class="paramtext">For complex valued determinants the real and imaginary parts are scaled separately.</div><div class="paramtext">Most of the original routines of the chapter were based on those published in the book edited by <a class="ref" href="#ref103">Wilkinson and Reinsch (1971)</a>.  We are very grateful to the late Dr J H Wilkinson FRS for his help and interest during the implementation of this chapter of the Library.</div><h2 class="standard"><a class="sec" name="available" id="available"/>3&#160;&#160;Recommendations on Choice and Use of Available Routines</h2>
<div class="paramtext">It is extremely wasteful of computer time and storage to use an inappropriate routine, for example to use a routine requiring a complex matrix when  <m:math><m:mi>A</m:mi></m:math>&#160;is real.  Most programmers will know whether their matrix is real or complex, but may be less certain whether or not a real symmetric matrix <m:math><m:mi>A</m:mi></m:math>&#160;is positive definite, i.e.,  all eigenvalues of <m:math><m:mi>A</m:mi><m:mo>&gt;</m:mo><m:mn>0</m:mn></m:math>.  A real symmetric matrix  <m:math><m:mi>A</m:mi></m:math>&#160;not known to be positive definite must be treated as a general real matrix.
In all other cases either the band routine  or the general routines must be used.
</div><div class="paramtext">The routines in this chapter are general purpose routines. These give the value of the determinant in its scaled form, <m:math><m:mi>d</m:mi><m:mn>1</m:mn></m:math>&#160;and <m:math><m:mi>d</m:mi><m:mn>2</m:mn></m:math>, given the triangular decomposition of the matrix from a suitable routine from <a class="chap" href="../F07/f07conts.xml">Chapter F07</a>.</div><h2 class="standard"><a class="sec" name="dtree" id="dtree"/>4&#160;&#160;Decision Trees</h2>
<h3 class="sec"><a name="tree1" id="tree1"/>Tree 1</h3>
<table class="dtree">
<tr>
<td class="dtentry">Is <m:math><m:mi>A</m:mi></m:math>&#160;a real matrix?</td>
<td class="dtnobar">_<br/>yes</td>
<td class="dtentry">Is <m:math><m:mi>A</m:mi></m:math>&#160;a symmetric positive definite matrix?</td>
<td class="dtnobar">_<br/>yes</td>
<td class="dtentry">Is <m:math><m:mi>A</m:mi></m:math>&#160;a band matrix?</td>
<td class="dtnobar">_<br/>yes</td>
<td class="dtentry"><a class="rout" href="../F07/f07hdf.xml">F07HDF</a> and <a class="rout" href="../F03/f03bhf.xml">F03BHF</a></td></tr>
<tr>
<td class="dtnobar">|</td>
<td/>
<td class="dtnobar">|</td>
<td/>
<td class="dtnobar">no<br/>|</td>
<td/></tr>
<tr><td class="dtnobar">|</td>
<td/><td class="dtnobar">|</td>
<td/>
<td class="dtentry"><a class="rout" href="../F07/f07fdf.xml">F07FDF</a> and <a class="rout" href="../F03/f03bff.xml">F03BFF</a></td></tr>
<tr>
<td class="dtnobar">|</td>
<td/>
<td class="dtnobar">no<br/>|</td>
<td/></tr>
<tr><td class="dtnobar">|</td>
<td/>
<td class="dtentry"><a class="rout" href="../F07/f07adf.xml">F07ADF</a> and <a class="rout" href="../F03/f03baf.xml">F03BAF</a></td></tr>
<tr>
<td class="dtnobar">no<br/>|</td>
<td/></tr>
<tr>
<td class="dtentry"><a class="rout" href="../F07/f07arf.xml">F07ARF</a> and <a class="rout" href="../F03/f03bnf.xml">F03BNF</a></td></tr></table><h2 class="standard"><a class="sec" name="index" id="index"/>5&#160;&#160;Functionality Index</h2>
<div>
<table style="width:95%"><tr><td style="width:1pt; white-space: no-wrap;"><nobr>Determinants&#160;of&#160;factorized&#160;matrices:</nobr></td><td>&#160;</td><td style="width: 1pt; white-space: no-wrap;"><nobr/></td></tr></table>
<table style="width:95%"><tr><td style="width:1pt; white-space: no-wrap;"><nobr>&#160;&#160;&#160;&#160;complex&#160;matrix</nobr></td><td style="border-bottom: 0.1em dotted black;">&#160;</td><td style="width: 1pt; white-space: no-wrap;"><nobr><a class="rout" href="../F03/f03bnf.xml">F03BNF</a></nobr></td></tr></table>
<table style="width:95%"><tr><td style="width:1pt; white-space: no-wrap;"><nobr>&#160;&#160;&#160;&#160;real&#160;matrix</nobr></td><td style="border-bottom: 0.1em dotted black;">&#160;</td><td style="width: 1pt; white-space: no-wrap;"><nobr><a class="rout" href="../F03/f03baf.xml">F03BAF</a></nobr></td></tr></table>
<table style="width:95%"><tr><td style="width:1pt; white-space: no-wrap;"><nobr>&#160;&#160;&#160;&#160;real&#160;symmetric&#160;band&#160;positive&#160;definite&#160;matrix</nobr></td><td style="border-bottom: 0.1em dotted black;">&#160;</td><td style="width: 1pt; white-space: no-wrap;"><nobr><a class="rout" href="../F03/f03bhf.xml">F03BHF</a></nobr></td></tr></table>
<table style="width:95%"><tr><td style="width:1pt; white-space: no-wrap;"><nobr>&#160;&#160;&#160;&#160;real&#160;symmetric&#160;positive&#160;definite&#160;matrix</nobr></td><td style="border-bottom: 0.1em dotted black;">&#160;</td><td style="width: 1pt; white-space: no-wrap;"><nobr><a class="rout" href="../F03/f03bff.xml">F03BFF</a></nobr></td></tr></table></div><h2 class="standard"><a class="sec" name="auxindex" id="auxindex"/>6&#160;&#160;Auxiliary Routines Associated with Library Routine Parameters</h2>
<div class="paramtext">None.</div><h2 class="standard"><a class="sec" name="withdrawn" id="withdrawn"/>7&#160;&#160;Routines Withdrawn or Scheduled for Withdrawal</h2>
<div class="left-tablediv"><table class="wdrn"><tbody>
<tr><td class="libdoc" valign="top"><b>Withdrawn<br/>Routine</b></td><td class="libdoc" valign="top" align="center"><b>Mark of<br/>Withdrawal</b></td><td class="libdoc" valign="top"><br/><b>Replacement Routine(s)</b></td></tr>
<tr><td class="libdoc" valign="top"><a class="wdrn" href="../GENINT/replace.xml#F03AAF">F03AAF</a></td><td class="libdoc" valign="top" align="center">25</td><td class="libdoc" valign="top"><a class="rout" href="../F07/f07adf.xml">F07ADF (DGETRF)</a> and <a class="rout" href="../F03/f03baf.xml">F03BAF</a></td></tr>
<tr><td class="libdoc" valign="top"><a class="wdrn" href="../GENINT/replace.xml#F03ABF">F03ABF</a></td><td class="libdoc" valign="top" align="center">25</td><td class="libdoc" valign="top"><a class="rout" href="../F07/f07fdf.xml">F07FDF (DPOTRF)</a> and <a class="rout" href="../F03/f03bff.xml">F03BFF</a></td></tr>
<tr><td class="libdoc" valign="top"><a class="wdrn" href="../GENINT/replace.xml#F03ACF">F03ACF</a></td><td class="libdoc" valign="top" align="center">25</td><td class="libdoc" valign="top"><a class="rout" href="../F07/f07hdf.xml">F07HDF (DPBTRF)</a> and <a class="rout" href="../F03/f03bhf.xml">F03BHF</a></td></tr>
<tr><td class="libdoc" valign="top"><a class="wdrn" href="../GENINT/replace.xml#F03ADF">F03ADF</a></td><td class="libdoc" valign="top" align="center">25</td><td class="libdoc" valign="top"><a class="rout" href="../F07/f07arf.xml">F07ARF (ZGETRF)</a> and <a class="rout" href="../F03/f03bnf.xml">F03BNF</a></td></tr>
<tr><td class="libdoc" valign="top"><a class="wdrn" href="../GENINT/replace.xml#F03AEF">F03AEF</a></td><td class="libdoc" valign="top" align="center">25</td><td class="libdoc" valign="top"><a class="rout" href="../F07/f07fdf.xml">F07FDF (DPOTRF)</a> and <a class="rout" href="../F03/f03bff.xml">F03BFF</a></td></tr>
<tr><td class="libdoc" valign="top"><a class="wdrn" href="../GENINT/replace.xml#F03AFF">F03AFF</a></td><td class="libdoc" valign="top" align="center">25</td><td class="libdoc" valign="top"><a class="rout" href="../F07/f07adf.xml">F07ADF (DGETRF)</a> and <a class="rout" href="../F03/f03baf.xml">F03BAF</a></td></tr>
<tr><td class="libdoc" valign="top"><a class="wdrn" href="../GENINT/replace.xml#F03AGF">F03AGF</a></td><td class="libdoc" valign="top" align="center">17</td><td class="libdoc" valign="top"><a class="rout" href="../F07/f07hdf.xml">F07HDF (DPBTRF)</a></td></tr>
<tr><td class="libdoc" valign="top"><a class="wdrn" href="../GENINT/replace.xml#F03AHF">F03AHF</a></td><td class="libdoc" valign="top" align="center">17</td><td class="libdoc" valign="top"><a class="rout" href="../F07/f07arf.xml">F07ARF (ZGETRF)</a></td></tr>
<tr><td class="libdoc" valign="top"><a class="wdrn" href="../GENINT/replace.xml#F03AMF">F03AMF</a></td><td class="libdoc" valign="top" align="center">17</td><td class="libdoc" valign="top"> No replacement; see <a class="chap" href="../F03/f03conts.xml">Chapter F03</a></td></tr></tbody></table></div><h2 class="standard"><a class="sec" name="references" id="references"/>8&#160;&#160;References</h2><div class="paramtext"><a name="ref538" id="ref538"/>Fox L (1964)  <i>An Introduction to Numerical Linear Algebra</i> Oxford University Press </div>
<div class="paramtext"><a name="ref103" id="ref103"/>Wilkinson J H and Reinsch C (1971)  <i>Handbook for Automatic Computation II, Linear Algebra</i> Springer&#8211;Verlag </div><hr/><div><a class="chap" href="f03conts.xml">F03 Chapter Contents</a></div><div><a class="chapint" href="../../pdf/F03/f03intro.pdf">F03 Chapter Introduction (PDF version)</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. 2011</a></div></body></html>