<?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>F02XEF : NAG Library, Mark 22</title><link rel="stylesheet" href="../styles/libdoc.css" type="text/css"/><script type="text/javascript">
   function showLevel(_levelId){
    var thisLevel = document.getElementById(_levelId);
    var thisplus = document.getElementById( _levelId.concat('plus'));
    var thisminus = document.getElementById( _levelId.concat('minus'));
    if(thisLevel.style.display != "block"){
     thisLevel.style.display = "block";
     thisplus.style.display = "none";
     thisminus.style.display = "inline";
     }
    else{
     thisLevel.style.display = "none";
     thisminus.style.display = "none";
     thisplus.style.display = "inline";
     }
    }
  </script></head><body><hr/><div><a class="rout" href="../../pdf/F02/f02xef.pdf">F02XEF (PDF version)</a></div><div><a class="chap" href="f02conts.xml">F02 Chapter Contents</a></div><div><a class="chapint" href="f02intro.xml">F02 Chapter Introduction</a></div>
<div><a class="htmltoc" href="../FRONTMATTER/manconts.xml">NAG Library Manual</a></div><hr/><h1 class="libdoc">NAG Library Routine Document<br/><br/>F02XEF</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">F02XEF returns all, or part, of the singular value decomposition of a general complex 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;F02XEF&#160;(</td><td class="tdfspec2"><a class="arg" href="#M">M</a>, <a class="arg" href="#N">N</a>, <a class="arg" href="#A">A</a>, <a class="arg" href="#LDA">LDA</a>, <a class="arg" href="#NCOLB">NCOLB</a>, <a class="arg" href="#B">B</a>, <a class="arg" href="#LDB">LDB</a>, <a class="arg" href="#WANTQ">WANTQ</a>, <a class="arg" href="#Q">Q</a>, <a class="arg" href="#LDQ">LDQ</a>, <a class="arg" href="#SV">SV</a>, <a class="arg" href="#WANTP">WANTP</a>, <a class="arg" href="#PH">PH</a>, <a class="arg" href="#LDPH">LDPH</a>, <a class="arg" href="#RWORK">RWORK</a>, <a class="arg" href="#CWORK">CWORK</a>, <a class="arg" href="#IFAIL">IFAIL</a>)</td></tr><tr><td class="tdfspec1">INTEGER</td><td class="tdfspec2">M, N, LDA, NCOLB, LDB, LDQ, LDPH, IFAIL</td></tr><tr><td class="tdfspec1"><b><i>double&#160;precision</i></b></td><td class="tdfspec2">SV(min(M,N)), RWORK(*)</td></tr><tr><td class="tdfspec1"><b><i>complex*16</i></b></td><td class="tdfspec2">A(LDA,*), B(LDB,*), Q(LDQ,*), PH(LDPH,*), CWORK(*)</td></tr><tr><td class="tdfspec1">LOGICAL</td><td class="tdfspec2">WANTQ, WANTP</td></tr></table><h2 class="standard"><a class="sec" name="description" id="description"/>3&#160;&#160;Description</h2>
<div class="paramtext">The <m:math><m:mi>m</m:mi></m:math>&#160;by <m:math><m:mi>n</m:mi></m:math>&#160;matrix <m:math><m:mi>A</m:mi></m:math>&#160;is factorized as

<div class="formula"><table class="formula"><tr><td class="formula"><m:math display="block">
<m:mi>A</m:mi><m:mo>=</m:mo><m:mi>Q</m:mi><m:mi>D</m:mi><m:msup><m:mi>P</m:mi><m:mi mathvariant="normal">H</m:mi></m:msup><m:mtext>,</m:mtext>
</m:math></td><td class="formula2"/></tr></table></div>

where

<div class="formula"><table class="formula"><tr><td class="formula"><m:math display="block">
<m:mtable columnalign="left">
 <m:mtr>
  <m:mtd>
   <m:mi>D</m:mi>
   <m:mo>=</m:mo>
   <m:mfenced><m:mtable>
     <m:mtr>
      <m:mtd><m:mi>S</m:mi></m:mtd>
     </m:mtr><m:mtr>
      <m:mtd><m:mn>0</m:mn></m:mtd>
     </m:mtr>
    </m:mtable></m:mfenced>
   <m:mtext>,</m:mtext>
  </m:mtd>
  <m:mtd><m:mi>m</m:mi><m:mo>&gt;</m:mo><m:mi>n</m:mi><m:mtext>,</m:mtext></m:mtd>
 </m:mtr><m:mtr>
  <m:mtd/></m:mtr><m:mtr>
  <m:mtd><m:mi>D</m:mi><m:mo>=</m:mo><m:mi>S</m:mi><m:mtext>,</m:mtext></m:mtd>
  <m:mtd><m:mi>m</m:mi><m:mo>=</m:mo><m:mi>n</m:mi><m:mtext>,</m:mtext></m:mtd>
 </m:mtr><m:mtr>
  <m:mtd/></m:mtr><m:mtr>
  <m:mtd><m:mi>D</m:mi><m:mo>=</m:mo><m:mfenced><m:mtable>
     <m:mtr>
      <m:mtd><m:mi>S</m:mi></m:mtd>
      <m:mtd><m:mn>0</m:mn></m:mtd>
     </m:mtr>
    </m:mtable></m:mfenced>
   <m:mtext>,</m:mtext>
  </m:mtd>
  <m:mtd><m:mi>m</m:mi><m:mo>&lt;</m:mo><m:mi>n</m:mi><m:mtext>,</m:mtext></m:mtd>
 </m:mtr>
</m:mtable>
</m:math></td><td class="formula2"/></tr></table></div><m:math><m:mi>Q</m:mi></m:math>&#160;is an <m:math><m:mi>m</m:mi></m:math>&#160;by <m:math><m:mi>m</m:mi></m:math>&#160;unitary matrix, <m:math><m:mi>P</m:mi></m:math>&#160;is an <m:math><m:mi>n</m:mi></m:math>&#160;by <m:math><m:mi>n</m:mi></m:math>&#160;unitary matrix and <m:math><m:mi>S</m:mi></m:math>&#160;is a <m:math><m:mrow><m:mi>min</m:mi><m:mspace width="0.125em"/><m:mfenced separators=""><m:mi>m</m:mi><m:mo>,</m:mo><m:mi>n</m:mi></m:mfenced></m:mrow></m:math>&#160;by  <m:math><m:mrow><m:mi>min</m:mi><m:mspace width="0.125em"/><m:mfenced separators=""><m:mi>m</m:mi><m:mo>,</m:mo><m:mi>n</m:mi></m:mfenced></m:mrow></m:math>&#160;diagonal matrix with real non-negative diagonal elements, <m:math><m:mi>s</m:mi><m:msub><m:mi>v</m:mi><m:mn>1</m:mn></m:msub><m:mo>,</m:mo><m:mi>s</m:mi><m:msub><m:mi>v</m:mi><m:mn>2</m:mn></m:msub><m:mo>,</m:mo><m:mo>&#8230;</m:mo><m:mo>,</m:mo><m:mi>s</m:mi><m:msub><m:mi>v</m:mi><m:mrow><m:mi>min</m:mi><m:mspace width="0.125em"/><m:mfenced separators=""><m:mi>m</m:mi><m:mo>,</m:mo><m:mi>n</m:mi></m:mfenced></m:mrow></m:msub></m:math>, ordered such that

<div class="formula"><table class="formula"><tr><td class="formula"><m:math display="block">
<m:mi>s</m:mi><m:msub><m:mi>v</m:mi><m:mn>1</m:mn></m:msub><m:mo>&#8805;</m:mo><m:mi>s</m:mi><m:msub><m:mi>v</m:mi><m:mn>2</m:mn></m:msub><m:mo>&#8805;</m:mo><m:mo>&#8943;</m:mo><m:mo>&#8805;</m:mo><m:mi>s</m:mi><m:msub><m:mi>v</m:mi><m:mrow><m:mi>min</m:mi><m:mspace width="0.125em"/><m:mfenced separators=""><m:mi>m</m:mi><m:mo>,</m:mo><m:mi>n</m:mi></m:mfenced></m:mrow></m:msub><m:mo>&#8805;</m:mo><m:mn>0</m:mn><m:mtext>.</m:mtext>
</m:math></td><td class="formula2"/></tr></table></div>

The first <m:math><m:mrow><m:mi>min</m:mi><m:mspace width="0.125em"/><m:mfenced separators=""><m:mi>m</m:mi><m:mo>,</m:mo><m:mi>n</m:mi></m:mfenced></m:mrow></m:math>&#160;columns of <m:math><m:mi>Q</m:mi></m:math>&#160;are the left-hand singular vectors of <m:math><m:mi>A</m:mi></m:math>, the diagonal elements of  <m:math><m:mi>S</m:mi></m:math>&#160;are the singular values of <m:math><m:mi>A</m:mi></m:math>&#160;and the first  <m:math><m:mrow><m:mi>min</m:mi><m:mspace width="0.125em"/><m:mfenced separators=""><m:mi>m</m:mi><m:mo>,</m:mo><m:mi>n</m:mi></m:mfenced></m:mrow></m:math>&#160;columns of <m:math><m:mi>P</m:mi></m:math>&#160;are the right-hand singular vectors of <m:math><m:mi>A</m:mi></m:math>.</div><div class="paramtext">Either or both of the left-hand and right-hand singular vectors of  <m:math><m:mi>A</m:mi></m:math>&#160;may be requested and the matrix <m:math><m:mi>C</m:mi></m:math>&#160;given by

<div class="formula"><table class="formula"><tr><td class="formula"><m:math display="block">
<m:mi>C</m:mi><m:mo>=</m:mo><m:msup><m:mi>Q</m:mi><m:mi mathvariant="normal">H</m:mi></m:msup><m:mi>B</m:mi><m:mtext>,</m:mtext>
</m:math></td><td class="formula2"/></tr></table></div>

where <m:math><m:mi>B</m:mi></m:math>&#160;is an <m:math><m:mi>m</m:mi></m:math>&#160;by <m:math><m:mi mathvariant="italic">ncolb</m:mi></m:math>&#160;given matrix, may also be requested.</div><div class="paramtext">The routine obtains the singular value decomposition by first reducing <m:math><m:mi>A</m:mi></m:math>&#160;to upper triangular form by means of Householder transformations, from the left when <m:math><m:mi>m</m:mi><m:mo>&#8805;</m:mo><m:mi>n</m:mi></m:math>&#160;and from the right when <m:math><m:mi>m</m:mi><m:mo>&lt;</m:mo><m:mi>n</m:mi><m:mtext>.</m:mtext></m:math>&#160;The upper triangular form is then reduced to bidiagonal form by Givens plane rotations and finally the  <m:math><m:mi>Q</m:mi><m:mi>R</m:mi></m:math>&#160;algorithm is used to obtain the singular value decomposition of the bidiagonal form.</div><div class="paramtext">Good background descriptions to the singular value decomposition are given in <a class="ref" href="#ref104">Dongarra <span class="italic">et al.</span> (1979)</a>, <a class="ref" href="#ref114">Hammarling (1985)</a> and <a class="ref" href="#ref115">Wilkinson (1978)</a>.  Note that this routine is not based on the  LINPACK routine CSVDC/ZSVDC.</div><div class="paramtext">Note that if <m:math><m:mi>K</m:mi></m:math>&#160;is any unitary diagonal matrix so that

<div class="formula"><table class="formula"><tr><td class="formula"><m:math display="block">
<m:mi>K</m:mi><m:msup><m:mi>K</m:mi><m:mi mathvariant="normal">H</m:mi></m:msup><m:mo>=</m:mo><m:mi>I</m:mi><m:mtext>,</m:mtext>
</m:math></td><td class="formula2"/></tr></table></div>

then

<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 separators=""><m:mrow><m:mi>Q</m:mi><m:mi>K</m:mi></m:mrow></m:mfenced><m:mi>D</m:mi><m:msup><m:mfenced separators=""><m:mrow><m:mi>P</m:mi><m:mi>K</m:mi></m:mrow></m:mfenced><m:mi mathvariant="normal">H</m:mi></m:msup>
</m:math></td><td class="formula2"/></tr></table></div>

is also a singular value decomposition of <m:math><m:mi>A</m:mi></m:math>.</div><h2 class="standard"><a class="sec" name="references" id="references"/>4&#160;&#160;References</h2><div class="paramtext"><a name="ref104" id="ref104"/>Dongarra J J, Moler C B, Bunch J R and Stewart G W (1979)  <i>LINPACK Users' Guide</i> SIAM, Philadelphia </div>
<div class="paramtext"><a name="ref114" id="ref114"/>Hammarling S (1985)  The singular value decomposition in multivariate statistics <i>SIGNUM Newsl.</i> <b>20 (3)</b> 2&#8211;25 </div>
<div class="paramtext"><a name="ref115" id="ref115"/>Wilkinson J H (1978)  Singular Value Decomposition &#8211; Basic Aspects <i>Numerical Software &#8211; Needs and Availability</i> (ed D A H Jacobs) Academic Press </div><h2 class="standard"><a class="sec" name="parameters" id="parameters"/>5&#160;&#160;Parameters</h2>
<dl><dt class="paramhead"><a name="M" id="M"/>1: &#160;&#160;&#8194; M &#8211; INTEGER<span class="pclass">Input</span></dt><dd><div class="paramtext"><i>On entry</i>: 
<m:math><m:mi>m</m:mi></m:math>, the number of rows 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="#M"><m:mi mathcolor="#EE0000" mathvariant="bold">M</m:mi></m:maction><m:mo>&#8805;</m:mo><m:mn>0</m:mn></m:math>.<div class="paramtext">If <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#M"><m:mi mathcolor="#EE0000" mathvariant="bold">M</m:mi></m:maction><m:mo>=</m:mo><m:mn>0</m:mn></m:math>, an immediate return is effected.</div></div></dd><dt class="paramhead"><a name="N" id="N"/>2: &#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 number of columns 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 class="paramtext">If <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>=</m:mo><m:mn>0</m:mn></m:math>, an immediate return is effected.</div></div></dd><dt class="paramhead"><a name="A" id="A"/>3: &#160;&#160;&#8194; A(<a class="arg" href="#LDA">LDA</a>,<m:math><m:mo>*</m:mo></m:math>) &#8211; <span class="bitalic">complex*16</span> array<span class="pclass">Input/Output</span></dt><dd><div class="paramtext"><b>Note:</b> the second dimension of the array <a class="arg" href="#A">A</a>
must be at least
<m:math><m:mrow><m:mi>max</m:mi><m:mspace width="0.125em"/><m:mfenced separators=""><m:mn>1</m:mn><m:mo>,</m:mo><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>.</div>
<div class="paramtext"><i>On entry</i>: the leading <m:math><m:mi>m</m:mi></m:math>&#160;by <m:math><m:mi>n</m:mi></m:math>&#160;part of the array <a class="arg" href="#A">A</a> must contain the matrix <m:math><m:mi>A</m:mi></m:math>&#160;whose singular value decomposition is required.</div>
<div class="paramtext"><i>On exit</i>: if <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#M"><m:mi mathcolor="#EE0000" mathvariant="bold">M</m:mi></m:maction><m:mo>&#8805;</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#N"><m:mi mathcolor="#EE0000" mathvariant="bold">N</m:mi></m:maction></m:math>&#160;and <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#WANTQ"><m:mi mathcolor="#EE0000" mathvariant="bold">WANTQ</m:mi></m:maction><m:mo>=</m:mo><m:mi mathvariant="normal">.TRUE.</m:mi></m:math>, the leading <m:math><m:mi>m</m:mi></m:math>&#160;by <m:math><m:mi>n</m:mi></m:math>&#160;part of <a class="arg" href="#A">A</a> will contain the first <m:math><m:mi>n</m:mi></m:math>&#160;columns of the unitary matrix <m:math><m:mi>Q</m:mi></m:math>.
<div class="paramtext">If <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#M"><m:mi mathcolor="#EE0000" mathvariant="bold">M</m:mi></m:maction><m:mo>&lt;</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#N"><m:mi mathcolor="#EE0000" mathvariant="bold">N</m:mi></m:maction></m:math>&#160;and <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#WANTP"><m:mi mathcolor="#EE0000" mathvariant="bold">WANTP</m:mi></m:maction><m:mo>=</m:mo><m:mi mathvariant="normal">.TRUE.</m:mi></m:math>, the leading <m:math><m:mi>m</m:mi></m:math>&#160;by <m:math><m:mi>n</m:mi></m:math>&#160;part of <a class="arg" href="#A">A</a> will contain the first <m:math><m:mi>m</m:mi></m:math>&#160;rows of the unitary matrix <m:math><m:msup><m:mi>P</m:mi><m:mi mathvariant="normal">H</m:mi></m:msup></m:math>.</div>
<div class="paramtext">If <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#M"><m:mi mathcolor="#EE0000" mathvariant="bold">M</m:mi></m:maction><m:mo>&#8805;</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#N"><m:mi mathcolor="#EE0000" mathvariant="bold">N</m:mi></m:maction></m:math>&#160;and <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#WANTQ"><m:mi mathcolor="#EE0000" mathvariant="bold">WANTQ</m:mi></m:maction><m:mo>=</m:mo><m:mi mathvariant="normal">.FALSE.</m:mi></m:math>&#160;and <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#WANTP"><m:mi mathcolor="#EE0000" mathvariant="bold">WANTP</m:mi></m:maction><m:mo>=</m:mo><m:mi mathvariant="normal">.TRUE.</m:mi></m:math>, the leading <m:math><m:mi>n</m:mi></m:math>&#160;by <m:math><m:mi>n</m:mi></m:math>&#160;part of <a class="arg" href="#A">A</a> will contain the first <m:math><m:mi>n</m:mi></m:math>&#160;rows of the unitary matrix <m:math><m:msup><m:mi>P</m:mi><m:mi mathvariant="normal">H</m:mi></m:msup></m:math>.</div>
<div class="paramtext">Otherwise the leading <m:math><m:mi>m</m:mi></m:math>&#160;by <m:math><m:mi>n</m:mi></m:math>&#160;part of <a class="arg" href="#A">A</a> is used as internal workspace.</div>
</div></dd><dt class="paramhead"><a name="LDA" id="LDA"/>4: &#160;&#160;&#8194; LDA &#8211; INTEGER<span class="pclass">Input</span></dt><dd><div class="paramtext"><i>On entry</i>: the first dimension of the array <a class="arg" href="#A">A</a> as declared in the (sub)program from which F02XEF is called.</div><div class="paramtext"><i>Constraint</i>:
  <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#LDA"><m:mi mathcolor="#EE0000" mathvariant="bold">LDA</m:mi></m:maction><m:mo>&#8805;</m:mo><m:mrow><m:mi>max</m:mi><m:mspace width="0.125em"/><m:mfenced separators=""><m:mn>1</m:mn><m:mo>,</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#M"><m:mi mathcolor="#EE0000" mathvariant="bold">M</m:mi></m:maction></m:mfenced></m:mrow></m:math>.
</div></dd><dt class="paramhead"><a name="NCOLB" id="NCOLB"/>5: &#160;&#160;&#8194; NCOLB &#8211; INTEGER<span class="pclass">Input</span></dt><dd><div class="paramtext"><i>On entry</i>: 
<m:math><m:mi mathvariant="italic">ncolb</m:mi></m:math>, the number of columns of the matrix <m:math><m:mi>B</m:mi></m:math>.
<div class="paramtext">If <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#NCOLB"><m:mi mathcolor="#EE0000" mathvariant="bold">NCOLB</m:mi></m:maction><m:mo>=</m:mo><m:mn>0</m:mn></m:math>, the array <a class="arg" href="#B">B</a> is not referenced.</div>
</div><div class="paramtext"><i>Constraint</i>:
  <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#NCOLB"><m:mi mathcolor="#EE0000" mathvariant="bold">NCOLB</m:mi></m:maction><m:mo>&#8805;</m:mo><m:mn>0</m:mn></m:math>.
</div></dd><dt class="paramhead"><a name="B" id="B"/>6: &#160;&#160;&#8194; B(<a class="arg" href="#LDB">LDB</a>,<m:math><m:mo>*</m:mo></m:math>) &#8211; <span class="bitalic">complex*16</span> array<span class="pclass">Input/Output</span></dt><dd><div class="paramtext"><b>Note:</b> the second dimension of the array <a class="arg" href="#B">B</a>
must be at least
<m:math><m:mrow><m:mi>max</m:mi><m:mspace width="0.125em"/><m:mfenced separators=""><m:mn>1</m:mn><m:mo>,</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#NCOLB"><m:mi mathcolor="#EE0000" mathvariant="bold">NCOLB</m:mi></m:maction></m:mfenced></m:mrow></m:math>.</div>
<div class="paramtext"><i>On entry</i>: if <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#NCOLB"><m:mi mathcolor="#EE0000" mathvariant="bold">NCOLB</m:mi></m:maction><m:mo>&gt;</m:mo><m:mn>0</m:mn></m:math>, the leading <m:math><m:mi>m</m:mi></m:math>&#160;by <m:math><m:mi mathvariant="italic">ncolb</m:mi></m:math>&#160;part of the array <a class="arg" href="#B">B</a> must contain the matrix to be transformed.</div>
<div class="paramtext"><i>On exit</i>: is overwritten by the <m:math><m:mi>m</m:mi></m:math>&#160;by <m:math><m:mi mathvariant="italic">ncolb</m:mi></m:math>&#160;matrix <m:math><m:msup><m:mi>Q</m:mi><m:mi mathvariant="normal">H</m:mi></m:msup><m:maction actiontype="link" dsi:type="simple" dsi:href="#B"><m:mi mathcolor="#EE0000" mathvariant="bold">B</m:mi></m:maction></m:math>.</div></dd><dt class="paramhead"><a name="LDB" id="LDB"/>7: &#160;&#160;&#8194; LDB &#8211; INTEGER<span class="pclass">Input</span></dt><dd><div class="paramtext"><i>On entry</i>: the first dimension of the array <a class="arg" href="#B">B</a> as declared in the (sub)program from which F02XEF is called.</div><div class="paramtext"><i>Constraints</i>:
   <div class="paramtext"/><ul class="listcons">
<li class="listcons">if <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#NCOLB"><m:mi mathcolor="#EE0000" mathvariant="bold">NCOLB</m:mi></m:maction><m:mo>&gt;</m:mo><m:mn>0</m:mn></m:math>, <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#LDB"><m:mi mathcolor="#EE0000" mathvariant="bold">LDB</m:mi></m:maction><m:mo>&#8805;</m:mo><m:mrow><m:mi>max</m:mi><m:mspace width="0.125em"/><m:mfenced separators=""><m:mn>1</m:mn><m:mo>,</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#M"><m:mi mathcolor="#EE0000" mathvariant="bold">M</m:mi></m:maction></m:mfenced></m:mrow></m:math>;</li>
<li class="listcons">otherwise <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#LDB"><m:mi mathcolor="#EE0000" mathvariant="bold">LDB</m:mi></m:maction><m:mo>&#8805;</m:mo><m:mn>1</m:mn></m:math>.</li>
</ul></div></dd><dt class="paramhead"><a name="WANTQ" id="WANTQ"/>8: &#160;&#160;&#8194; WANTQ &#8211; LOGICAL<span class="pclass">Input</span></dt><dd><div class="paramtext"><i>On entry</i>: must be .TRUE. if the left-hand singular vectors are required. 
<div class="paramtext">If <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#WANTQ"><m:mi mathcolor="#EE0000" mathvariant="bold">WANTQ</m:mi></m:maction><m:mo>=</m:mo><m:mi mathvariant="normal">.FALSE.</m:mi></m:math>, the array <a class="arg" href="#Q">Q</a> is not referenced.</div>
</div></dd><dt class="paramhead"><a name="Q" id="Q"/>9: &#160;&#160;&#8194; Q(<a class="arg" href="#LDQ">LDQ</a>,<m:math><m:mo>*</m:mo></m:math>) &#8211; <span class="bitalic">complex*16</span> array<span class="pclass">Output</span></dt><dd><div class="paramtext"><b>Note:</b> the second dimension of the array <a class="arg" href="#Q">Q</a>
must be at least
<m:math><m:mrow><m:mi>max</m:mi><m:mspace width="0.125em"/><m:mfenced separators=""><m:mn>1</m:mn><m:mo>,</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#M"><m:mi mathcolor="#EE0000" mathvariant="bold">M</m:mi></m:maction></m:mfenced></m:mrow></m:math> if <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#M"><m:mi mathcolor="#EE0000" mathvariant="bold">M</m:mi></m:maction><m:mo>&lt;</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#N"><m:mi mathcolor="#EE0000" mathvariant="bold">N</m:mi></m:maction></m:math>&#160;and <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#WANTQ"><m:mi mathcolor="#EE0000" mathvariant="bold">WANTQ</m:mi></m:maction><m:mo>=</m:mo><m:mi mathvariant="normal">.TRUE.</m:mi></m:math>,, and at least <m:math><m:mn>1</m:mn></m:math> otherwise.</div>
<div class="paramtext"><i>On exit</i>: if <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#M"><m:mi mathcolor="#EE0000" mathvariant="bold">M</m:mi></m:maction><m:mo>&lt;</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#N"><m:mi mathcolor="#EE0000" mathvariant="bold">N</m:mi></m:maction></m:math>&#160;and <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#WANTQ"><m:mi mathcolor="#EE0000" mathvariant="bold">WANTQ</m:mi></m:maction><m:mo>=</m:mo><m:mi mathvariant="normal">.TRUE.</m:mi></m:math>, the leading <m:math><m:mi>m</m:mi></m:math>&#160;by <m:math><m:mi>m</m:mi></m:math>&#160;part of the array <a class="arg" href="#Q">Q</a> will contain the unitary matrix <m:math><m:mi>Q</m:mi></m:math>. Otherwise the array <a class="arg" href="#Q">Q</a> is not referenced.</div></dd><dt class="paramhead"><a name="LDQ" id="LDQ"/>10: &#8194; LDQ &#8211; INTEGER<span class="pclass">Input</span></dt><dd><div class="paramtext"><i>On entry</i>: the first dimension of the array <a class="arg" href="#Q">Q</a> as declared in the (sub)program from which F02XEF is called.</div><div class="paramtext"><i>Constraints</i>:
   <div class="paramtext"/><ul class="listcons">
<li class="listcons">if <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#M"><m:mi mathcolor="#EE0000" mathvariant="bold">M</m:mi></m:maction><m:mo>&lt;</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#N"><m:mi mathcolor="#EE0000" mathvariant="bold">N</m:mi></m:maction></m:math>&#160;and <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#WANTQ"><m:mi mathcolor="#EE0000" mathvariant="bold">WANTQ</m:mi></m:maction><m:mo>=</m:mo><m:mi mathvariant="normal">.TRUE.</m:mi></m:math>, <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#LDQ"><m:mi mathcolor="#EE0000" mathvariant="bold">LDQ</m:mi></m:maction><m:mo>&#8805;</m:mo><m:mrow><m:mi>max</m:mi><m:mspace width="0.125em"/><m:mfenced separators=""><m:mn>1</m:mn><m:mo>,</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#M"><m:mi mathcolor="#EE0000" mathvariant="bold">M</m:mi></m:maction></m:mfenced></m:mrow></m:math>;</li>
<li class="listcons">otherwise <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#LDQ"><m:mi mathcolor="#EE0000" mathvariant="bold">LDQ</m:mi></m:maction><m:mo>&#8805;</m:mo><m:mn>1</m:mn></m:math>.</li>
</ul></div></dd><dt class="paramhead"><a name="SV" id="SV"/>11: &#8194; SV(<m:math><m:mrow><m:mi>min</m:mi><m:mspace width="0.125em"/><m:mfenced separators=""><m:maction actiontype="link" dsi:type="simple" dsi:href="#M"><m:mi mathcolor="#EE0000" mathvariant="bold">M</m:mi></m:maction><m:mo>,</m:mo><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>) &#8211; <span class="bitalic">double precision</span> array<span class="pclass">Output</span></dt><dd><div class="paramtext"><i>On exit</i>: the <m:math><m:mrow><m:mi>min</m:mi><m:mspace width="0.125em"/><m:mfenced separators=""><m:mi>m</m:mi><m:mo>,</m:mo><m:mi>n</m:mi></m:mfenced></m:mrow></m:math>&#160;diagonal elements of the matrix <m:math><m:mi>S</m:mi></m:math>.</div></dd><dt class="paramhead"><a name="WANTP" id="WANTP"/>12: &#8194; WANTP &#8211; LOGICAL<span class="pclass">Input</span></dt><dd><div class="paramtext"><i>On entry</i>: must be .TRUE. if the right-hand singular vectors are required. 
<div class="paramtext">If <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#WANTP"><m:mi mathcolor="#EE0000" mathvariant="bold">WANTP</m:mi></m:maction><m:mo>=</m:mo><m:mi mathvariant="normal">.FALSE.</m:mi></m:math>, the array <a class="arg" href="#PH">PH</a> is not referenced.</div>
</div></dd><dt class="paramhead"><a name="PH" id="PH"/>13: &#8194; PH(<a class="arg" href="#LDPH">LDPH</a>,<m:math><m:mo>*</m:mo></m:math>) &#8211; <span class="bitalic">complex*16</span> array<span class="pclass">Output</span></dt><dd><div class="paramtext"><b>Note:</b> the second dimension of the array <a class="arg" href="#PH">PH</a>
must be at least
<m:math><m:mrow><m:mi>max</m:mi><m:mspace width="0.125em"/><m:mfenced separators=""><m:mn>1</m:mn><m:mo>,</m:mo><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> if <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#M"><m:mi mathcolor="#EE0000" mathvariant="bold">M</m:mi></m:maction><m:mo>&#8805;</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#N"><m:mi mathcolor="#EE0000" mathvariant="bold">N</m:mi></m:maction></m:math>&#160;and <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#WANTQ"><m:mi mathcolor="#EE0000" mathvariant="bold">WANTQ</m:mi></m:maction><m:mo>=</m:mo><m:mi mathvariant="normal">.TRUE.</m:mi></m:math>&#160;and <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#WANTP"><m:mi mathcolor="#EE0000" mathvariant="bold">WANTP</m:mi></m:maction><m:mo>=</m:mo><m:mi mathvariant="normal">.TRUE.</m:mi></m:math>, and at least <m:math><m:mn>1</m:mn></m:math> otherwise.</div>
<div class="paramtext"><i>On exit</i>: if <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#M"><m:mi mathcolor="#EE0000" mathvariant="bold">M</m:mi></m:maction><m:mo>&#8805;</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#N"><m:mi mathcolor="#EE0000" mathvariant="bold">N</m:mi></m:maction></m:math>&#160;and <a class="arg" href="#WANTQ">WANTQ</a> and <a class="arg" href="#WANTP">WANTP</a> are .TRUE., the leading <m:math><m:mi>n</m:mi></m:math>&#160;by <m:math><m:mi>n</m:mi></m:math>&#160;part of the array <a class="arg" href="#PH">PH</a> will contain the unitary matrix <m:math><m:msup><m:mi>P</m:mi><m:mi mathvariant="normal">H</m:mi></m:msup></m:math>. Otherwise the array <a class="arg" href="#PH">PH</a> is not referenced.</div></dd><dt class="paramhead"><a name="LDPH" id="LDPH"/>14: &#8194; LDPH &#8211; INTEGER<span class="pclass">Input</span></dt><dd><div class="paramtext"><i>On entry</i>: the first dimension of the array <a class="arg" href="#PH">PH</a> as declared in the (sub)program from which F02XEF is called.</div><div class="paramtext"><i>Constraints</i>:
   <div class="paramtext"/><ul class="listcons">
<li class="listcons">if <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#M"><m:mi mathcolor="#EE0000" mathvariant="bold">M</m:mi></m:maction><m:mo>&#8805;</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#N"><m:mi mathcolor="#EE0000" mathvariant="bold">N</m:mi></m:maction></m:math>&#160;and <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#WANTQ"><m:mi mathcolor="#EE0000" mathvariant="bold">WANTQ</m:mi></m:maction><m:mo>=</m:mo><m:mi mathvariant="normal">.TRUE.</m:mi></m:math>&#160;and <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#WANTP"><m:mi mathcolor="#EE0000" mathvariant="bold">WANTP</m:mi></m:maction><m:mo>=</m:mo><m:mi mathvariant="normal">.TRUE.</m:mi></m:math>, <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#LDPH"><m:mi mathcolor="#EE0000" mathvariant="bold">LDPH</m:mi></m:maction><m:mo>&#8805;</m:mo><m:mrow><m:mi>max</m:mi><m:mspace width="0.125em"/><m:mfenced separators=""><m:mn>1</m:mn><m:mo>,</m:mo><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>;</li>
<li class="listcons">otherwise <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#LDPH"><m:mi mathcolor="#EE0000" mathvariant="bold">LDPH</m:mi></m:maction><m:mo>&#8805;</m:mo><m:mn>1</m:mn></m:math>.</li>
</ul></div></dd><dt class="paramhead"><a name="RWORK" id="RWORK"/>15: &#8194; RWORK(<m:math><m:mo>*</m:mo></m:math>) &#8211; <span class="bitalic">double precision</span> array<span class="pclass">Output</span></dt><dd><div class="paramtext"><b>Note:</b> the dimension of the array <a class="arg" href="#RWORK">RWORK</a>
must be at least
<m:math><m:mrow><m:mi>max</m:mi><m:mspace width="0.125em"/><m:mfenced separators=""><m:mn>1</m:mn><m:mo>,</m:mo><m:mi mathvariant="italic">lrwork</m:mi></m:mfenced></m:mrow></m:math>, where <m:math><m:mi mathvariant="italic">lrwork</m:mi></m:math>&#160;must satisfy: 
<ul class="listind"><li class="listind"><m:math><m:mi mathvariant="italic">lrwork</m:mi><m:mo>=</m:mo><m:mn>2</m:mn><m:mo>&#215;</m:mo><m:mfenced separators=""><m:mrow><m:mi>min</m:mi><m:mspace width="0.125em"/><m:mfenced separators=""><m:maction actiontype="link" dsi:type="simple" dsi:href="#M"><m:mi mathcolor="#EE0000" mathvariant="bold">M</m:mi></m:maction><m:mo>,</m:mo><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:mrow><m:mo>-</m:mo><m:mn>1</m:mn></m:mrow></m:mfenced></m:math>, when <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#NCOLB"><m:mi mathcolor="#EE0000" mathvariant="bold">NCOLB</m:mi></m:maction><m:mo>=</m:mo><m:mn>0</m:mn></m:math>&#160;and <a class="arg" href="#WANTQ">WANTQ</a> and <a class="arg" href="#WANTP">WANTP</a> are .FALSE.,</li><li class="listind"><m:math><m:mi mathvariant="italic">lrwork</m:mi><m:mo>=</m:mo><m:mn>3</m:mn><m:mo>&#215;</m:mo><m:mfenced separators=""><m:mrow><m:mi>min</m:mi><m:mspace width="0.125em"/><m:mfenced separators=""><m:maction actiontype="link" dsi:type="simple" dsi:href="#M"><m:mi mathcolor="#EE0000" mathvariant="bold">M</m:mi></m:maction><m:mo>,</m:mo><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:mo>-</m:mo><m:mn>1</m:mn></m:mfenced></m:math>, when either <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#NCOLB"><m:mi mathcolor="#EE0000" mathvariant="bold">NCOLB</m:mi></m:maction><m:mo>=</m:mo><m:mn>0</m:mn></m:math>&#160;and <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#WANTQ"><m:mi mathcolor="#EE0000" mathvariant="bold">WANTQ</m:mi></m:maction><m:mo>=</m:mo><m:mi mathvariant="normal">.FALSE.</m:mi></m:math>&#160;and <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#WANTP"><m:mi mathcolor="#EE0000" mathvariant="bold">WANTP</m:mi></m:maction><m:mo>=</m:mo><m:mi mathvariant="normal">.TRUE.</m:mi></m:math>, or <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#WANTP"><m:mi mathcolor="#EE0000" mathvariant="bold">WANTP</m:mi></m:maction><m:mo>=</m:mo><m:mi mathvariant="normal">.FALSE.</m:mi></m:math>&#160;and one or both of <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#NCOLB"><m:mi mathcolor="#EE0000" mathvariant="bold">NCOLB</m:mi></m:maction><m:mo>&gt;</m:mo><m:mn>0</m:mn></m:math>&#160;and <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#WANTQ"><m:mi mathcolor="#EE0000" mathvariant="bold">WANTQ</m:mi></m:maction><m:mo>=</m:mo><m:mi mathvariant="normal">.TRUE.</m:mi></m:math>,</li><li class="listind"><m:math><m:mi mathvariant="italic">lrwork</m:mi><m:mo>=</m:mo><m:mn>5</m:mn><m:mo>&#215;</m:mo><m:mfenced separators=""><m:mrow><m:mi>min</m:mi><m:mspace width="0.125em"/><m:mfenced separators=""><m:maction actiontype="link" dsi:type="simple" dsi:href="#M"><m:mi mathcolor="#EE0000" mathvariant="bold">M</m:mi></m:maction><m:mo>,</m:mo><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:mo>-</m:mo><m:mn>1</m:mn></m:mfenced></m:math>, otherwise.</li></ul>
</div>
<div class="paramtext"><i>On exit</i>:  <m:math> <m:maction actiontype="link" dsi:type="simple" dsi:href="#RWORK"><m:mi mathcolor="#EE0000" mathvariant="bold">RWORK</m:mi></m:maction> <m:mfenced separators=""> <m:mrow><m:mi>min</m:mi><m:mspace width="0.125em"/><m:mfenced separators=""><m:maction actiontype="link" dsi:type="simple" dsi:href="#M"><m:mi mathcolor="#EE0000" mathvariant="bold">M</m:mi></m:maction><m:mo>,</m:mo><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:mfenced> </m:math>&#160;contains the total number of iterations taken by the <m:math><m:mi>Q</m:mi><m:mi>R</m:mi></m:math>&#160;algorithm.
<div class="paramtext">The rest of the array is used as workspace.</div>
</div></dd><dt class="paramhead"><a name="CWORK" id="CWORK"/>16: &#8194; CWORK(<m:math><m:mo>*</m:mo></m:math>) &#8211; <span class="bitalic">complex*16</span> array<span class="pclass">Workspace</span></dt><dd><div class="paramtext"><b>Note:</b> the dimension of the array <a class="arg" href="#CWORK">CWORK</a>
must be at least
<m:math><m:mrow><m:mi>max</m:mi><m:mspace width="0.125em"/><m:mfenced separators=""><m:mn>1</m:mn><m:mo>,</m:mo><m:mi mathvariant="italic">lcwork</m:mi></m:mfenced></m:mrow></m:math>, where <m:math><m:mi mathvariant="italic">lcwork</m:mi></m:math>&#160;must satisfy:
<ul class="listind"><li class="listind"><m:math><m:mi mathvariant="italic">lcwork</m:mi><m:mo>=</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:mrow><m:mi>max</m:mi><m:mspace width="0.125em"/><m:mfenced separators=""><m:msup><m:maction actiontype="link" dsi:type="simple" dsi:href="#N"><m:mi mathcolor="#EE0000" mathvariant="bold">N</m:mi></m:maction><m:mn>2</m:mn></m:msup><m:mo>,</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#NCOLB"><m:mi mathcolor="#EE0000" mathvariant="bold">NCOLB</m:mi></m:maction></m:mfenced></m:mrow></m:math>, when <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#M"><m:mi mathcolor="#EE0000" mathvariant="bold">M</m:mi></m:maction><m:mo>&#8805;</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#N"><m:mi mathcolor="#EE0000" mathvariant="bold">N</m:mi></m:maction></m:math>&#160;and <a class="arg" href="#WANTQ">WANTQ</a> and <a class="arg" href="#WANTP">WANTP</a> are both .TRUE.,</li><li class="listind"><m:math><m:mi mathvariant="italic">lcwork</m:mi><m:mo>=</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:mrow><m:mi>max</m:mi><m:mspace width="0.125em"/><m:mfenced separators=""><m:mrow><m:msup><m:maction actiontype="link" dsi:type="simple" dsi:href="#N"><m:mi mathcolor="#EE0000" mathvariant="bold">N</m:mi></m:maction><m:mn>2</m:mn></m:msup><m:mo>+</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#N"><m:mi mathcolor="#EE0000" mathvariant="bold">N</m:mi></m:maction></m:mrow><m:mo>,</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#NCOLB"><m:mi mathcolor="#EE0000" mathvariant="bold">NCOLB</m:mi></m:maction></m:mfenced></m:mrow></m:math>, when <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#M"><m:mi mathcolor="#EE0000" mathvariant="bold">M</m:mi></m:maction><m:mo>&#8805;</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#N"><m:mi mathcolor="#EE0000" mathvariant="bold">N</m:mi></m:maction></m:math>&#160;and <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#WANTQ"><m:mi mathcolor="#EE0000" mathvariant="bold">WANTQ</m:mi></m:maction><m:mo>=</m:mo><m:mi mathvariant="normal">.TRUE.</m:mi></m:math>, but <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#WANTP"><m:mi mathcolor="#EE0000" mathvariant="bold">WANTP</m:mi></m:maction><m:mo>=</m:mo><m:mi mathvariant="normal">.FALSE.</m:mi></m:math>,</li><li class="listind"><m:math><m:mi mathvariant="italic">lcwork</m:mi><m:mo>=</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:mrow><m:mi>max</m:mi><m:mspace width="0.125em"/><m:mfenced separators=""><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="#NCOLB"><m:mi mathcolor="#EE0000" mathvariant="bold">NCOLB</m:mi></m:maction></m:mfenced></m:mrow></m:math>, when <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#M"><m:mi mathcolor="#EE0000" mathvariant="bold">M</m:mi></m:maction><m:mo>&#8805;</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#N"><m:mi mathcolor="#EE0000" mathvariant="bold">N</m:mi></m:maction></m:math>&#160;and <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#WANTQ"><m:mi mathcolor="#EE0000" mathvariant="bold">WANTQ</m:mi></m:maction><m:mo>=</m:mo><m:mi mathvariant="normal">.FALSE.</m:mi></m:math>,</li><li class="listind"><m:math><m:mi mathvariant="italic">lcwork</m:mi><m:mo>=</m:mo><m:msup><m:maction actiontype="link" dsi:type="simple" dsi:href="#M"><m:mi mathcolor="#EE0000" mathvariant="bold">M</m:mi></m:maction><m:mn>2</m:mn></m:msup><m:mo>+</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#M"><m:mi mathcolor="#EE0000" mathvariant="bold">M</m:mi></m:maction><m:mo>+</m:mo><m:mrow><m:mi>max</m:mi><m:mspace width="0.125em"/><m:mfenced separators=""><m:mn>1</m:mn><m:mo>,</m:mo><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#M"><m:mi mathcolor="#EE0000" mathvariant="bold">M</m:mi></m:maction><m:mo>-</m:mo><m:mn>1</m:mn></m:mrow></m:mfenced></m:mrow></m:math>, when <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#M"><m:mi mathcolor="#EE0000" mathvariant="bold">M</m:mi></m:maction><m:mo>&lt;</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#N"><m:mi mathcolor="#EE0000" mathvariant="bold">N</m:mi></m:maction></m:math>&#160;and <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#WANTP"><m:mi mathcolor="#EE0000" mathvariant="bold">WANTP</m:mi></m:maction><m:mo>=</m:mo><m:mi mathvariant="normal">.TRUE.</m:mi></m:math>,</li><li class="listind"><m:math><m:mi mathvariant="italic">lcwork</m:mi><m:mo>=</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#M"><m:mi mathcolor="#EE0000" mathvariant="bold">M</m:mi></m:maction></m:math>, when <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#M"><m:mi mathcolor="#EE0000" mathvariant="bold">M</m:mi></m:maction><m:mo>&lt;</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#N"><m:mi mathcolor="#EE0000" mathvariant="bold">N</m:mi></m:maction></m:math>&#160;and <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#WANTP"><m:mi mathcolor="#EE0000" mathvariant="bold">WANTP</m:mi></m:maction><m:mo>=</m:mo><m:mi mathvariant="normal">.FALSE.</m:mi></m:math>.</li></ul>
</div></dd><dt class="paramhead"><a name="IFAIL" id="IFAIL"/>17: &#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="#IFeq-1"><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="IFeq-1" id="IFeq-1"/><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>
<div class="paramtext">One or more of the following conditions hold:
<ul class="listcons">
<li class="listcons"><m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#M"><m:mi mathcolor="#EE0000" mathvariant="bold">M</m:mi></m:maction><m:mo>&lt;</m:mo><m:mn>0</m:mn></m:math>;</li>
<li class="listcons"><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>;</li>
<li class="listcons"><m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#LDA"><m:mi mathcolor="#EE0000" mathvariant="bold">LDA</m:mi></m:maction><m:mo>&lt;</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#M"><m:mi mathcolor="#EE0000" mathvariant="bold">M</m:mi></m:maction></m:math>;</li>
<li class="listcons"><m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#NCOLB"><m:mi mathcolor="#EE0000" mathvariant="bold">NCOLB</m:mi></m:maction><m:mo>&lt;</m:mo><m:mn>0</m:mn></m:math>;</li>
<li class="listcons"><m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#LDB"><m:mi mathcolor="#EE0000" mathvariant="bold">LDB</m:mi></m:maction><m:mo>&lt;</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#M"><m:mi mathcolor="#EE0000" mathvariant="bold">M</m:mi></m:maction></m:math>&#160;and <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#NCOLB"><m:mi mathcolor="#EE0000" mathvariant="bold">NCOLB</m:mi></m:maction><m:mo>&gt;</m:mo><m:mn>0</m:mn></m:math>;</li>
<li class="listcons"><m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#LDQ"><m:mi mathcolor="#EE0000" mathvariant="bold">LDQ</m:mi></m:maction><m:mo>&lt;</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#M"><m:mi mathcolor="#EE0000" mathvariant="bold">M</m:mi></m:maction></m:math>&#160;and <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#M"><m:mi mathcolor="#EE0000" mathvariant="bold">M</m:mi></m:maction><m:mo>&lt;</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#N"><m:mi mathcolor="#EE0000" mathvariant="bold">N</m:mi></m:maction></m:math>&#160;and  <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#WANTQ"><m:mi mathcolor="#EE0000" mathvariant="bold">WANTQ</m:mi></m:maction><m:mo>=</m:mo><m:mi mathvariant="normal">.TRUE.</m:mi></m:math>;</li>
<li class="listcons"><m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#LDPH"><m:mi mathcolor="#EE0000" mathvariant="bold">LDPH</m:mi></m:maction><m:mo>&lt;</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#N"><m:mi mathcolor="#EE0000" mathvariant="bold">N</m:mi></m:maction></m:math>&#160;and <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#M"><m:mi mathcolor="#EE0000" mathvariant="bold">M</m:mi></m:maction><m:mo>&#8805;</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#N"><m:mi mathcolor="#EE0000" mathvariant="bold">N</m:mi></m:maction></m:math>&#160;and  <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#WANTQ"><m:mi mathcolor="#EE0000" mathvariant="bold">WANTQ</m:mi></m:maction><m:mo>=</m:mo><m:mi mathvariant="normal">.TRUE.</m:mi></m:math>&#160;and <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#WANTP"><m:mi mathcolor="#EE0000" mathvariant="bold">WANTP</m:mi></m:maction><m:mo>=</m:mo><m:mi mathvariant="normal">.TRUE.</m:mi></m:math>.</li>
</ul>
</div>
</dd>
</dl><dl class="ifail">
<dt class="errorhead"><a name="IFgt0" id="IFgt0"/><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>&gt;</m:mo><m:mn>0</m:mn></m:math></dt>
<dd>
<div class="paramtext">The <m:math><m:mi>Q</m:mi><m:mi>R</m:mi></m:math>&#160;algorithm has failed to converge in  <m:math><m:mn>50</m:mn><m:mo>&#215;</m:mo><m:mrow><m:mi>min</m:mi><m:mspace width="0.125em"/><m:mfenced separators=""><m:mi>m</m:mi><m:mo>,</m:mo><m:mi>n</m:mi></m:mfenced></m:mrow></m:math>&#160;iterations.  In this case  <m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#SV"><m:mi mathcolor="#EE0000" mathvariant="bold">SV</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="#SV"><m:mi mathcolor="#EE0000" mathvariant="bold">SV</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="#SV"><m:mi mathcolor="#EE0000" mathvariant="bold">SV</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:maction actiontype="link" dsi:type="simple" dsi:href="#IFAIL"><m:mi mathcolor="#EE0000" mathvariant="bold">IFAIL</m:mi></m:maction></m:mfenced></m:mrow></m:math>&#160;may not have been found correctly and the remaining singular values may not be the smallest.  The matrix <m:math><m:mi>A</m:mi></m:math>&#160;will nevertheless have been factorized as <m:math><m:mi>A</m:mi><m:mo>=</m:mo><m:mi>Q</m:mi><m:mi>E</m:mi><m:msup><m:mi>P</m:mi><m:mi mathvariant="normal">H</m:mi></m:msup></m:math>&#160;where the leading <m:math><m:mrow><m:mi>min</m:mi><m:mspace width="0.125em"/><m:mfenced separators=""><m:mi>m</m:mi><m:mo>,</m:mo><m:mi>n</m:mi></m:mfenced></m:mrow></m:math>&#160;by <m:math><m:mrow><m:mi>min</m:mi><m:mspace width="0.125em"/><m:mfenced separators=""><m:mi>m</m:mi><m:mo>,</m:mo><m:mi>n</m:mi></m:mfenced></m:mrow></m:math>&#160;part of <m:math><m:mi>E</m:mi></m:math>&#160;is a bidiagonal matrix with 
<m:math>
 <m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#SV"><m:mi mathcolor="#EE0000" mathvariant="bold">SV</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="#SV"><m:mi mathcolor="#EE0000" mathvariant="bold">SV</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:maction actiontype="link" dsi:type="simple" dsi:href="#SV"><m:mi mathcolor="#EE0000" mathvariant="bold">SV</m:mi></m:maction>
 <m:mfenced separators="">
  <m:mrow><m:mi>min</m:mi><m:mspace width="0.125em"/><m:mfenced separators=""><m:mi>m</m:mi><m:mo>,</m:mo><m:mi>n</m:mi></m:mfenced></m:mrow>
 </m:mfenced>
</m:math>&#160;as the diagonal elements and 
<m:math>
 <m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#RWORK"><m:mi mathcolor="#EE0000" mathvariant="bold">RWORK</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="#RWORK"><m:mi mathcolor="#EE0000" mathvariant="bold">RWORK</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:maction actiontype="link" dsi:type="simple" dsi:href="#RWORK"><m:mi mathcolor="#EE0000" mathvariant="bold">RWORK</m:mi></m:maction>
 <m:mfenced separators="">
  <m:mrow><m:mi>min</m:mi><m:mspace width="0.125em"/><m:mfenced separators=""><m:mi>m</m:mi><m:mo>,</m:mo><m:mi>n</m:mi></m:mfenced></m:mrow>
  <m:mo>-</m:mo>
  <m:mn>1</m:mn>
 </m:mfenced>
</m:math>&#160;as the superdiagonal elements.</div>
<div class="paramtext">This failure is not likely to occur.</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>Q</m:mi></m:math>, <m:math><m:mi>D</m:mi></m:math>&#160;and <m:math><m:mi>P</m:mi></m:math>&#160;satisfy the relation

<div class="formula"><table class="formula"><tr><td class="formula"><m:math display="block">
<m:mi>Q</m:mi><m:mi>D</m:mi><m:msup><m:mi>P</m:mi><m:mi mathvariant="normal">H</m:mi></m:msup><m:mo>=</m:mo><m:mi>A</m:mi><m:mo>+</m:mo><m:mi>E</m:mi><m:mtext>,</m:mtext>
</m:math></td><td class="formula2"/></tr></table></div>

where

<div class="formula"><table class="formula"><tr><td class="formula"><m:math display="block">
<m:mfenced open="&#8214;" close="&#8214;" separators=""><m:mi>E</m:mi></m:mfenced><m:mo>&#8804;</m:mo><m:mi>c</m:mi><m:mi>&#949;</m:mi> <m:mfenced open="&#8214;" close="&#8214;" separators=""><m:mi>A</m:mi></m:mfenced><m:mtext>,</m:mtext>
</m:math></td><td class="formula2"/></tr></table></div><m:math><m:mi>&#949;</m:mi></m:math>&#160;is the <span class="bitalic">machine precision</span>, <m:math><m:mi>c</m:mi></m:math>&#160;is a modest function of <m:math><m:mi>m</m:mi></m:math>&#160;and <m:math><m:mi>n</m:mi></m:math>&#160;and <m:math><m:mfenced open="&#8214;" close="&#8214;" separators=""><m:mo>.</m:mo></m:mfenced></m:math>&#160;denotes the spectral (two) norm.  Note that <m:math><m:mfenced open="&#8214;" close="&#8214;" separators=""><m:mi>A</m:mi></m:mfenced><m:mo>=</m:mo><m:mi>s</m:mi><m:msub><m:mi>v</m:mi><m:mn>1</m:mn></m:msub></m:math>.</div><h2 class="standard"><a class="sec" name="fcomments" id="fcomments"/>8&#160;&#160;Further Comments</h2>
<div class="paramtext">Following the use of this routine the rank of <m:math><m:mi>A</m:mi></m:math>&#160;may be estimated by a call to the INTEGER FUNCTION <a class="rout" href="../F06/f06klf.xml">F06KLF</a>.  The statement:
<pre class="verbatim">
IRANK = F06KLF(MIN(M,N),SV,1,TOL)
</pre>
returns the value <m:math><m:mfenced separators=""><m:mi>k</m:mi><m:mo>-</m:mo><m:mn>1</m:mn></m:mfenced></m:math>&#160;in <span class="italic">IRANK</span>, where <m:math><m:mi>k</m:mi></m:math>&#160;is the smallest integer for which <m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#SV"><m:mi mathcolor="#EE0000" mathvariant="bold">SV</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mi>k</m:mi></m:mfenced></m:mrow><m:mo>&lt;</m:mo><m:mi mathvariant="italic">tol</m:mi><m:mo>&#215;</m:mo><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#SV"><m:mi mathcolor="#EE0000" mathvariant="bold">SV</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mn>1</m:mn></m:mfenced></m:mrow></m:math>,  where <m:math><m:mi mathvariant="italic">tol</m:mi></m:math>&#160;is the tolerance supplied in <a class="arg" href="../F06/f06klf.xml#TOL">TOL</a>, so that <span class="italic">IRANK</span> is an estimate of the rank of <m:math><m:mi>S</m:mi></m:math>&#160;and thus also of  <m:math><m:mi>A</m:mi></m:math>.  If <a class="arg" href="../F06/f06klf.xml#TOL">TOL</a> is supplied as negative then the <span class="bitalic">machine precision</span>  is used in place of <a class="arg" href="../F06/f06klf.xml#TOL">TOL</a>.</div><h2 class="standard"><a class="sec" name="example" id="example"/>9&#160;&#160;Example</h2>
<div class="paramtext">For this routine two examples are presented.  There is a single example program for F02XEF, with a main program and the code to solve the two example problems given in Example 1 (EX1) and Example 2 (EX2).</div><div class="paramtext"><b>Example 1 (EX1)</b></div><div class="paramtext">To find the singular value decomposition of the <m:math><m:mn>5</m:mn></m:math>&#160;by <m:math><m:mn>3</m:mn></m:math>&#160;matrix

<div class="formula"><table class="formula"><tr><td class="formula"><m:math display="block">
 <m:mi>A</m:mi>
 <m:mo>=</m:mo>
 <m:mfenced><m:mtable columnalign="right">
<m:mtr>
   <m:mtd><m:mn>0.5</m:mn><m:mi>i</m:mi></m:mtd>
   <m:mtd><m:mrow><m:mo>-</m:mo><m:mn>0.5</m:mn></m:mrow><m:mo>+</m:mo><m:mn>1.5</m:mn><m:mi>i</m:mi></m:mtd>
   <m:mtd><m:mrow><m:mo>-</m:mo><m:mn>1.0</m:mn></m:mrow><m:mo>+</m:mo><m:mn>1.0</m:mn><m:mi>i</m:mi></m:mtd>
</m:mtr><m:mtr>
   <m:mtd><m:mn>0.4</m:mn><m:mo>+</m:mo><m:mn>0.3</m:mn><m:mi>i</m:mi></m:mtd>
   <m:mtd><m:mn>0.9</m:mn><m:mo>+</m:mo><m:mn>1.3</m:mn><m:mi>i</m:mi></m:mtd>
   <m:mtd><m:mn>0.2</m:mn><m:mo>+</m:mo><m:mn>1.4</m:mn><m:mi>i</m:mi></m:mtd>
</m:mtr><m:mtr>
   <m:mtd><m:mn>0.4</m:mn><m:mphantom><m:mi>i</m:mi><m:mo>+</m:mo><m:mn>0.0</m:mn></m:mphantom></m:mtd>
   <m:mtd><m:mrow><m:mo>-</m:mo><m:mn>0.4</m:mn></m:mrow><m:mo>+</m:mo><m:mn>0.4</m:mn><m:mi>i</m:mi></m:mtd>
   <m:mtd><m:mn>1.8</m:mn><m:mphantom><m:mi>i</m:mi><m:mo>+</m:mo><m:mn>0.0</m:mn></m:mphantom></m:mtd>
</m:mtr><m:mtr>
   <m:mtd><m:mn>0.3</m:mn><m:mo>-</m:mo><m:mn>0.4</m:mn><m:mi>i</m:mi></m:mtd>
   <m:mtd><m:mn>0.1</m:mn><m:mo>+</m:mo><m:mn>0.7</m:mn><m:mi>i</m:mi></m:mtd>
   <m:mtd><m:mn>0.0</m:mn><m:mphantom><m:mi>i</m:mi><m:mo>+</m:mo><m:mn>0.0</m:mn></m:mphantom></m:mtd>
</m:mtr><m:mtr>
   <m:mtd><m:mrow><m:mo>-</m:mo><m:mn>0.3</m:mn></m:mrow><m:mi>i</m:mi></m:mtd>
   <m:mtd><m:mn>0.3</m:mn><m:mo>+</m:mo><m:mn>0.3</m:mn><m:mi>i</m:mi></m:mtd>
   <m:mtd><m:mn>2.4</m:mn><m:mi>i</m:mi></m:mtd>
</m:mtr>
</m:mtable></m:mfenced>
 <m:mtext>,</m:mtext>
</m:math></td><td class="formula2"/></tr></table></div>

together with the vector <m:math><m:msup><m:mi>Q</m:mi><m:mi mathvariant="normal">H</m:mi></m:msup><m:mi>b</m:mi></m:math>&#160;for the vector

<div class="formula"><table class="formula"><tr><td class="formula"><m:math display="block">
 <m:mi>b</m:mi>
 <m:mo>=</m:mo>
 <m:mfenced><m:mtable columnalign="right">
<m:mtr>
   <m:mtd><m:mrow><m:mo>-</m:mo><m:mn>0.55</m:mn></m:mrow><m:mo>+</m:mo><m:mn>1.05</m:mn><m:mi>i</m:mi></m:mtd>
</m:mtr><m:mtr>
   <m:mtd><m:mn>0.49</m:mn><m:mo>+</m:mo><m:mn>0.93</m:mn><m:mi>i</m:mi></m:mtd>
</m:mtr><m:mtr>
   <m:mtd><m:mn>0.56</m:mn><m:mo>-</m:mo><m:mn>0.16</m:mn><m:mi>i</m:mi></m:mtd>
</m:mtr><m:mtr>
   <m:mtd><m:mn>0.39</m:mn><m:mo>+</m:mo><m:mn>0.23</m:mn><m:mi>i</m:mi></m:mtd>
</m:mtr><m:mtr>
   <m:mtd><m:mn>1.13</m:mn><m:mo>+</m:mo><m:mn>0.83</m:mn><m:mi>i</m:mi></m:mtd>
</m:mtr>
</m:mtable></m:mfenced>
<m:mtext>.</m:mtext>
</m:math></td><td class="formula2"/></tr></table></div></div><div class="paramtext"><b>Example 2 (EX2)</b></div><div class="paramtext">To find the singular value decomposition of the <m:math><m:mn>3</m:mn></m:math>&#160;by <m:math><m:mn>5</m:mn></m:math>&#160;matrix

<div class="formula"><table class="formula"><tr><td class="formula"><m:math display="block">
 <m:mi>A</m:mi>
 <m:mo>=</m:mo>
 <m:mfenced><m:mtable columnalign="right">
<m:mtr>
   <m:mtd><m:mn>0.5</m:mn><m:mi>i</m:mi></m:mtd>
   <m:mtd><m:mn>0.4</m:mn><m:mo>-</m:mo><m:mn>0.3</m:mn><m:mi>i</m:mi></m:mtd>
   <m:mtd><m:mn>0.4</m:mn><m:mphantom><m:mi>i</m:mi><m:mo>+</m:mo><m:mn>0.0</m:mn></m:mphantom></m:mtd>
   <m:mtd><m:mn>0.3</m:mn><m:mo>+</m:mo><m:mn>0.4</m:mn><m:mi>i</m:mi></m:mtd>
   <m:mtd><m:mn>0.3</m:mn><m:mi>i</m:mi></m:mtd>
</m:mtr><m:mtr>
   <m:mtd><m:mrow><m:mo>-</m:mo><m:mn>0.5</m:mn></m:mrow><m:mo>-</m:mo><m:mn>1.5</m:mn><m:mi>i</m:mi></m:mtd>
   <m:mtd><m:mn>0.9</m:mn><m:mo>-</m:mo><m:mn>1.3</m:mn><m:mi>i</m:mi></m:mtd>
   <m:mtd><m:mrow><m:mo>-</m:mo><m:mn>0.4</m:mn></m:mrow><m:mo>-</m:mo><m:mn>0.4</m:mn><m:mi>i</m:mi></m:mtd>
   <m:mtd><m:mn>0.1</m:mn><m:mo>-</m:mo><m:mn>0.7</m:mn><m:mi>i</m:mi></m:mtd>
   <m:mtd><m:mn>0.3</m:mn><m:mo>-</m:mo><m:mn>0.3</m:mn><m:mi>i</m:mi></m:mtd>
</m:mtr><m:mtr>
   <m:mtd><m:mrow><m:mo>-</m:mo><m:mn>1.0</m:mn></m:mrow><m:mo>-</m:mo><m:mn>1.0</m:mn><m:mi>i</m:mi></m:mtd>
   <m:mtd><m:mn>0.2</m:mn><m:mo>-</m:mo><m:mn>1.4</m:mn><m:mi>i</m:mi></m:mtd>
   <m:mtd><m:mn>1.8</m:mn><m:mphantom><m:mi>i</m:mi><m:mo>+</m:mo><m:mn>0.0</m:mn></m:mphantom></m:mtd>
   <m:mtd><m:mn>0.0</m:mn><m:mphantom><m:mi>i</m:mi><m:mo>+</m:mo><m:mn>0.0</m:mn></m:mphantom></m:mtd>
   <m:mtd><m:mrow><m:mo>-</m:mo><m:mn>2.4</m:mn></m:mrow><m:mi>i</m:mi></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/f02xefe.f">Program Text (f02xefe.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/f02xefe.d">Program&#160;Data (f02xefe.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/f02xefe.r">Program Results (f02xefe.r)</a></p>
<hr/><div><a class="rout" href="../../pdf/F02/f02xef.pdf">F02XEF (PDF version)</a></div><div><a class="chap" href="f02conts.xml">F02 Chapter Contents</a></div><div><a class="chapint" href="f02intro.xml">F02 Chapter Introduction</a></div>
<div><a class="htmltoc" href="../FRONTMATTER/manconts.xml">NAG Library Manual</a></div>
<div><hr/><a class="genint" href="../FRONTMATTER/copyright.xml">&#169; The Numerical Algorithms Group Ltd, Oxford, UK. 2009</a></div></body></html>
