<?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>F01MCF : 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/F01/f01mcf.pdf">F01MCF (PDF version)</a></div><div><a class="chap" href="f01conts.xml">F01 Chapter Contents</a></div><div><a class="chapint" href="f01intro.xml">F01 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/>F01MCF</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">F01MCF computes the Cholesky factorization of a real symmetric positive-definite variable-bandwidth matrix.</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;F01MCF&#160;(</td><td class="tdfspec2"><a class="arg" href="#N">N</a>, <a class="arg" href="#A">A</a>, <a class="arg" href="#LAL">LAL</a>, <a class="arg" href="#NROW">NROW</a>, <a class="arg" href="#AL">AL</a>, <a class="arg" href="#D">D</a>, <a class="arg" href="#IFAIL">IFAIL</a>)</td></tr><tr><td class="tdfspec1">INTEGER</td><td class="tdfspec2">N, LAL, NROW(N), IFAIL</td></tr><tr><td class="tdfspec1"><b><i>double&#160;precision</i></b></td><td class="tdfspec2">A(LAL), AL(LAL), D(N)</td></tr></table><h2 class="standard"><a class="sec" name="description" id="description"/>3&#160;&#160;Description</h2>
<div class="paramtext">F01MCF determines the unit lower triangular matrix <m:math><m:mi>L</m:mi></m:math>&#160;and the diagonal matrix <m:math><m:mi>D</m:mi></m:math>&#160;in the Cholesky factorization <m:math><m:mi>A</m:mi><m:mo>=</m:mo><m:mi>L</m:mi><m:mi>D</m:mi><m:msup><m:mi>L</m:mi><m:mi mathvariant="normal">T</m:mi></m:msup></m:math>&#160;of a symmetric positive-definite variable-bandwidth matrix <m:math><m:mi>A</m:mi></m:math>&#160;of order <m:math><m:mi>n</m:mi></m:math>.  (Such a matrix is sometimes called a &#8216;sky-line&#8217; matrix.)</div><div class="paramtext">The matrix <m:math><m:mi>A</m:mi></m:math>&#160;is represented by the elements lying within the <b>envelope</b> of its lower triangular part, that is, between the first nonzero of each row and the diagonal (see <a class="sec" href="#example">Section 9</a> for an example).  The <b>width</b>
<m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#NROW"><m:mi mathcolor="#EE0000" mathvariant="bold">NROW</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mi>i</m:mi></m:mfenced></m:mrow></m:math>&#160;of the <m:math><m:mi>i</m:mi></m:math>th row is the number of elements between the first nonzero element and the element on the diagonal, inclusive.  Although, of course, any matrix possesses an envelope as defined, this routine is primarily intended for the factorization of symmetric positive-definite matrices with an <b>average</b> bandwidth which is small compared with <m:math><m:mi>n</m:mi></m:math>&#160;(also see <a class="sec" href="#fcomments">Section 8</a>).</div><div class="paramtext">The method is based on the property that during Cholesky factorization there is no fill-in outside the envelope.</div><div class="paramtext">The determination of <m:math><m:mi>L</m:mi></m:math>&#160;and <m:math><m:mi>D</m:mi></m:math>&#160;is normally the first of two steps in the solution of the system of equations <m:math><m:mi>A</m:mi><m:mi>x</m:mi><m:mo>=</m:mo><m:mi>b</m:mi></m:math>.  The remaining step, viz. the solution of <m:math><m:mi>L</m:mi><m:mi>D</m:mi><m:msup><m:mi>L</m:mi><m:mi mathvariant="normal">T</m:mi></m:msup><m:mi>x</m:mi><m:mo>=</m:mo><m:mi>b</m:mi></m:math>, may be carried out using <a class="rout" href="../F04/f04mcf.xml">F04MCF</a>.</div><h2 class="standard"><a class="sec" name="references" id="references"/>4&#160;&#160;References</h2><div class="paramtext"><a name="ref102" id="ref102"/>Jennings A (1966)  A compact storage scheme for the solution of symmetric linear simultaneous equations <i>Comput. J.</i> <b>9</b> 281&#8211;285 </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><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 matrix <m:math><m:mi>A</m:mi></m:math>.</div><div class="paramtext"><i>Constraint</i>:
  <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#N"><m:mi mathcolor="#EE0000" mathvariant="bold">N</m:mi></m:maction><m:mo>&#8805;</m:mo><m:mn>1</m:mn></m:math>.
</div></dd><dt class="paramhead"><a name="A" id="A"/>2: &#160;&#160;&#8194; A(<a class="arg" href="#LAL">LAL</a>) &#8211; <span class="bitalic">double precision</span> array<span class="pclass">Input</span></dt><dd><div class="paramtext"><i>On entry</i>: the elements within the envelope of the lower triangle of the positive-definite symmetric matrix <m:math><m:mi>A</m:mi></m:math>, taken in row by row order. The following code assigns the matrix elements within the envelope to the correct elements of the array:

<pre class="verbatim">
       K = 0
       DO 20 I = 1, N
          DO 10 J = I-NROW(I)+1, I
             K = K + 1
             A(K) = matrix (I,J)
    10    CONTINUE
    20 CONTINUE </pre><div class="paramtext">See also <a class="sec" href="#fcomments">Section 8</a>.</div>
</div></dd><dt class="paramhead"><a name="LAL" id="LAL"/>3: &#160;&#160;&#8194; LAL &#8211; INTEGER<span class="pclass">Input</span></dt><dd><div class="paramtext"><i>On entry</i>: the dimension of the arrays  <a class="arg" href="#A">A</a> and <a class="arg" href="#AL">AL</a> as declared in the (sub)program from which F01MCF is called.</div><div class="paramtext"><i>Constraint</i>:
  <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#LAL"><m:mi mathcolor="#EE0000" mathvariant="bold">LAL</m:mi></m:maction><m:mo>&#8805;</m:mo><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#NROW"><m:mi mathcolor="#EE0000" mathvariant="bold">NROW</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mn>1</m:mn></m:mfenced></m:mrow><m:mo>+</m:mo><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#NROW"><m:mi mathcolor="#EE0000" mathvariant="bold">NROW</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mn>2</m:mn></m:mfenced></m:mrow><m:mo>+</m:mo><m:mo>&#8230;</m:mo><m:mo>+</m:mo><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#NROW"><m:mi mathcolor="#EE0000" mathvariant="bold">NROW</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mi>n</m:mi></m:mfenced></m:mrow></m:math>.
</div></dd><dt class="paramhead"><a name="NROW" id="NROW"/>4: &#160;&#160;&#8194; NROW(<a class="arg" href="#N">N</a>) &#8211; INTEGER array<span class="pclass">Input</span></dt><dd><div class="paramtext"><i>On entry</i>: <m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#NROW"><m:mi mathcolor="#EE0000" mathvariant="bold">NROW</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mi>i</m:mi></m:mfenced></m:mrow></m:math>&#160;must contain the width of row <m:math><m:mi>i</m:mi></m:math>&#160;of the matrix <m:math><m:mi>A</m:mi></m:math>, i.e., the number of elements between the first (leftmost) nonzero element and the element on the diagonal, inclusive.</div><div class="paramtext"><i>Constraint</i>:
  <m:math><m:mn>1</m:mn><m:mo>&#8804;</m:mo><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#NROW"><m:mi mathcolor="#EE0000" mathvariant="bold">NROW</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mi mathvariant="italic">i</m:mi></m:mfenced></m:mrow><m:mo>&#8804;</m:mo><m:mi mathvariant="italic">i</m:mi></m:math>,  for <m:math><m:mi mathvariant="italic">i</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="AL" id="AL"/>5: &#160;&#160;&#8194; AL(<a class="arg" href="#LAL">LAL</a>) &#8211; <span class="bitalic">double precision</span> array<span class="pclass">Output</span></dt><dd><div class="paramtext"><i>On exit</i>: the elements within the envelope of the lower triangular matrix <m:math><m:mi>L</m:mi></m:math>, taken in row by row order. The envelope of <m:math><m:mi>L</m:mi></m:math>&#160;is identical to that of the lower triangle of <m:math><m:mi>A</m:mi></m:math>. The unit diagonal elements of <m:math><m:mi>L</m:mi></m:math>&#160;are stored explicitly. See also <a class="sec" href="#fcomments">Section 8</a>.</div></dd><dt class="paramhead"><a name="D" id="D"/>6: &#160;&#160;&#8194; D(<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 diagonal elements of the diagonal matrix <m:math><m:mi>D</m:mi></m:math>. Note that the determinant of <m:math><m:mi>A</m:mi></m:math>&#160;is equal to the product of these diagonal elements. If the value of the determinant is required it should not be determined by forming the product explicitly, because of the possibility of overflow or underflow. The logarithm of the determinant may safely be formed from the sum of the logarithms of the diagonal elements.</div></dd><dt class="paramhead"><a name="IFAIL" id="IFAIL"/>7: &#160;&#160;&#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="IFeq1" id="IFeq1"/><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:mn>1</m:mn></m:math></dt>
<dd>
<table class="ifail"><tr><td class="ifail1">On&#160;entry,</td><td class="ifail2-90"><m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#N"><m:mi mathcolor="#EE0000" mathvariant="bold">N</m:mi></m:maction><m:mo>&lt;</m:mo><m:mn>1</m:mn></m:math>,</td></tr><tr><td class="ifail1">or</td><td class="ifail2-90">for some <m:math><m:mi>i</m:mi></m:math>, <m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#NROW"><m:mi mathcolor="#EE0000" mathvariant="bold">NROW</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mi>i</m:mi></m:mfenced></m:mrow><m:mo>&lt;</m:mo><m:mn>1</m:mn></m:math>&#160;or <m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#NROW"><m:mi mathcolor="#EE0000" mathvariant="bold">NROW</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mi>i</m:mi></m:mfenced></m:mrow><m:mo>&gt;</m:mo><m:mi>i</m:mi></m:math>,</td></tr><tr><td class="ifail1">or</td><td class="ifail2-90"><m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#LAL"><m:mi mathcolor="#EE0000" mathvariant="bold">LAL</m:mi></m:maction><m:mo>&lt;</m:mo><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#NROW"><m:mi mathcolor="#EE0000" mathvariant="bold">NROW</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mn>1</m:mn></m:mfenced></m:mrow><m:mo>+</m:mo><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#NROW"><m:mi mathcolor="#EE0000" mathvariant="bold">NROW</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mn>2</m:mn></m:mfenced></m:mrow><m:mo>+</m:mo><m:mo>&#8230;</m:mo><m:mo>+</m:mo><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#NROW"><m:mi mathcolor="#EE0000" mathvariant="bold">NROW</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:maction actiontype="link" dsi:type="simple" dsi:href="#N"><m:mi mathcolor="#EE0000" mathvariant="bold">N</m:mi></m:maction></m:mfenced></m:mrow></m:math>.</td></tr></table>
</dd>
</dl><dl class="ifail">
<dt class="errorhead"><a name="IFeq2" id="IFeq2"/><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:mn>2</m:mn></m:math></dt>
<dd>
<div class="paramtext"><m:math><m:mi>A</m:mi></m:math>&#160;is not positive-definite, or this property has been destroyed by rounding errors.  The factorization has not been completed.</div>
</dd>
</dl><dl class="ifail">
<dt class="errorhead"><a name="IFeq3" id="IFeq3"/><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:mn>3</m:mn></m:math></dt>
<dd>
<div class="paramtext"><m:math><m:mi>A</m:mi></m:math>&#160;is not positive-definite, or this property has been destroyed by rounding errors.  The factorization has been completed but may be very inaccurate (see <a class="sec" href="#accuracy">Section 7</a>).</div>
</dd>
</dl><h2 class="standard"><a class="sec" name="accuracy" id="accuracy"/>7&#160;&#160;Accuracy</h2>
<div class="paramtext">If <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;on exit, then the <b>computed</b>
<m:math><m:mi>L</m:mi></m:math>&#160;and <m:math><m:mi>D</m:mi></m:math>&#160;satisfy the relation <m:math><m:mi>L</m:mi><m:mi>D</m:mi><m:msup><m:mi>L</m:mi><m:mi mathvariant="normal">T</m:mi></m:msup><m:mo>=</m:mo><m:mi>A</m:mi><m:mo>+</m:mo><m:mi>F</m:mi></m:math>, where

<div class="formula"><table class="formula"><tr><td class="formula"><m:math display="block">
 <m:msub><m:mfenced open="&#8214;" close="&#8214;" separators=""><m:mi>F</m:mi></m:mfenced><m:mn>2</m:mn></m:msub>
 <m:mo>&#8804;</m:mo>
 <m:mi>k</m:mi><m:msup><m:mi>m</m:mi><m:mn>2</m:mn></m:msup>
 <m:mi>&#949;</m:mi>
 <m:mo>&#215;</m:mo>
 <m:munder><m:mi mathvariant="normal">max</m:mi><m:mi>i</m:mi></m:munder><m:mspace width="0.25em"/>
 <m:msub><m:mi>a</m:mi><m:mrow><m:mi>i</m:mi><m:mi>i</m:mi></m:mrow></m:msub>
</m:math></td><td class="formula2"/></tr></table></div>

and

<div class="formula"><table class="formula"><tr><td class="formula"><m:math display="block">
 <m:msub><m:mfenced open="&#8214;" close="&#8214;" separators=""><m:mi>F</m:mi></m:mfenced><m:mn>2</m:mn></m:msub>
 <m:mo>&#8804;</m:mo>
 <m:mi>k</m:mi><m:msup><m:mi>m</m:mi><m:mn>2</m:mn></m:msup>
 <m:mi>&#949;</m:mi>
 <m:mo>&#215;</m:mo>
 <m:msub><m:mfenced open="&#8214;" close="&#8214;" separators=""><m:mi>A</m:mi></m:mfenced><m:mn>2</m:mn></m:msub>
 <m:mtext>,</m:mtext>
</m:math></td><td class="formula2"/></tr></table></div>

where <m:math><m:mi>k</m:mi></m:math>&#160;is a constant of order unity, <m:math><m:mi>m</m:mi></m:math>&#160;is the largest value of <m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#NROW"><m:mi mathcolor="#EE0000" mathvariant="bold">NROW</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mi>i</m:mi></m:mfenced></m:mrow></m:math>, and <m:math><m:mi>&#949;</m:mi></m:math>&#160;is the <span class="bitalic">machine precision</span>.  See pages 25&#8211;27 and 54&#8211;55 of <a class="ref" href="#ref103">Wilkinson and Reinsch (1971)</a>.  If <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="#IFeq3"><m:mn mathcolor="#003399" mathvariant="bold">3</m:mn></m:maction></m:math>&#160;on exit, then the factorization has been completed although the matrix was not positive-definite.  However the factorization may be very inaccurate and should be used only with great caution.  For instance, if it is used to solve a set of equations <m:math><m:mi>A</m:mi><m:mi>x</m:mi><m:mo>=</m:mo><m:mi>b</m:mi></m:math>&#160;using <a class="rout" href="../F04/f04mcf.xml">F04MCF</a>, the residual vector <m:math><m:mi>b</m:mi><m:mo>-</m:mo><m:mi>A</m:mi><m:mi>x</m:mi></m:math>&#160;should be checked.</div><h2 class="standard"><a class="sec" name="fcomments" id="fcomments"/>8&#160;&#160;Further Comments</h2>
<div class="paramtext">The time taken by F01MCF is approximately proportional to the sum of squares of the values of <m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#NROW"><m:mi mathcolor="#EE0000" mathvariant="bold">NROW</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mi>i</m:mi></m:mfenced></m:mrow></m:math>.</div><div class="paramtext">The distribution of row widths may be very non-uniform without undue loss of efficiency.  Moreover, the routine has been designed to be as competitive as possible in speed with routines designed for full or uniformly banded matrices, when applied to such matrices.</div><div class="paramtext">Unless otherwise stated in the <a class="url" href="http://www.nag.co.uk/doc/inun/fl22.html">Users' Note</a> for your implementation, the routine may be called with the same actual array supplied for parameters <a class="arg" href="#A">A</a> and <a class="arg" href="#AL">AL</a>, in which case <m:math><m:mi>L</m:mi></m:math>&#160;overwrites the lower triangle of <a class="arg" href="#A">A</a>.  However this is not standard Fortran 77 and may not work in all implementations.</div><h2 class="standard"><a class="sec" name="example" id="example"/>9&#160;&#160;Example</h2>
<div class="paramtext">This example obtains the Cholesky factorization of the symmetric matrix, whose lower triangle is:

<div class="formula"><table class="formula"><tr><td class="formula"><m:math display="block">
 <m:mfenced><m:mtable columnalign="right">
  <m:mtr>
   <m:mtd><m:mn>1</m:mn></m:mtd>
   <m:mtd/>
   <m:mtd/>
   <m:mtd/>
   <m:mtd/>
   <m:mtd/>
  </m:mtr><m:mtr>
   <m:mtd><m:mn>2</m:mn></m:mtd>
   <m:mtd><m:mn>5</m:mn></m:mtd>
   <m:mtd/>
   <m:mtd/>
   <m:mtd/>
   <m:mtd/>
  </m:mtr><m:mtr>
   <m:mtd><m:mn>0</m:mn></m:mtd>
   <m:mtd><m:mn>3</m:mn></m:mtd>
   <m:mtd><m:mn>13</m:mn></m:mtd>
   <m:mtd/>
   <m:mtd/>
   <m:mtd/>
  </m:mtr><m:mtr>
   <m:mtd><m:mn>0</m:mn></m:mtd>
   <m:mtd><m:mn>0</m:mn></m:mtd>
   <m:mtd><m:mn>0</m:mn></m:mtd>
   <m:mtd><m:mn>16</m:mn></m:mtd>
   <m:mtd/>
   <m:mtd/>
  </m:mtr><m:mtr>
   <m:mtd><m:mn>5</m:mn></m:mtd>
   <m:mtd><m:mn>14</m:mn></m:mtd>
   <m:mtd><m:mn>18</m:mn></m:mtd>
   <m:mtd><m:mn>8</m:mn></m:mtd>
   <m:mtd><m:mn>55</m:mn></m:mtd>
   <m:mtd/>
  </m:mtr><m:mtr>
   <m:mtd><m:mn>0</m:mn></m:mtd>
   <m:mtd><m:mn>0</m:mn></m:mtd>
   <m:mtd><m:mn>0</m:mn></m:mtd>
   <m:mtd><m:mn>24</m:mn></m:mtd>
   <m:mtd><m:mn>17</m:mn></m:mtd>
   <m:mtd><m:mn>77</m:mn></m:mtd>
  </m:mtr>
 </m:mtable></m:mfenced>
<m:mtext>.</m:mtext>
</m:math></td><td class="formula2"/></tr></table></div>

For this matrix, the elements of <a class="arg" href="#NROW">NROW</a> must be set to <m:math><m:mn>1</m:mn></m:math>, <m:math><m:mn>2</m:mn></m:math>, <m:math><m:mn>2</m:mn></m:math>, <m:math><m:mn>1</m:mn></m:math>, <m:math><m:mn>5</m:mn></m:math>, <m:math><m:mn>3</m:mn></m:math>, and the elements within the envelope must be supplied in row order as:

<div class="formula"><table class="formula"><tr><td class="formula"><m:math display="block">
 <m:mn>1</m:mn><m:mo>,</m:mo>
 <m:mn>2</m:mn><m:mo>,</m:mo>
 <m:mn>5</m:mn><m:mo>,</m:mo>
 <m:mn>3</m:mn><m:mo>,</m:mo>
 <m:mn>13</m:mn><m:mo>,</m:mo>
 <m:mn>16</m:mn><m:mo>,</m:mo>
 <m:mn>5</m:mn><m:mo>,</m:mo>
 <m:mn>14</m:mn><m:mo>,</m:mo>
 <m:mn>18</m:mn><m:mo>,</m:mo>
 <m:mn>8</m:mn><m:mo>,</m:mo>
 <m:mn>55</m:mn><m:mo>,</m:mo>
 <m:mn>24</m:mn><m:mo>,</m:mo>
 <m:mn>17</m:mn><m:mo>,</m:mo>
 <m:mn>77</m:mn>
 <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/f01mcfe.f">Program Text (f01mcfe.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/f01mcfe.d">Program&#160;Data (f01mcfe.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/f01mcfe.r">Program Results (f01mcfe.r)</a></p>
<hr/><div><a class="rout" href="../../pdf/F01/f01mcf.pdf">F01MCF (PDF version)</a></div><div><a class="chap" href="f01conts.xml">F01 Chapter Contents</a></div><div><a class="chapint" href="f01intro.xml">F01 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>
