<?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>F11MEF : 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="rout" href="../../pdf/F11/f11mef.pdf">F11MEF (PDF version)</a></div><div><a class="chap" href="f11conts.xml">F11 Chapter Contents</a></div><div><a class="chapint" href="f11intro.xml">F11 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/>F11MEF</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">F11MEF computes the <m:math>
 <m:mi>L</m:mi><m:mi>U</m:mi>
</m:math>&#160;factorization of a real sparse matrix in compressed column (Harwell&#8211;Boeing), column-permuted format.</div><h2 class="standard"><a class="sec" name="specification" id="specification"/>2&#160;&#160;Specification</h2><table class="fspec"><tr><td class="tdfspec1">
<div class="left-tablediv"><table class="fspec1"><tbody>
<tr>
<td class="tdfspec1" valign="top" align="left">SUBROUTINE&#160;F11MEF&#160;(</td>
<td class="tdfspec2" valign="top" align="left"><a class="arg" href="#N">N</a>, <a class="arg" href="#IROWIX">IROWIX</a>, <a class="arg" href="#A">A</a>, <a class="arg" href="#IPRM">IPRM</a>, <a class="arg" href="#THRESH">THRESH</a>, <a class="arg" href="#NZLMX">NZLMX</a>, <a class="arg" href="#NZLUMX">NZLUMX</a>, <a class="arg" href="#NZUMX">NZUMX</a>, <a class="arg" href="#IL">IL</a>, <a class="arg" href="#LVAL">LVAL</a>, <a class="arg" href="#IU">IU</a>, <a class="arg" href="#UVAL">UVAL</a>, <a class="arg" href="#NNZL">NNZL</a>, <a class="arg" href="#NNZU">NNZU</a>, <a class="arg" href="#FLOP">FLOP</a>, <a class="arg" href="#IFAIL">IFAIL</a>)</td>
</tr>
</tbody>
</table></div>
<div class="left-tablediv"><table class="fspec3"><tbody>
<tr>
<td class="tdfspec1" valign="top" align="left">INTEGER&#160;</td>
<td class="tdfspec2" valign="top" align="left">N, IROWIX(*), IPRM(7*N), NZLMX, NZLUMX, NZUMX, IL(7*N+NZLMX+4), IU(2*N+NZUMX+1), NNZL, NNZU, IFAIL</td>
</tr>
<tr>
<td class="tdfspec1" valign="top" align="left">REAL&#160;(KIND=nag_wp)&#160;</td>
<td class="tdfspec2" valign="top" align="left">A(*), THRESH, LVAL(NZLUMX), UVAL(NZUMX), FLOP</td>
</tr>
</tbody>
</table></div>
</td></tr></table><h2 class="standard"><a class="sec" name="description" id="description"/>3&#160;&#160;Description</h2>
<div class="paramtext">Given a real sparse matrix <m:math><m:mi>A</m:mi></m:math>, F11MEF computes an <m:math>
 <m:mi>L</m:mi><m:mi>U</m:mi>
</m:math>&#160;factorization of <m:math><m:mi>A</m:mi></m:math>&#160;with partial pivoting, <m:math>
 <m:msub><m:mi>P</m:mi><m:mi>r</m:mi></m:msub>
 <m:mi>A</m:mi>
 <m:msub><m:mi>P</m:mi><m:mi>c</m:mi></m:msub>
 <m:mo>=</m:mo>
 <m:mi>L</m:mi><m:mi>U</m:mi>
</m:math>, where <m:math><m:msub><m:mi>P</m:mi><m:mi>r</m:mi></m:msub></m:math>&#160;is a row permutation matrix (computed by F11MEF), <m:math><m:msub><m:mi>P</m:mi><m:mi>c</m:mi></m:msub></m:math>&#160;is a (supplied) column permutation matrix, <m:math><m:mi>L</m:mi></m:math>&#160;is unit lower triangular and <m:math><m:mi>U</m:mi></m:math>&#160;is upper triangular. The column permutation matrix, <m:math><m:msub><m:mi>P</m:mi><m:mi>c</m:mi></m:msub></m:math>, must be computed by a prior call to <a class="rout" href="../F11/f11mdf.xml">F11MDF</a>. The matrix <m:math><m:mi>A</m:mi></m:math>&#160;must be presented in the column permuted, compressed column (Harwell&#8211;Boeing) format. </div><div class="paramtext">The <m:math>
 <m:mi>L</m:mi><m:mi>U</m:mi>
</m:math>&#160;factorization is output in the form of four one-dimensional arrays: integer arrays <a class="arg" href="#IL">IL</a> and <a class="arg" href="#IU">IU</a> and real-valued arrays <a class="arg" href="#LVAL">LVAL</a> and <a class="arg" href="#UVAL">UVAL</a>. These describe the sparsity pattern and numerical values in the <m:math><m:mi>L</m:mi></m:math>&#160;and <m:math><m:mi>U</m:mi></m:math>&#160;matrices. The minimum required dimensions of these arrays cannot be given as a simple function of the size parameters (order and number of nonzero values) of the matrix <m:math><m:mi>A</m:mi></m:math>. This is due to unpredictable fill-in created by partial pivoting. F11MEF will, on return, indicate which dimensions of these arrays were not adequate for the computation or (in the case of one of them) give a firm bound. You should then allocate more storage and try again.</div><h2 class="standard"><a class="sec" name="references" id="references"/>4&#160;&#160;References</h2><div class="paramtext"><a name="ref726" id="ref726"/>Demmel J W, Eisenstat S C, Gilbert J R, Li X S and Li J W H (1999)  A supernodal approach to sparse partial pivoting <i>SIAM J. Matrix Anal. Appl. </i> <b>20</b> 720&#8211;755 </div>
<div class="paramtext"><a name="ref725" id="ref725"/>Demmel J W, Gilbert J R and Li X S (1999)  An asynchronous parallel supernodal algorithm for sparse gaussian elimination <i>SIAM J. Matrix Anal. Appl. </i> <b>20</b> 915&#8211;952 </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>0</m:mn></m:math>.
</div></dd><dt class="paramhead"><a name="IROWIX" id="IROWIX"/>2: &#160;&#160;&#8194; IROWIX(<m:math><m:mo>*</m:mo></m:math>) &#8211; INTEGER&#160;array<span class="pclass">Input</span></dt><dd><div class="paramtext"><b>Note:</b> the dimension of the array <a class="arg" href="#IROWIX">IROWIX</a>
must be at least
<m:math><m:mi mathvariant="italic">nnz</m:mi></m:math>, the number of nonzeros of the sparse matrix <m:math><m:mi>A</m:mi></m:math>.</div>
<div class="paramtext"><i>On entry</i>: the row index array of sparse matrix <m:math><m:mi>A</m:mi></m:math>.</div></dd><dt class="paramhead"><a name="A" id="A"/>3: &#160;&#160;&#8194; A(<m:math><m:mo>*</m:mo></m:math>) &#8211; REAL&#160;(KIND=nag_wp)&#160;array<span class="pclass">Input</span></dt><dd><div class="paramtext"><b>Note:</b> the dimension of the array <a class="arg" href="#A">A</a>
must be at least
<m:math><m:mi mathvariant="italic">nnz</m:mi></m:math>, the number of nonzeros of the sparse matrix <m:math><m:mi>A</m:mi></m:math>.</div>
<div class="paramtext"><i>On entry</i>: the array of nonzero values in the sparse matrix <m:math><m:mi>A</m:mi></m:math>.</div></dd><dt class="paramhead"><a name="IPRM" id="IPRM"/>4: &#160;&#160;&#8194; IPRM(<m:math><m:mn>7</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&#160;array<span class="pclass">Input/Output</span></dt><dd><div class="paramtext"><i>On entry</i>: contains the column permutation which defines the permutation <m:math><m:msub><m:mi>P</m:mi><m:mi>c</m:mi></m:msub></m:math>&#160;and associated data structures as computed by routine <a class="rout" href="../F11/f11mdf.xml">F11MDF</a>.</div>
<div class="paramtext"><i>On exit</i>: part of the array is modified to record the row permutation <m:math><m:msub><m:mi>P</m:mi><m:mi>r</m:mi></m:msub></m:math>&#160;determined by pivoting.</div></dd><dt class="paramhead"><a name="THRESH" id="THRESH"/>5: &#160;&#160;&#8194; THRESH &#8211; REAL&#160;(KIND=nag_wp)<span class="pclass">Input</span></dt><dd><div class="paramtext"><i>On entry</i>: the diagonal pivoting threshold, <m:math><m:mi>t</m:mi></m:math>. At step <m:math><m:mi>j</m:mi></m:math>&#160;of the Gaussian elimination, if <m:math><m:mfenced open="|" close="|" separators=""><m:msub><m:mi>A</m:mi><m:mrow><m:mi>j</m:mi><m:mi>j</m:mi></m:mrow></m:msub></m:mfenced><m:mo>&#8805;</m:mo><m:mi>t</m:mi><m:mo>&#8290;</m:mo><m:mfenced separators=""><m:mstyle displaystyle="true"><m:munder><m:mi mathvariant="normal">max</m:mi><m:mrow><m:mi>i</m:mi><m:mo>&#8805;</m:mo><m:mi>j</m:mi></m:mrow></m:munder></m:mstyle><m:mspace width="0.25em"/><m:mfenced open="|" close="|" separators=""><m:msub><m:mi>A</m:mi><m:mrow><m:mi>i</m:mi><m:mi>j</m:mi></m:mrow></m:msub></m:mfenced></m:mfenced></m:math>, use <m:math><m:msub><m:mi>A</m:mi><m:mrow><m:mi>j</m:mi><m:mi>j</m:mi></m:mrow></m:msub></m:math>&#160;as a pivot, otherwise use <m:math><m:mstyle displaystyle="true"><m:munder><m:mi mathvariant="normal">max</m:mi><m:mrow><m:mi>i</m:mi><m:mo>&#8805;</m:mo><m:mi>j</m:mi></m:mrow></m:munder></m:mstyle><m:mspace width="0.25em"/><m:mfenced open="|" close="|" separators=""><m:msub><m:mi>A</m:mi><m:mrow><m:mi>i</m:mi><m:mi>j</m:mi></m:mrow></m:msub></m:mfenced></m:math>. A value of <m:math><m:mi>t</m:mi><m:mo>=</m:mo><m:mn>1</m:mn></m:math>&#160;corresponds to partial pivoting, a value of <m:math><m:mi>t</m:mi><m:mo>=</m:mo><m:mn>0</m:mn></m:math>&#160;corresponds to always choosing the pivot on the diagonal (unless it is zero).</div><div class="paramtext"><i>Constraint</i>:
  <m:math><m:mn>0.0</m:mn><m:mo>&#8804;</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#THRESH"><m:mi mathcolor="#EE0000" mathvariant="bold">THRESH</m:mi></m:maction><m:mo>&#8804;</m:mo><m:mn>1.0</m:mn></m:math>.
</div>
<div class="paramtext"><i>Suggested value</i>:
  <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#THRESH"><m:mi mathcolor="#EE0000" mathvariant="bold">THRESH</m:mi></m:maction><m:mo>=</m:mo><m:mn>1.0</m:mn></m:math>. Smaller values may result in a faster factorization, but the benefits are likely to be small in most cases. It might be possible to use <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#THRESH"><m:mi mathcolor="#EE0000" mathvariant="bold">THRESH</m:mi></m:maction><m:mo>=</m:mo><m:mn>0.0</m:mn></m:math>&#160;if you are confident about the stability of the factorization, for example, if <m:math><m:mi>A</m:mi></m:math>&#160;is diagonally dominant.</div></dd><dt class="paramhead"><a name="NZLMX" id="NZLMX"/>6: &#160;&#160;&#8194; NZLMX &#8211; INTEGER<span class="pclass">Input</span></dt><dd><div class="paramtext"><i>On entry</i>: indicates the available size of array <a class="arg" href="#IL">IL</a>. The dimension of <a class="arg" href="#IL">IL</a> should be at least <m:math><m:mn>7</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:mo>+</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#NZLMX"><m:mi mathcolor="#EE0000" mathvariant="bold">NZLMX</m:mi></m:maction><m:mo>+</m:mo><m:mn>4</m:mn></m:math>. A good range for <a class="arg" href="#NZLMX">NZLMX</a> that works for many problems is <m:math><m:mi mathvariant="italic">nnz</m:mi></m:math>&#160;to <m:math><m:mn>8</m:mn><m:mo>&#215;</m:mo><m:mi mathvariant="italic">nnz</m:mi></m:math>, where <m:math><m:mi mathvariant="italic">nnz</m:mi></m:math>&#160;is the number of nonzeros in the sparse matrix <m:math><m:mi>A</m:mi></m:math>. If, on exit, <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="#IFeq2"><m:mn mathcolor="#003399" mathvariant="bold">2</m:mn></m:maction></m:math>, the given <a class="arg" href="#NZLMX">NZLMX</a> was too small and you should attempt to provide more storage and call the routine again.
</div><div class="paramtext"><i>Constraint</i>:
  <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#NZLMX"><m:mi mathcolor="#EE0000" mathvariant="bold">NZLMX</m:mi></m:maction><m:mo>&#8805;</m:mo><m:mn>1</m:mn></m:math>.
</div></dd><dt class="paramhead"><a name="NZLUMX" id="NZLUMX"/>7: &#160;&#160;&#8194; NZLUMX &#8211; INTEGER<span class="pclass">Input/Output</span></dt><dd><div class="paramtext"><i>On entry</i>: indicates the available size of array <a class="arg" href="#LVAL">LVAL</a>. The dimension of <a class="arg" href="#LVAL">LVAL</a> should be at least <a class="arg" href="#NZLUMX">NZLUMX</a>.</div><div class="paramtext"><i>Constraint</i>:
  <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#NZLUMX"><m:mi mathcolor="#EE0000" mathvariant="bold">NZLUMX</m:mi></m:maction><m:mo>&#8805;</m:mo><m:mn>1</m:mn></m:math>.
</div>
<div class="paramtext"><i>On exit</i>: 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="#IFeq4"><m:mn mathcolor="#003399" mathvariant="bold">4</m:mn></m:maction></m:math>, the given <a class="arg" href="#NZLUMX">NZLUMX</a> was too small and is reset to a value that will be sufficient. You should then provide the indicated storage and call the routine again.</div></dd><dt class="paramhead"><a name="NZUMX" id="NZUMX"/>8: &#160;&#160;&#8194; NZUMX &#8211; INTEGER<span class="pclass">Input</span></dt><dd><div class="paramtext"><i>On entry</i>: indicates the available sizes of arrays <a class="arg" href="#IU">IU</a> and <a class="arg" href="#UVAL">UVAL</a>. The dimension of <a class="arg" href="#IU">IU</a> should be at least <m:math><m:mn>2</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:mo>+</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#NZUMX"><m:mi mathcolor="#EE0000" mathvariant="bold">NZUMX</m:mi></m:maction><m:mo>+</m:mo><m:mn>1</m:mn></m:math>&#160;and the dimension of <a class="arg" href="#UVAL">UVAL</a> should be at least <a class="arg" href="#NZUMX">NZUMX</a>. A good range for <a class="arg" href="#NZUMX">NZUMX</a> that works for many problems is <m:math><m:mi mathvariant="italic">nnz</m:mi></m:math>&#160;to <m:math><m:mn>8</m:mn><m:mo>&#215;</m:mo><m:mi mathvariant="italic">nnz</m:mi></m:math>, where <m:math><m:mi mathvariant="italic">nnz</m:mi></m:math>&#160;is the number of nonzeros in the sparse matrix <m:math><m:mi>A</m:mi></m:math>. If, on exit, <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>, the given <a class="arg" href="#NZUMX">NZUMX</a> was too small and you should attempt to provide more storage and call the routine again.</div><div class="paramtext"><i>Constraint</i>:
  <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#NZUMX"><m:mi mathcolor="#EE0000" mathvariant="bold">NZUMX</m:mi></m:maction><m:mo>&#8805;</m:mo><m:mn>1</m:mn></m:math>.
</div></dd><dt class="paramhead"><a name="IL" id="IL"/>9: &#160;&#160;&#8194; IL(<m:math><m:mn>7</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:mo>+</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#NZLMX"><m:mi mathcolor="#EE0000" mathvariant="bold">NZLMX</m:mi></m:maction><m:mo>+</m:mo><m:mn>4</m:mn></m:math>&#160;) &#8211; INTEGER&#160;array<span class="pclass">Output</span></dt><dd><div class="paramtext"><i>On exit</i>: encapsulates the sparsity pattern of matrix <m:math><m:mi>L</m:mi></m:math>.</div></dd><dt class="paramhead"><a name="LVAL" id="LVAL"/>10: &#8194; LVAL(<a class="arg" href="#NZLUMX">NZLUMX</a>) &#8211; REAL&#160;(KIND=nag_wp)&#160;array<span class="pclass">Output</span></dt><dd><div class="paramtext"><i>On exit</i>: records the nonzero values of matrix <m:math><m:mi>L</m:mi></m:math>&#160;and some of the nonzero values of matrix <m:math><m:mi>U</m:mi></m:math>.</div></dd><dt class="paramhead"><a name="IU" id="IU"/>11: &#8194; IU(<m:math><m:mn>2</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:mo>+</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#NZUMX"><m:mi mathcolor="#EE0000" mathvariant="bold">NZUMX</m:mi></m:maction><m:mo>+</m:mo><m:mn>1</m:mn></m:math>) &#8211; INTEGER&#160;array<span class="pclass">Output</span></dt><dd><div class="paramtext"><i>On exit</i>: encapsulates the sparsity pattern of matrix <m:math><m:mi>U</m:mi></m:math>.</div></dd><dt class="paramhead"><a name="UVAL" id="UVAL"/>12: &#8194; UVAL(<m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#NZUMX"><m:mi mathcolor="#EE0000" mathvariant="bold">NZUMX</m:mi></m:maction></m:math>) &#8211; REAL&#160;(KIND=nag_wp)&#160;array<span class="pclass">Output</span></dt><dd><div class="paramtext"><i>On exit</i>: records some of the nonzero values of matrix <m:math><m:mi>U</m:mi></m:math>.</div></dd><dt class="paramhead"><a name="NNZL" id="NNZL"/>13: &#8194; NNZL &#8211; INTEGER<span class="pclass">Output</span></dt><dd><div class="paramtext"><i>On exit</i>: the number of nonzero values in the matrix <m:math><m:mi>L</m:mi></m:math>.</div></dd><dt class="paramhead"><a name="NNZU" id="NNZU"/>14: &#8194; NNZU &#8211; INTEGER<span class="pclass">Output</span></dt><dd><div class="paramtext"><i>On exit</i>: the number of nonzero values in the matrix <m:math><m:mi>U</m:mi></m:math>.</div></dd><dt class="paramhead"><a name="FLOP" id="FLOP"/>15: &#8194; FLOP &#8211; REAL&#160;(KIND=nag_wp)<span class="pclass">Output</span></dt><dd><div class="paramtext"><i>On exit</i>: the number of floating point operations performed.</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"><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#errorhandling">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 or a warning has been flagged (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>0</m:mn></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="#NZLMX"><m:mi mathcolor="#EE0000" mathvariant="bold">NZLMX</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"><m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#NZLUMX"><m:mi mathcolor="#EE0000" mathvariant="bold">NZLUMX</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"><m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#NZUMX"><m:mi mathcolor="#EE0000" mathvariant="bold">NZUMX</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"><m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#THRESH"><m:mi mathcolor="#EE0000" mathvariant="bold">THRESH</m:mi></m:maction><m:mo>&lt;</m:mo><m:mn>0.0</m:mn></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="#THRESH"><m:mi mathcolor="#EE0000" mathvariant="bold">THRESH</m:mi></m:maction><m:mo>&gt;</m:mo><m:mn>1.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><div class="paramtext"><m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#NZLMX"><m:mi mathcolor="#EE0000" mathvariant="bold">NZLMX</m:mi></m:maction></m:math>&#160;was not large enough. You should repeat the call with a larger value of <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#NZLMX"><m:mi mathcolor="#EE0000" mathvariant="bold">NZLMX</m:mi></m:maction></m:math>, providing more storage for the output array <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#IL"><m:mi mathcolor="#EE0000" mathvariant="bold">IL</m:mi></m:maction></m:math>.</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:maction actiontype="link" dsi:type="simple" dsi:href="#NZUMX"><m:mi mathcolor="#EE0000" mathvariant="bold">NZUMX</m:mi></m:maction></m:math>&#160;was not large enough. You should repeat the call with a larger value of <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#NZUMX"><m:mi mathcolor="#EE0000" mathvariant="bold">NZUMX</m:mi></m:maction></m:math>, providing more storage for the output arrays <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#IU"><m:mi mathcolor="#EE0000" mathvariant="bold">IU</m:mi></m:maction></m:math>&#160;and <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#UVAL"><m:mi mathcolor="#EE0000" mathvariant="bold">UVAL</m:mi></m:maction></m:math>.</div></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"><m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#NZLUMX"><m:mi mathcolor="#EE0000" mathvariant="bold">NZLUMX</m:mi></m:maction></m:math>&#160;was not large enough. You should repeat the call with the value of <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#NZLUMX"><m:mi mathcolor="#EE0000" mathvariant="bold">NZLUMX</m:mi></m:maction></m:math>&#160;returned on exit, providing more storage for the output array <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#LVAL"><m:mi mathcolor="#EE0000" mathvariant="bold">LVAL</m:mi></m:maction></m:math>.</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 matrix <m:math><m:mi>A</m:mi></m:math>&#160;is singular and no factorization will be attempted.</div></dd>
</dl><dl class="ifail">
<dt class="errorhead"><a name="IFeq301" id="IFeq301"/><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>301</m:mn></m:math></dt>
<dd><div class="paramtext">Unable to allocate required internal workspace.</div></dd>
</dl><h2 class="standard"><a class="sec" name="accuracy" id="accuracy"/>7&#160;&#160;Accuracy</h2>
<div class="paramtext">The computed factors <m:math><m:mi>L</m:mi></m:math>&#160;and <m:math><m:mi>U</m:mi></m:math>&#160;are the exact factors of a perturbed matrix <m:math><m:mi>A</m:mi><m:mo>+</m:mo><m:mi>E</m:mi></m:math>, where

<div class="formula"><table class="formula"><tr><td class="formula"><m:math display="block">
<m:mfenced open="|" close="|" separators="">
  <m:mi>E</m:mi>
 </m:mfenced>
 <m:mo>&#8804;</m:mo>
 <m:mi>c</m:mi>
 <m:mfenced separators="">
  <m:mi>n</m:mi>
 </m:mfenced>
 <m:mi>&#949;</m:mi>
 <m:mfenced open="|" close="|" separators=""><m:mi>L</m:mi></m:mfenced>
 <m:mfenced open="|" close="|" separators=""><m:mi>U</m:mi></m:mfenced>
 <m:mtext>,</m:mtext>
</m:math></td><td class="formula2"/></tr></table></div><m:math><m:mi>c</m:mi><m:mfenced separators=""><m:mi>n</m:mi></m:mfenced></m:math>&#160;is a modest linear function of <m:math><m:mi>n</m:mi></m:math>, and  <m:math><m:mi>&#949;</m:mi></m:math>&#160;is the <span class="bitalic">machine precision</span>, when partial pivoting is used. If no partial pivoting is used, the factorization accuracy can be considerably worse. A call to <a class="rout" href="../F11/f11mmf.xml">F11MMF</a> after F11MEF can help determine the quality of the factorization.</div><h2 class="standard"><a class="sec" name="fcomments" id="fcomments"/>8&#160;&#160;Further Comments</h2>
<div class="paramtext">The total number of floating point operations depends on the sparsity pattern of the matrix <m:math><m:mi>A</m:mi></m:math>.</div><div class="paramtext">A call to F11MEF may be followed by calls to the routines:
<ul class="listind"><li class="listind"><a class="rout" href="../F11/f11mff.xml">F11MFF</a> to solve <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>;</li><li class="listind"><a class="rout" href="../F11/f11mgf.xml">F11MGF</a> to estimate the condition number of <m:math><m:mi>A</m:mi></m:math>;</li><li class="listind"><a class="rout" href="../F11/f11mmf.xml">F11MMF</a> to estimate the reciprocal pivot growth of the <m:math>
 <m:mi>L</m:mi><m:mi>U</m:mi>
</m:math>&#160;factorization.</li></ul>
</div><h2 class="standard"><a class="sec" name="example" id="example"/>9&#160;&#160;Example</h2>
<div class="paramtext">This example computes the <m:math><m:mi>L</m:mi><m:mi>U</m:mi></m:math>&#160;factorization of the matrix <m:math><m:mi>A</m:mi></m:math>,  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>
  <m:mtr columnalign="right">
   <m:mtd><m:mn>2.00</m:mn></m:mtd>
   <m:mtd><m:mn>1.00</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 columnalign="right">
   <m:mtd><m:mn>0</m:mn></m:mtd>
   <m:mtd><m:mn>0</m:mn></m:mtd>
   <m:mtd><m:mn>1.00</m:mn></m:mtd>
   <m:mtd><m:mrow><m:mo>-</m:mo><m:mn>1.00</m:mn></m:mrow></m:mtd>
   <m:mtd><m:mn>0</m:mn></m:mtd>
  </m:mtr><m:mtr columnalign="right">
   <m:mtd><m:mn>4.00</m:mn></m:mtd>
   <m:mtd><m:mn>0</m:mn></m:mtd>
   <m:mtd><m:mn>1.00</m:mn></m:mtd>
   <m:mtd><m:mn>0</m:mn></m:mtd>
   <m:mtd><m:mn>1.00</m:mn></m:mtd>
  </m:mtr><m:mtr columnalign="right">
   <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>1.00</m:mn></m:mtd>
   <m:mtd><m:mn>2.00</m:mn></m:mtd>
  </m:mtr><m:mtr columnalign="right">
   <m:mtd><m:mn>0</m:mn></m:mtd>
   <m:mtd><m:mrow><m:mo>-</m:mo><m:mn>2.00</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>3.00</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/f11mefe.f90">Program Text (f11mefe.f90)</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/f11mefe.d">Program&#160;Data (f11mefe.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/f11mefe.r">Program Results (f11mefe.r)</a></p>
<hr/><div><a class="rout" href="../../pdf/F11/f11mef.pdf">F11MEF (PDF version)</a></div><div><a class="chap" href="f11conts.xml">F11 Chapter Contents</a></div><div><a class="chapint" href="f11intro.xml">F11 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. 2011</a></div></body></html>