<?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>F01BSF : 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/f01bsf.pdf">F01BSF (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/>F01BSF</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">F01BSF factorizes a real sparse matrix using the pivotal sequence previously obtained by <a class="rout" href="../F01/f01brf.xml">F01BRF</a> when a matrix of the same sparsity pattern was factorized.</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;F01BSF&#160;(</td><td class="tdfspec2"><a class="arg" href="#N">N</a>, <a class="arg" href="#NZ">NZ</a>, <a class="arg" href="#A">A</a>, <a class="arg" href="#LICN">LICN</a>, <a class="arg" href="#IVECT">IVECT</a>, <a class="arg" href="#JVECT">JVECT</a>, <a class="arg" href="#ICN">ICN</a>, <a class="arg" href="#IKEEP">IKEEP</a>, <a class="arg" href="#IW">IW</a>, <a class="arg" href="#W">W</a>, <a class="arg" href="#GROW">GROW</a>, <a class="arg" href="#ETA">ETA</a>, <a class="arg" href="#RPMIN">RPMIN</a>, <a class="arg" href="#ABORT">ABORT</a>, <a class="arg" href="#IDISP">IDISP</a>, <a class="arg" href="#IFAIL">IFAIL</a>)</td></tr><tr><td class="tdfspec1">INTEGER</td><td class="tdfspec2">N, NZ, LICN, IVECT(NZ), JVECT(NZ), ICN(LICN), IKEEP(5*N), IW(5*N), IDISP(2), IFAIL</td></tr><tr><td class="tdfspec1"><b><i>double&#160;precision</i></b></td><td class="tdfspec2">A(LICN), W(N), ETA, RPMIN</td></tr><tr><td class="tdfspec1">LOGICAL</td><td class="tdfspec2">GROW, ABORT</td></tr></table><h2 class="standard"><a class="sec" name="description" id="description"/>3&#160;&#160;Description</h2>
<div class="paramtext">F01BSF accepts as input a real sparse matrix of the same sparsity pattern as a matrix previously factorized by a call of <a class="rout" href="../F01/f01brf.xml">F01BRF</a>.  It first applies to the matrix the same permutations as were used by   <a class="rout" href="../F01/f01brf.xml">F01BRF</a>, both for permutation to block triangular form and for pivoting, and then performs Gaussian elimination to obtain the <m:math><m:mi>L</m:mi><m:mi>U</m:mi></m:math>&#160;factorization of the diagonal blocks.</div><div class="paramtext">Extensive data checks are made; duplicated nonzeros can be accumulated.</div><div class="paramtext">The factorization is intended to be used by <a class="rout" href="../F04/f04axf.xml">F04AXF</a> to solve sparse systems of linear 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;or <m:math><m:msup><m:mi>A</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>.</div><div class="paramtext">F01BSF is much faster than <a class="rout" href="../F01/f01brf.xml">F01BRF</a> and in some applications it is expected that there will be many calls of F01BSF for each call of  <a class="rout" href="../F01/f01brf.xml">F01BRF</a>.</div><div class="paramtext">The method is fully described in <a class="ref" href="#ref100">Duff (1977)</a>.</div><div class="paramtext">A more recent algorithm for the same calculation is provided by <a class="rout" href="../F11/f11mef.xml">F11MEF</a>.</div><h2 class="standard"><a class="sec" name="references" id="references"/>4&#160;&#160;References</h2><div class="paramtext"><a name="ref100" id="ref100"/>Duff I S (1977)  MA28 &#8211; a set of Fortran subroutines for sparse unsymmetric linear equations <i>AERE Report R8730</i> HMSO </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>&gt;</m:mo><m:mn>0</m:mn></m:math>.
</div></dd><dt class="paramhead"><a name="NZ" id="NZ"/>2: &#160;&#160;&#8194; NZ &#8211; INTEGER<span class="pclass">Input</span></dt><dd><div class="paramtext"><i>On entry</i>: 

the number of nonzero elements in 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="#NZ"><m:mi mathcolor="#EE0000" mathvariant="bold">NZ</m:mi></m:maction><m:mo>&gt;</m:mo><m:mn>0</m:mn></m:math>.
</div></dd><dt class="paramhead"><a name="A" id="A"/>3: &#160;&#160;&#8194; A(<a class="arg" href="#LICN">LICN</a>) &#8211; <span class="bitalic">double precision</span> array<span class="pclass">Input/Output</span></dt><dd><div class="paramtext"><i>On entry</i>: <m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#A"><m:mi mathcolor="#EE0000" mathvariant="bold">A</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mi>i</m:mi></m:mfenced></m:mrow></m:math>, for <m:math><m:mi>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:maction actiontype="link" dsi:type="simple" dsi:href="#NZ"><m:mi mathcolor="#EE0000" mathvariant="bold">NZ</m:mi></m:maction></m:math>, must contain the nonzero elements of the sparse matrix <m:math><m:mi>A</m:mi></m:math>. They can be in any order since F01BSF will reorder them.</div>
<div class="paramtext"><i>On exit</i>: the nonzero elements in the <m:math><m:mi>L</m:mi><m:mi>U</m:mi></m:math>&#160;factorization. The array must <b>not</b> be changed by you between a call of F01BSF and a call of <a class="rout" href="../F04/f04axf.xml">F04AXF</a>.</div></dd><dt class="paramhead"><a name="LICN" id="LICN"/>4: &#160;&#160;&#8194; LICN &#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="#ICN">ICN</a> as declared in the (sub)program from which F01BSF is called. It should have the same value as it had for <a class="rout" href="../F01/f01brf.xml">F01BRF</a>.</div><div class="paramtext"><i>Constraint</i>:
  <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#LICN"><m:mi mathcolor="#EE0000" mathvariant="bold">LICN</m:mi></m:maction><m:mo>&#8805;</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#NZ"><m:mi mathcolor="#EE0000" mathvariant="bold">NZ</m:mi></m:maction></m:math>.
</div></dd><dt class="paramhead"><a name="IVECT" id="IVECT"/>5: &#160;&#160;&#8194; IVECT(<a class="arg" href="#NZ">NZ</a>) &#8211; INTEGER array<span class="pclass">Input</span></dt><dt class="multi-paramhead"><a name="JVECT" id="JVECT"/>6: &#160;&#160;&#8194; JVECT(<a class="arg" href="#NZ">NZ</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="#IVECT"><m:mi mathcolor="#EE0000" mathvariant="bold">IVECT</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mi>i</m:mi></m:mfenced></m:mrow></m:math>&#160;and <m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#JVECT"><m:mi mathcolor="#EE0000" mathvariant="bold">JVECT</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mi>i</m:mi></m:mfenced></m:mrow></m:math>, for <m:math><m:mi>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:maction actiontype="link" dsi:type="simple" dsi:href="#NZ"><m:mi mathcolor="#EE0000" mathvariant="bold">NZ</m:mi></m:maction></m:math>, must contain the row index and the column index respectively of the nonzero element stored in <m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#A"><m:mi mathcolor="#EE0000" mathvariant="bold">A</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mi>i</m:mi></m:mfenced></m:mrow></m:math>.</div></dd><dt class="paramhead"><a name="ICN" id="ICN"/>7: &#160;&#160;&#8194; ICN(<a class="arg" href="#LICN">LICN</a>) &#8211; INTEGER array<span class="pclass">Input</span></dt><dd><div class="paramtext"><a class="arg" href="#ICN">ICN</a> contains, on entry, the same information as output by <a class="rout" href="../F01/f01brf.xml">F01BRF</a>. It must not be changed by you between a call of F01BSF and a call of <a class="rout" href="../F04/f04axf.xml">F04AXF</a>.</div>
<div class="paramtext"><a class="arg" href="#ICN">ICN</a> is used as internal workspace prior to being restored on exit and hence is unchanged.</div></dd><dt class="paramhead"><a name="IKEEP" id="IKEEP"/>8: &#160;&#160;&#8194; IKEEP(<m:math><m:mn>5</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>) &#8211; INTEGER array<span class="pclass">Communication Array</span></dt><dd><div class="paramtext"><i>On entry</i>: the same indexing information about the factorization as output in <a class="arg" href="../F01/f01brf.xml#IKEEP">IKEEP</a> by <a class="rout" href="../F01/f01brf.xml">F01BRF</a>.</div>
<div class="paramtext">You must <b>not</b> change <a class="arg" href="#IKEEP">IKEEP</a> between a call of F01BSF and subsequent calls to <a class="rout" href="../F04/f04axf.xml">F04AXF</a>.</div></dd><dt class="paramhead"><a name="IW" id="IW"/>9: &#160;&#160;&#8194; IW(<m:math><m:mn>5</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>) &#8211; INTEGER array<span class="pclass">Workspace</span></dt><dt class="paramhead"><a name="W" id="W"/>10: &#8194; W(<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="#GROW"><m:mi mathcolor="#EE0000" mathvariant="bold">GROW</m:mi></m:maction><m:mo>=</m:mo><m:mi mathvariant="normal">.TRUE.</m:mi></m:math>, <m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#W"><m:mi mathcolor="#EE0000" mathvariant="bold">W</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mn>1</m:mn></m:mfenced></m:mrow></m:math>&#160;contains an estimate (an upper bound) of the increase in size of elements encountered during the factorization (see <a class="arg" href="#GROW">GROW</a>); the rest of the array is used as workspace.
<div class="paramtext">If <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#GROW"><m:mi mathcolor="#EE0000" mathvariant="bold">GROW</m:mi></m:maction><m:mo>=</m:mo><m:mi mathvariant="normal">.FALSE.</m:mi></m:math>, the array is not used.</div>
</div></dd><dt class="paramhead"><a name="GROW" id="GROW"/>11: &#8194; GROW &#8211; LOGICAL<span class="pclass">Input</span></dt><dd><div class="paramtext"><i>On entry</i>: if <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#GROW"><m:mi mathcolor="#EE0000" mathvariant="bold">GROW</m:mi></m:maction><m:mo>=</m:mo><m:mi mathvariant="normal">.TRUE.</m:mi></m:math>, then on exit <m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#W"><m:mi mathcolor="#EE0000" mathvariant="bold">W</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mn>1</m:mn></m:mfenced></m:mrow></m:math>&#160;contains an estimate (an upper bound) of the increase in size of elements encountered during the factorization. If the matrix is well-scaled (see <a class="sec" href="#fcomments">Section 8</a>), then a high value for <m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#W"><m:mi mathcolor="#EE0000" mathvariant="bold">W</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mn>1</m:mn></m:mfenced></m:mrow></m:math>&#160;indicates that the <m:math><m:mi>L</m:mi><m:mi>U</m:mi></m:math>&#160;factorization may be inaccurate and you should be wary of the results and perhaps increase the parameter <a class="arg" href="../F01/f01brf.xml#PIVOT">PIVOT</a> for subsequent runs (see <a class="sec" href="#accuracy">Section 7</a>).</div></dd><dt class="paramhead"><a name="ETA" id="ETA"/>12: &#8194; ETA &#8211; <span class="bitalic">double precision</span><span class="pclass">Input</span></dt><dd><div class="paramtext"><i>On entry</i>: the relative pivot threshold below which an error diagnostic is provoked and <a class="arg" href="#IFAIL">IFAIL</a> is set to <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="#IFeq7"><m:mn mathcolor="#003399" mathvariant="bold">7</m:mn></m:maction></m:math>. If <a class="arg" href="#ETA">ETA</a> is greater than <m:math><m:mn>1.0</m:mn></m:math>, then no check on pivot size is made.</div>
<div class="paramtext"><i>Suggested value</i>:
  <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#ETA"><m:mi mathcolor="#EE0000" mathvariant="bold">ETA</m:mi></m:maction><m:mo>=</m:mo><m:msup><m:mn>10</m:mn><m:mrow><m:mo>-</m:mo><m:mn>4</m:mn></m:mrow></m:msup></m:math>.

</div></dd><dt class="paramhead"><a name="RPMIN" id="RPMIN"/>13: &#8194; RPMIN &#8211; <span class="bitalic">double precision</span><span class="pclass">Output</span></dt><dd><div class="paramtext"><i>On exit</i>: if <a class="arg" href="#ETA">ETA</a> is less than <m:math><m:mn>1.0</m:mn></m:math>, then <a class="arg" href="#RPMIN">RPMIN</a> gives the smallest ratio of the pivot to the largest element in the row of the corresponding upper triangular factor thus monitoring the stability of the factorization. If <a class="arg" href="#RPMIN">RPMIN</a> is very small it may be advisable to perform a new factorization using <a class="rout" href="../F01/f01brf.xml">F01BRF</a>.</div></dd><dt class="paramhead"><a name="ABORT" id="ABORT"/>14: &#8194; ABORT &#8211; LOGICAL<span class="pclass">Input</span></dt><dd><div class="paramtext"><i>On entry</i>: if <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#ABORT"><m:mi mathcolor="#EE0000" mathvariant="bold">ABORT</m:mi></m:maction><m:mo>=</m:mo><m:mi mathvariant="normal">.TRUE.</m:mi></m:math>, F01BSF exits immediately (with <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="#IFeq8"><m:mn mathcolor="#003399" mathvariant="bold">8</m:mn></m:maction></m:math>) if it finds duplicate elements in the input matrix. 
<div class="paramtext">If <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#ABORT"><m:mi mathcolor="#EE0000" mathvariant="bold">ABORT</m:mi></m:maction><m:mo>=</m:mo><m:mi mathvariant="normal">.FALSE.</m:mi></m:math>, F01BSF proceeds using a value equal to the sum of the duplicate elements.</div>
<div class="paramtext">In either case details of each duplicate element are output on the current advisory message unit (see <a class="rout" href="../X04/x04abf.xml">X04ABF</a>), unless suppressed by the value of <a class="arg" href="#IFAIL">IFAIL</a> on entry.</div>
</div>
<div class="paramtext"><i>Suggested value</i>:
  <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#ABORT"><m:mi mathcolor="#EE0000" mathvariant="bold">ABORT</m:mi></m:maction><m:mo>=</m:mo><m:mi mathvariant="normal">.TRUE.</m:mi></m:math>.

</div></dd><dt class="paramhead"><a name="IDISP" id="IDISP"/>15: &#8194; IDISP(<m:math><m:mn>2</m:mn></m:math>) &#8211; INTEGER array<span class="pclass">Communication Array</span></dt><dd><div class="paramtext"><i>On entry</i>: <m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#IDISP"><m:mi mathcolor="#EE0000" mathvariant="bold">IDISP</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mn>1</m:mn></m:mfenced></m:mrow></m:math>&#160;and <m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#IDISP"><m:mi mathcolor="#EE0000" mathvariant="bold">IDISP</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mn>2</m:mn></m:mfenced></m:mrow></m:math>&#160;must be as output in <a class="arg" href="../F01/f01brf.xml#IDISP">IDISP</a> by the previous call of <a class="rout" href="../F01/f01brf.xml">F01BRF</a>.</div></dd><dt class="paramhead"><a name="IFAIL" id="IFAIL"/>16: &#8194; IFAIL &#8211; INTEGER<span class="pclass">Input/Output</span></dt><dd>
<div class="paramtext">For this routine, the normal use of <a class="arg" href="#IFAIL">IFAIL</a> is extended to control the printing of error and warning messages as well as specifying hard or soft failure (see <a class="sec" href="../GENINT/essint.xml#library3">Section 3.3</a> in  the Essential Introduction).</div>
<div class="paramtext"><i>On entry</i>: <a class="arg" href="#IFAIL">IFAIL</a> must be set to a value with the decimal expansion <m:math><m:mi mathvariant="italic">cba</m:mi></m:math>, where each of the decimal digits <m:math><m:mi>c</m:mi></m:math>, <m:math><m:mi>b</m:mi></m:math>&#160;and <m:math><m:mi>a</m:mi></m:math>&#160;must have a value of <m:math><m:mn>0</m:mn></m:math>&#160;or <m:math><m:mn>1</m:mn></m:math>.
<table class="standard-90"><tr>
<td style="width:3.0em;" valign="baseline"><m:math><m:mi>a</m:mi><m:mo>=</m:mo><m:mn>0</m:mn></m:math></td>
<td valign="top">specifies hard failure, otherwise soft failure;</td>
</tr><tr>
<td style="width:3.0em;" valign="baseline"><m:math><m:mi>b</m:mi><m:mo>=</m:mo><m:mn>0</m:mn></m:math></td>
<td valign="top">suppresses error messages, otherwise error messages will be printed (see <a class="sec" href="#errors">Section 6</a>);</td>
</tr><tr>
<td style="width:3.0em;" valign="baseline"><m:math><m:mi>c</m:mi><m:mo>=</m:mo><m:mn>0</m:mn></m:math></td>
<td valign="top">suppresses warning messages, otherwise warning messages will be printed (see <a class="sec" href="#errors">Section 6</a>).</td>
</tr></table>
<div class="paramtext">The recommended value for inexperienced users is <m:math><m:mn>110</m:mn></m:math>&#160;(i.e., hard failure with all messages printed).</div>
</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></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>&#8804;</m:mo><m:mn>0</m:mn></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>
<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="#NZ"><m:mi mathcolor="#EE0000" mathvariant="bold">NZ</m:mi></m:maction><m:mo>&#8804;</m:mo><m:mn>0</m:mn></m:math>.</td></tr></table>
</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>
<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="#LICN"><m:mi mathcolor="#EE0000" mathvariant="bold">LICN</m:mi></m:maction><m:mo>&lt;</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#NZ"><m:mi mathcolor="#EE0000" mathvariant="bold">NZ</m:mi></m:maction></m:math>.</td></tr></table>
</dd>
</dl><dl class="ifail">
<dt class="errorhead"><a name="IFeq4" id="IFeq4"/><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>4</m:mn></m:math></dt>
<dd>
<div class="paramtext">On entry, an element of the input matrix has a row or column index (i.e., an element of <a class="arg" href="#IVECT">IVECT</a> or <a class="arg" href="#JVECT">JVECT</a>) outside the range <m:math><m:mn>1</m:mn></m:math>&#160;to <a class="arg" href="#N">N</a>.</div>
</dd>
</dl><dl class="ifail">
<dt class="errorhead"><a name="IFeq5" id="IFeq5"/><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>5</m:mn></m:math></dt>
<dd>
<div class="paramtext">The input matrix is incompatible with the matrix factorized by the previous call of <a class="rout" href="../F01/f01brf.xml">F01BRF</a> (see <a class="sec" href="#fcomments">Section 8</a>).</div>
</dd>
</dl><dl class="ifail">
<dt class="errorhead"><a name="IFeq6" id="IFeq6"/><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>6</m:mn></m:math></dt>
<dd>
<div class="paramtext">The input matrix is numerically singular.</div>
</dd>
</dl><dl class="ifail">
<dt class="errorhead"><a name="IFeq7" id="IFeq7"/><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>7</m:mn></m:math></dt>
<dd>
<div class="paramtext">A very small pivot has been detected (see <a class="sec" href="#parameters">Section 5</a>, <a class="arg" href="#ETA">ETA</a>).  The factorization has been completed but is potentially unstable.</div>
</dd>
</dl><dl class="ifail">
<dt class="errorhead"><a name="IFeq8" id="IFeq8"/><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>8</m:mn></m:math></dt>
<dd>
<div class="paramtext">Duplicate elements have been found in the input matrix and the factorization has been abandoned (<m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#ABORT"><m:mi mathcolor="#EE0000" mathvariant="bold">ABORT</m:mi></m:maction><m:mo>=</m:mo><m:mi mathvariant="normal">.TRUE.</m:mi></m:math>&#160;on entry).</div>
</dd>
</dl><h2 class="standard"><a class="sec" name="accuracy" id="accuracy"/>7&#160;&#160;Accuracy</h2>
<div class="paramtext">The factorization obtained is exact for a perturbed matrix whose <m:math><m:mfenced separators=""><m:mi>i</m:mi><m:mo>,</m:mo><m:mi>j</m:mi></m:mfenced></m:math>th element differs from <m:math><m:msub><m:mi>a</m:mi><m:mrow><m:mi>i</m:mi><m:mi>j</m:mi></m:mrow></m:msub></m:math>&#160;by less than <m:math><m:mn>3</m:mn><m:mi>&#949;</m:mi><m:mi>&#961;</m:mi><m:msub><m:mi>m</m:mi><m:mrow><m:mi>i</m:mi><m:mi>j</m:mi></m:mrow></m:msub></m:math>&#160;where  <m:math><m:mi>&#949;</m:mi></m:math>&#160;is the <span class="bitalic">machine precision</span>, <m:math><m:mi>&#961;</m:mi></m:math>&#160;is the growth value returned in <m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#W"><m:mi mathcolor="#EE0000" mathvariant="bold">W</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mn>1</m:mn></m:mfenced></m:mrow></m:math>&#160;if <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#GROW"><m:mi mathcolor="#EE0000" mathvariant="bold">GROW</m:mi></m:maction><m:mo>=</m:mo><m:mi mathvariant="normal">.TRUE.</m:mi></m:math>,  and <m:math><m:msub><m:mi>m</m:mi><m:mrow><m:mi>i</m:mi><m:mi>j</m:mi></m:mrow></m:msub></m:math>&#160;the number of Gaussian elimination operations applied to element <m:math><m:mfenced separators=""><m:mi>i</m:mi><m:mo>,</m:mo><m:mi>j</m:mi></m:mfenced></m:math>.</div><div class="paramtext">If <m:math><m:mi>&#961;</m:mi><m:mo>=</m:mo><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#W"><m:mi mathcolor="#EE0000" mathvariant="bold">W</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mn>1</m:mn></m:mfenced></m:mrow></m:math>&#160;is very large or <a class="arg" href="#RPMIN">RPMIN</a> is very small, then a fresh call of <a class="rout" href="../F01/f01brf.xml">F01BRF</a> is recommended.</div><h2 class="standard"><a class="sec" name="fcomments" id="fcomments"/>8&#160;&#160;Further Comments</h2>
<div class="paramtext">If you have a sequence of problems with the same sparsity pattern then F01BSF is recommended after <a class="rout" href="../F01/f01brf.xml">F01BRF</a> has been called for one such problem.  It is typically <m:math><m:mn>4</m:mn></m:math>&#160;to <m:math><m:mn>7</m:mn></m:math>&#160;times faster but is potentially unstable since the previous pivotal sequence is used.  Further details on timing are given in the document for <a class="rout" href="../F01/f01brf.xml">F01BRF</a>.</div><div class="paramtext">If growth estimation is performed (<m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#GROW"><m:mi mathcolor="#EE0000" mathvariant="bold">GROW</m:mi></m:maction><m:mo>=</m:mo><m:mi mathvariant="normal">.TRUE.</m:mi></m:math>), then the time increases by between <m:math><m:mn>5</m:mn><m:mo>%</m:mo></m:math>&#160;and <m:math><m:mn>10</m:mn><m:mo>%</m:mo></m:math>.  Pivot size monitoring (<m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#ETA"><m:mi mathcolor="#EE0000" mathvariant="bold">ETA</m:mi></m:maction><m:mo>&#8804;</m:mo><m:mn>1.0</m:mn></m:math>) involves a similar overhead.</div><div class="paramtext">We normally expect this routine to be entered with a matrix having the same pattern of nonzeros as was earlier presented to <a class="rout" href="../F01/f01brf.xml">F01BRF</a>.  However there is no record of this pattern, but rather a record of the pattern including all fill-ins.  Therefore we permit additional nonzeros in positions corresponding to fill-ins.</div><div class="paramtext">If singular matrices are being treated then it is also required that the present matrix be sufficiently like the previous one for the same permutations to be suitable for factorization with the same set of zero pivots.</div><h2 class="standard"><a class="sec" name="example" id="example"/>9&#160;&#160;Example</h2>
<div class="paramtext">This example factorizes the real sparse matrices

<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>5</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>0</m:mn></m:mtd>
   <m:mtd><m:mn>0</m:mn></m:mtd>
   <m:mtd><m:mn>0</m:mn></m:mtd>
  </m:mtr><m:mtr>
   <m:mtd><m:mn>0</m:mn></m:mtd>
   <m:mtd><m:mn>2</m:mn></m:mtd>
   <m:mtd><m:mrow><m:mo>-</m:mo><m:mn>1</m:mn></m:mrow></m:mtd>
   <m:mtd><m:mn>2</m:mn></m:mtd>
   <m:mtd><m:mn>0</m:mn></m:mtd>
   <m:mtd><m:mn>0</m:mn></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>3</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>0</m:mn></m:mtd>
  </m:mtr><m:mtr>
   <m:mtd><m:mrow><m:mo>-</m:mo><m:mn>2</m:mn></m:mrow></m:mtd>
   <m:mtd><m:mn>0</m:mn></m:mtd>
   <m:mtd><m:mn>0</m:mn></m:mtd>
   <m:mtd><m:mn>1</m:mn></m:mtd>
   <m:mtd><m:mn>1</m:mn></m:mtd>
   <m:mtd><m:mn>0</m:mn></m:mtd>
  </m:mtr><m:mtr>
   <m:mtd><m:mrow><m:mo>-</m:mo><m:mn>1</m:mn></m:mrow></m:mtd>
   <m:mtd><m:mn>0</m:mn></m:mtd>
   <m:mtd><m:mn>0</m:mn></m:mtd>
   <m:mtd><m:mrow><m:mo>-</m:mo><m:mn>1</m:mn></m:mrow></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:mtr><m:mtr>
   <m:mtd><m:mrow><m:mo>-</m:mo><m:mn>1</m:mn></m:mrow></m:mtd>
   <m:mtd><m:mrow><m:mo>-</m:mo><m:mn>1</m:mn></m:mrow></m:mtd>
   <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>6</m:mn></m:mtd>
  </m:mtr>
 </m:mtable></m:mfenced>
</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:mfenced><m:mtable columnalign="right">
  <m:mtr>
   <m:mtd><m:mn>10</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>0</m:mn></m:mtd>
   <m:mtd><m:mn>0</m:mn></m:mtd>
   <m:mtd><m:mn>0</m:mn></m:mtd>
  </m:mtr><m:mtr>
   <m:mtd><m:mn>0</m:mn></m:mtd>
   <m:mtd><m:mn>12</m:mn></m:mtd>
   <m:mtd><m:mrow><m:mo>-</m:mo><m:mn>3</m:mn></m:mrow></m:mtd>
   <m:mtd><m:mrow><m:mo>-</m:mo><m:mn>1</m:mn></m:mrow></m:mtd>
   <m:mtd><m:mn>0</m:mn></m:mtd>
   <m:mtd><m:mn>0</m:mn></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>15</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>0</m:mn></m:mtd>
  </m:mtr><m:mtr>
   <m:mtd><m:mrow><m:mo>-</m:mo><m:mn>2</m:mn></m:mrow></m:mtd>
   <m:mtd><m:mn>0</m:mn></m:mtd>
   <m:mtd><m:mn>0</m:mn></m:mtd>
   <m:mtd><m:mn>10</m:mn></m:mtd>
   <m:mtd><m:mrow><m:mo>-</m:mo><m:mn>1</m:mn></m:mrow></m:mtd>
   <m:mtd><m:mn>0</m:mn></m:mtd>
  </m:mtr><m:mtr>
   <m:mtd><m:mrow><m:mo>-</m:mo><m:mn>1</m:mn></m:mrow></m:mtd>
   <m:mtd><m:mn>0</m:mn></m:mtd>
   <m:mtd><m:mn>0</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>1</m:mn></m:mtd>
   <m:mtd><m:mrow><m:mo>-</m:mo><m:mn>1</m:mn></m:mrow></m:mtd>
  </m:mtr><m:mtr>
   <m:mtd><m:mrow><m:mo>-</m:mo><m:mn>1</m:mn></m:mrow></m:mtd>
   <m:mtd><m:mrow><m:mo>-</m:mo><m:mn>2</m:mn></m:mrow></m:mtd>
   <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>6</m:mn></m:mtd>
  </m:mtr>
 </m:mtable></m:mfenced>
<m:mtext>.</m:mtext>
</m:math></td><td class="formula2"/></tr></table></div>

This example program simply prints the values of <m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#W"><m:mi mathcolor="#EE0000" mathvariant="bold">W</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mn>1</m:mn></m:mfenced></m:mrow></m:math>&#160;and <a class="arg" href="#RPMIN">RPMIN</a> returned by F01BSF.  Normally the calls of <a class="rout" href="../F01/f01brf.xml">F01BRF</a>  and  F01BSF  would be followed by calls of <a class="rout" href="../F04/f04axf.xml">F04AXF</a>.</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/f01bsfe.f">Program Text (f01bsfe.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/f01bsfe.d">Program&#160;Data (f01bsfe.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/f01bsfe.r">Program Results (f01bsfe.r)</a></p>
<hr/><div><a class="rout" href="../../pdf/F01/f01bsf.pdf">F01BSF (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>
