<?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>F08KJF (DGESVJ) : 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/F08/f08kjf.pdf">F08KJF (DGESVJ) (PDF version)</a></div><div><a class="chap" href="f08conts.xml">F08 Chapter Contents</a></div><div><a class="chapint" href="f08intro.xml">F08 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/>F08KJF (DGESVJ)</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">F08KJF (DGESVJ) computes the  one-sided Jacobi singular value decomposition (SVD) of a real <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>, <m:math><m:mi>m</m:mi><m:mo>&#8805;</m:mo><m:mi>n</m:mi></m:math>, with fast scaled rotations and de Rijk&#8217;s pivoting, optionally computing the left and/or right singular vectors. For <m:math><m:mi>m</m:mi><m:mo>&lt;</m:mo><m:mi>n</m:mi></m:math>, the routines <a class="rout" href="../F08/f08kbf.xml">F08KBF (DGESVD)</a> or <a class="rout" href="../F08/f08kdf.xml">F08KDF (DGESDD)</a> may be used.</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;F08KJF&#160;(</td>
<td class="tdfspec2" valign="top" align="left"><a class="arg" href="#JOBA">JOBA</a>, <a class="arg" href="#JOBU">JOBU</a>, <a class="arg" href="#JOBV">JOBV</a>, <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="#SVA">SVA</a>, <a class="arg" href="#MV">MV</a>, <a class="arg" href="#V">V</a>, <a class="arg" href="#LDV">LDV</a>, <a class="arg" href="#WORK">WORK</a>, <a class="arg" href="#LWORK">LWORK</a>, <a class="arg" href="#INFO">INFO</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">M, N, LDA, MV, LDV, LWORK, INFO</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(LDA,*), SVA(N), V(LDV,*), WORK(LWORK)</td>
</tr><tr>
<td class="tdfspec1" valign="top" align="left">CHARACTER(1)&#160;</td>
<td class="tdfspec2" valign="top" align="left">JOBA, JOBU, JOBV</td></tr></tbody>
</table></div>
</td></tr></table>
<div class="paramtext">The routine may be called by its 
    LAPACK
    name <span class="bitalic">dgesvj</span>.</div><h2 class="standard"><a class="sec" name="description" id="description"/>3&#160;&#160;Description</h2>
<div class="paramtext">The SVD is written 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>U</m:mi><m:mi>&#931;</m:mi><m:msup><m:mi>V</m:mi><m:mi mathvariant="normal">T</m:mi></m:msup>
 <m:mtext>,</m:mtext>
</m:math></td><td class="formula2"/></tr></table></div>

where <m:math><m:mi>&#931;</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;diagonal matrix, <m:math><m:mi>U</m:mi></m:math>&#160;is an <m:math><m:mi>m</m:mi></m:math>&#160;by <m:math><m:mi>n</m:mi></m:math>&#160;orthonormal matrix, and <m:math><m:mi>V</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;orthogonal matrix.  The diagonal elements of <m:math><m:mi>&#931;</m:mi></m:math>&#160;are the singular values of <m:math><m:mi>A</m:mi></m:math>&#160;in descending order of magnitude.  The columns of <m:math><m:mi>U</m:mi></m:math>&#160;and <m:math><m:mi>V</m:mi></m:math>&#160;are the left and the right singular vectors 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="ref252" id="ref252"/>Anderson E, Bai Z, Bischof C, Blackford S, Demmel J, Dongarra J J, Du Croz J J, Greenbaum A, Hammarling S, McKenney A and Sorensen D (1999)  <i>LAPACK Users' Guide</i> (3rd Edition) SIAM, Philadelphia <a class="url" href="http://www.netlib.org/lapack/lug">http://www.netlib.org/lapack/lug</a></div>
<div class="paramtext"><a name="ref884" id="ref884"/>Drmac Z and Veselic K (2008a)  New fast and accurate Jacobi SVD algorithm I <i>SIAM J. Matrix Anal. Appl.</i> <b>29 4</b>  </div>
<div class="paramtext"><a name="ref885" id="ref885"/>Drmac Z and Veselic K (2008b)  New fast and accurate Jacobi SVD algorithm II <i>SIAM J. Matrix Anal. Appl.</i> <b>29 4</b>  </div>
<div class="paramtext"><a name="ref105" id="ref105"/>Golub G H and Van Loan C F (1996)  <i>Matrix Computations</i> (3rd Edition) Johns Hopkins University Press, Baltimore </div><h2 class="standard"><a class="sec" name="parameters" id="parameters"/>5&#160;&#160;Parameters</h2>
<dl><dt class="paramhead"><a name="JOBA" id="JOBA"/>1: &#160;&#160;&#8194; JOBA &#8211; CHARACTER(1)<span class="pclass">Input</span></dt><dd>
<div class="paramtext"><i>On entry</i>: specifies the structure of matrix <m:math><m:mi>A</m:mi></m:math>.

<dl>
<dt class="paramval"><m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#JOBA"><m:mi mathcolor="#EE0000" mathvariant="bold">JOBA</m:mi></m:maction><m:mo>=</m:mo><m:mtext>'L'</m:mtext></m:math></dt>
<dd>The input matrix <m:math><m:mi>A</m:mi></m:math>&#160;is lower triangular.</dd>
<dt class="paramval"><m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#JOBA"><m:mi mathcolor="#EE0000" mathvariant="bold">JOBA</m:mi></m:maction><m:mo>=</m:mo><m:mtext>'U'</m:mtext></m:math></dt>
<dd>The input matrix <m:math><m:mi>A</m:mi></m:math>&#160;is upper triangular.</dd>
<dt class="paramval"><m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#JOBA"><m:mi mathcolor="#EE0000" mathvariant="bold">JOBA</m:mi></m:maction><m:mo>=</m:mo><m:mtext>'G'</m:mtext></m:math></dt>
<dd>The input matrix <m:math><m:mi>A</m:mi></m:math>&#160;is a general <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: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>.</dd></dl>
</div><div class="paramtext"><i>Constraint</i>:
  <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#JOBA"><m:mi mathcolor="#EE0000" mathvariant="bold">JOBA</m:mi></m:maction><m:mo>=</m:mo><m:mtext>'L'</m:mtext></m:math>, <m:math><m:mtext>'U'</m:mtext></m:math>&#160;or <m:math><m:mtext>'G'</m:mtext></m:math>.
</div>
</dd><dt class="paramhead"><a name="JOBU" id="JOBU"/>2: &#160;&#160;&#8194; JOBU &#8211; CHARACTER(1)<span class="pclass">Input</span></dt><dd>
<div class="paramtext"><i>On entry</i>: specifies whether to compute the left singular vectors and if so whether you want to control their numerical orthogonality threshold.

<dl>
<dt class="paramval"><m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#JOBU"><m:mi mathcolor="#EE0000" mathvariant="bold">JOBU</m:mi></m:maction><m:mo>=</m:mo><m:mtext>'U'</m:mtext></m:math></dt>
<dd>The left singular vectors corresponding to the nonzero singular values are computed and returned in the leading columns of <a class="arg" href="#A">A</a>. See more details in the description of <a class="arg" href="#A">A</a>.  The numerical orthogonality threshold is set to approximately <m:math><m:mi mathvariant="italic">tol</m:mi><m:mo>=</m:mo><m:mi mathvariant="italic">ctol</m:mi><m:mo>&#215;</m:mo><m:mi>&#949;</m:mi></m:math>, where <m:math><m:mi>&#949;</m:mi></m:math>&#160;is the <span class="bitalic">machine precision</span> and <m:math><m:mi mathvariant="italic">ctol</m:mi><m:mo>=</m:mo><m:msqrt><m:mi>m</m:mi></m:msqrt></m:math>.</dd>
<dt class="paramval"><m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#JOBU"><m:mi mathcolor="#EE0000" mathvariant="bold">JOBU</m:mi></m:maction><m:mo>=</m:mo><m:mtext>'C'</m:mtext></m:math></dt>
<dd>Analogous to <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#JOBU"><m:mi mathcolor="#EE0000" mathvariant="bold">JOBU</m:mi></m:maction><m:mo>=</m:mo><m:mtext>'U'</m:mtext></m:math>, except that you can control the level of numerical orthogonality of the computed left singular vectors.  The orthogonality threshold is set to <m:math><m:mi mathvariant="italic">tol</m:mi><m:mo>=</m:mo><m:mi mathvariant="italic">ctol</m:mi><m:mo>&#215;</m:mo><m:mi>&#949;</m:mi></m:math>, where <m:math><m:mi mathvariant="italic">ctol</m:mi></m:math>&#160;is given on input in <m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#WORK"><m:mi mathcolor="#EE0000" mathvariant="bold">WORK</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mn>1</m:mn></m:mfenced></m:mrow></m:math>.  The option <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#JOBU"><m:mi mathcolor="#EE0000" mathvariant="bold">JOBU</m:mi></m:maction><m:mo>=</m:mo><m:mtext>'C'</m:mtext></m:math>&#160;can be used if <m:math><m:mi>m</m:mi><m:mo>&#215;</m:mo><m:mi>&#949;</m:mi></m:math>&#160;is a satisfactory orthogonality of the computed left singular vectors, so <m:math><m:mi mathvariant="italic">ctol</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>&#160;could save a few sweeps of Jacobi rotations.  See the descriptions of <a class="arg" href="#A">A</a> and <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#WORK"><m:mi mathcolor="#EE0000" mathvariant="bold">WORK</m:mi></m:maction><m:mfenced separators=""><m:mn>1</m:mn></m:mfenced></m:math>.</dd>
<dt class="paramval"><m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#JOBU"><m:mi mathcolor="#EE0000" mathvariant="bold">JOBU</m:mi></m:maction><m:mo>=</m:mo><m:mtext>'N'</m:mtext></m:math></dt>
<dd>The matrix <m:math><m:mi>U</m:mi></m:math>&#160;is not computed. However, see the description of <a class="arg" href="#A">A</a>.</dd></dl>
</div><div class="paramtext"><i>Constraint</i>:
  <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#JOBU"><m:mi mathcolor="#EE0000" mathvariant="bold">JOBU</m:mi></m:maction><m:mo>=</m:mo><m:mtext>'U'</m:mtext></m:math>, <m:math><m:mtext>'C'</m:mtext></m:math>&#160;or <m:math><m:mtext>'N'</m:mtext></m:math>.
</div>
</dd><dt class="paramhead"><a name="JOBV" id="JOBV"/>3: &#160;&#160;&#8194; JOBV &#8211; CHARACTER(1)<span class="pclass">Input</span></dt><dd>
<div class="paramtext"><i>On entry</i>: specifies whether and how to compute the right singular vectors.

<dl>
<dt class="paramval"><m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#JOBV"><m:mi mathcolor="#EE0000" mathvariant="bold">JOBV</m:mi></m:maction><m:mo>=</m:mo><m:mtext>'V'</m:mtext></m:math></dt>
<dd>The matrix <m:math><m:mi>V</m:mi></m:math>&#160;is computed and returned in the array <a class="arg" href="#V">V</a>.</dd>
<dt class="paramval"><m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#JOBV"><m:mi mathcolor="#EE0000" mathvariant="bold">JOBV</m:mi></m:maction><m:mo>=</m:mo><m:mtext>'A'</m:mtext></m:math></dt>
<dd>The Jacobi rotations are applied to the leading <a class="arg" href="#MV">MV</a> by <m:math><m:mi>n</m:mi></m:math>&#160;part of the array <a class="arg" href="#V">V</a>. In other words, the right singular vector matrix <m:math><m:mi>V</m:mi></m:math>&#160;is not computed explicitly, instead it is applied to an <a class="arg" href="#MV">MV</a> by <m:math><m:mi>n</m:mi></m:math>&#160;matrix initially stored in the first <a class="arg" href="#MV">MV</a> rows of <a class="arg" href="#V">V</a>.</dd>
<dt class="paramval"><m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#JOBV"><m:mi mathcolor="#EE0000" mathvariant="bold">JOBV</m:mi></m:maction><m:mo>=</m:mo><m:mtext>'N'</m:mtext></m:math></dt>
<dd>The matrix <m:math><m:mi>V</m:mi></m:math>&#160;is not computed and the array <a class="arg" href="#V">V</a> is not referenced.</dd></dl>
</div><div class="paramtext"><i>Constraint</i>:
  <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#JOBV"><m:mi mathcolor="#EE0000" mathvariant="bold">JOBV</m:mi></m:maction><m:mo>=</m:mo><m:mtext>'V'</m:mtext></m:math>, <m:math><m:mtext>'A'</m:mtext></m:math>&#160;or <m:math><m:mtext>'N'</m:mtext></m:math>.
</div>
</dd><dt class="paramhead"><a name="M" id="M"/>4: &#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>
</dd><dt class="paramhead"><a name="N" id="N"/>5: &#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="#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:mo>&#8805;</m:mo><m:mn>0</m:mn></m:math>.
</div>
</dd><dt class="paramhead"><a name="A" id="A"/>6: &#160;&#160;&#8194; A(<a class="arg" href="#LDA">LDA</a>,<m:math><m:mo>*</m:mo></m:math>) &#8211; REAL&#160;(KIND=nag_wp)&#160;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 <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>.</div>
<div class="paramtext"><i>On exit</i>: the matrix <m:math><m:mi>U</m:mi></m:math>&#160;containing the left singular vectors of <m:math><m:mi>A</m:mi></m:math>.

<dl>
<dt class="paramval">If <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#JOBU"><m:mi mathcolor="#EE0000" mathvariant="bold">JOBU</m:mi></m:maction><m:mo>=</m:mo><m:mtext>'U'</m:mtext></m:math>&#160;or <m:math><m:mtext>'C'</m:mtext></m:math></dt>
<dd><dl>
<dt class="paramval">if <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#INFO"><m:mi mathcolor="#EE0000" mathvariant="bold">INFO</m:mi></m:maction><m:mo>=</m:mo><m:mn>0</m:mn></m:math></dt>
<dd><m:math><m:mrow><m:mi>rank</m:mi><m:mfenced separators=""><m:mi>A</m:mi></m:mfenced></m:mrow></m:math>&#160;orthonormal columns of <m:math><m:mi>U</m:mi></m:math>&#160;are returned in the leading <m:math><m:mrow><m:mi>rank</m:mi><m:mfenced separators=""><m:mi>A</m:mi></m:mfenced></m:mrow></m:math>&#160;columns of the array <a class="arg" href="#A">A</a>. Here <m:math><m:mrow><m:mi>rank</m:mi><m:mfenced separators=""><m:mi>A</m:mi></m:mfenced></m:mrow><m:mo>&#8804;</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;is the number of computed singular values of <m:math><m:mi>A</m:mi></m:math>&#160;that are above the safe range parameter as returned by <a class="rout" href="../X02/x02amf.xml">X02AMF</a>.  The singular vectors corresponding to underflowed or zero singular values are not computed.  The value of <m:math><m:mrow><m:mi>rank</m:mi><m:mfenced separators=""><m:mi>A</m:mi></m:mfenced></m:mrow></m:math>&#160;is returned by rounding <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#WORK"><m:mi mathcolor="#EE0000" mathvariant="bold">WORK</m:mi></m:maction><m:mfenced separators=""><m:mn>2</m:mn></m:mfenced></m:math>&#160;to the nearest whole number. Also see the descriptions of <a class="arg" href="#SVA">SVA</a> and <a class="arg" href="#WORK">WORK</a>. The computed columns of <m:math><m:mi>U</m:mi></m:math>&#160;are mutually numerically orthogonal up to approximately <m:math><m:mi mathvariant="italic">tol</m:mi><m:mo>=</m:mo><m:msqrt><m:mi>m</m:mi></m:msqrt><m:mo>&#215;</m:mo><m:mi>&#949;</m:mi></m:math>; or <m:math><m:mi mathvariant="italic">tol</m:mi><m:mo>=</m:mo><m:mi mathvariant="italic">ctol</m:mi><m:mo>&#215;</m:mo><m:mi>&#949;</m:mi></m:math>&#160;(<m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#JOBU"><m:mi mathcolor="#EE0000" mathvariant="bold">JOBU</m:mi></m:maction><m:mo>=</m:mo><m:mtext>'C'</m:mtext></m:math>), where <m:math><m:mi>&#949;</m:mi></m:math>&#160;is the <span class="bitalic">machine precision</span> and <m:math><m:mi mathvariant="italic">ctol</m:mi></m:math>&#160;is supplied on entry in <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#WORK"><m:mi mathcolor="#EE0000" mathvariant="bold">WORK</m:mi></m:maction><m:mfenced separators=""><m:mn>1</m:mn></m:mfenced></m:math>, see the description of <a class="arg" href="#JOBU">JOBU</a>.</dd>
<dt class="paramval">If <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#INFO"><m:mi mathcolor="#EE0000" mathvariant="bold">INFO</m:mi></m:maction><m:mo>&gt;</m:mo><m:mn>0</m:mn></m:math></dt>
<dd>
F08KJF (DGESVJ) did not converge in <m:math><m:mn>30</m:mn></m:math>&#160;iterations (sweeps). In this case, the computed columns of <m:math><m:mi>U</m:mi></m:math>&#160;may not be orthogonal up to <m:math><m:mi mathvariant="italic">tol</m:mi></m:math>. The output <m:math><m:mi>U</m:mi></m:math>&#160;(stored in <a class="arg" href="#A">A</a>), <m:math><m:mi>&#931;</m:mi></m:math>&#160;(given by the computed singular values in <a class="arg" href="#SVA">SVA</a>) and <m:math><m:mi>V</m:mi></m:math>&#160;is still a decomposition of the input matrix <m:math><m:mi>A</m:mi></m:math>&#160;in the sense that the residual <m:math><m:msub><m:mfenced open="&#8214;" close="&#8214;" separators=""><m:mi>A</m:mi><m:mo>-</m:mo><m:mi>&#945;</m:mi><m:mo>&#215;</m:mo><m:mi>U</m:mi><m:mo>&#215;</m:mo><m:mi>&#931;</m:mi><m:mo>&#215;</m:mo><m:msup><m:mi>V</m:mi><m:mi mathvariant="normal">T</m:mi></m:msup></m:mfenced><m:mn>2</m:mn></m:msub><m:mo>/</m:mo><m:msub><m:mfenced open="&#8214;" close="&#8214;" separators=""><m:mi>A</m:mi></m:mfenced><m:mn>2</m:mn></m:msub></m:math>&#160;is small, where <m:math><m:mi>&#945;</m:mi></m:math>&#160;is the value returned in <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#WORK"><m:mi mathcolor="#EE0000" mathvariant="bold">WORK</m:mi></m:maction><m:mfenced separators=""><m:mn>1</m:mn></m:mfenced></m:math>.</dd></dl></dd>
<dt class="paramval">If <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#JOBU"><m:mi mathcolor="#EE0000" mathvariant="bold">JOBU</m:mi></m:maction><m:mo>=</m:mo><m:mtext>'N'</m:mtext></m:math></dt>
<dd><dl>
<dt class="paramval">if <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#INFO"><m:mi mathcolor="#EE0000" mathvariant="bold">INFO</m:mi></m:maction><m:mo>=</m:mo><m:mn>0</m:mn></m:math></dt>
<dd>Note that the left singular vectors are &#8216;for free&#8217; in the one-sided Jacobi SVD algorithm. However, if only the singular values are needed, the level of numerical orthogonality of <m:math><m:mi>U</m:mi></m:math>&#160;is not an issue and iterations are stopped when the columns of the iterated matrix are numerically orthogonal up to approximately <m:math><m:mi>m</m:mi><m:mo>&#215;</m:mo><m:mi>&#949;</m:mi></m:math>.  Thus, on exit, <a class="arg" href="#A">A</a> contains the columns of <m:math><m:mi>U</m:mi></m:math>&#160;scaled with the corresponding singular values.</dd>
<dt class="paramval">If <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#INFO"><m:mi mathcolor="#EE0000" mathvariant="bold">INFO</m:mi></m:maction><m:mo>&gt;</m:mo><m:mn>0</m:mn></m:math></dt>
<dd>F08KJF (DGESVJ) did not converge in <m:math><m:mn>30</m:mn></m:math>&#160;iterations (sweeps).</dd></dl></dd></dl></div>
</dd><dt class="paramhead"><a name="LDA" id="LDA"/>7: &#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 F08KJF (DGESVJ) 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="SVA" id="SVA"/>8: &#160;&#160;&#8194; SVA(<a class="arg" href="#N">N</a>) &#8211; REAL&#160;(KIND=nag_wp)&#160;array<span class="pclass">Output</span></dt><dd>
<div class="paramtext"><i>On exit</i>: the, possibly scaled, singular values of <m:math><m:mi>A</m:mi></m:math>.

<dl>
<dt class="paramval">If <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#INFO"><m:mi mathcolor="#EE0000" mathvariant="bold">INFO</m:mi></m:maction><m:mo>=</m:mo><m:mn>0</m:mn></m:math></dt>
<dd>The singular values of <m:math><m:mi>A</m:mi></m:math>&#160;are <m:math><m:msub><m:mi>&#963;</m:mi><m:mi mathvariant="italic">i</m:mi></m:msub><m:mo>=</m:mo><m:mi>&#945;</m:mi><m:maction actiontype="link" dsi:type="simple" dsi:href="#SVA"><m:mi mathcolor="#EE0000" mathvariant="bold">SVA</m:mi></m:maction><m:mfenced separators=""><m:mi mathvariant="italic">i</m:mi></m:mfenced></m:math>, for <m:math><m:mi mathvariant="italic">i</m:mi><m:mo>=</m:mo><m:mn>1</m:mn><m:mo>,</m:mo><m:mn>2</m:mn><m:mo>,</m:mo><m:mo>&#8230;</m:mo><m:mo>,</m:mo><m:mi>n</m:mi></m:math>, where <m:math><m:mi>&#945;</m:mi></m:math>&#160;is the scale factor stored in <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#WORK"><m:mi mathcolor="#EE0000" mathvariant="bold">WORK</m:mi></m:maction><m:mfenced separators=""><m:mn>1</m:mn></m:mfenced></m:math>.  Normally <m:math><m:mi>&#945;</m:mi><m:mo>=</m:mo><m:mn>1</m:mn></m:math>, however, if some of the singular values of <m:math><m:mi>A</m:mi></m:math>&#160;might underflow or overflow, then <m:math><m:mi>&#945;</m:mi><m:mo>&#8800;</m:mo><m:mn>1</m:mn></m:math>&#160;and the scale factor needs to be applied to obtain the singular values.
</dd>
<dt class="paramval">If <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#INFO"><m:mi mathcolor="#EE0000" mathvariant="bold">INFO</m:mi></m:maction><m:mo>&gt;</m:mo><m:mn>0</m:mn></m:math></dt>
<dd>F08KJF (DGESVJ) did not converge in <m:math><m:mn>30</m:mn></m:math>&#160;iterations and <m:math><m:mi>&#945;</m:mi><m:mo>&#215;</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#SVA"><m:mi mathcolor="#EE0000" mathvariant="bold">SVA</m:mi></m:maction></m:math>&#160;may not be accurate.</dd></dl>
</div>
</dd><dt class="paramhead"><a name="MV" id="MV"/>9: &#160;&#160;&#8194; MV &#8211; INTEGER<span class="pclass">Input</span></dt><dd>
<div class="paramtext"><i>On entry</i>: if <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#JOBV"><m:mi mathcolor="#EE0000" mathvariant="bold">JOBV</m:mi></m:maction><m:mo>=</m:mo><m:mtext>'A'</m:mtext></m:math>, the product of Jacobi rotations is applied to the first <a class="arg" href="#MV">MV</a> rows of <a class="arg" href="#V">V</a>.
<div class="paramtext">If <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#JOBV"><m:mi mathcolor="#EE0000" mathvariant="bold">JOBV</m:mi></m:maction><m:mo>&#8800;</m:mo><m:mtext>'A'</m:mtext></m:math>, <a class="arg" href="#MV">MV</a> is ignored.  See the description of <a class="arg" href="#JOBV">JOBV</a>.</div>
</div>
</dd><dt class="paramhead"><a name="V" id="V"/>10: &#8194; V(<a class="arg" href="#LDV">LDV</a>,<m:math><m:mo>*</m:mo></m:math>) &#8211; REAL&#160;(KIND=nag_wp)&#160;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="#V">V</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>&#160;if <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#JOBV"><m:mi mathcolor="#EE0000" mathvariant="bold">JOBV</m:mi></m:maction><m:mo>=</m:mo><m:mtext>'V'</m:mtext></m:math>&#160;or <m:math><m:mtext>'A'</m:mtext></m:math>, and at least <m:math><m:mn>1</m:mn></m:math>&#160;otherwise.</div>
<div class="paramtext"><i>On entry</i>: if <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#JOBV"><m:mi mathcolor="#EE0000" mathvariant="bold">JOBV</m:mi></m:maction><m:mo>=</m:mo><m:mtext>'A'</m:mtext></m:math>,  <a class="arg" href="#V">V</a> must contain an <a class="arg" href="#MV">MV</a> by <m:math><m:mi>n</m:mi></m:math>&#160;matrix to be premultiplied by the matrix <m:math><m:mi>V</m:mi></m:math>&#160;of right singular vectors.</div>
<div class="paramtext"><i>On exit</i>: the right singular vectors of <m:math><m:mi>A</m:mi></m:math>.
<div class="paramtext">If <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#JOBV"><m:mi mathcolor="#EE0000" mathvariant="bold">JOBV</m:mi></m:maction><m:mo>=</m:mo><m:mtext>'V'</m:mtext></m:math>, <a class="arg" href="#V">V</a> contains the <m:math><m:mi>n</m:mi></m:math>&#160;by <m:math><m:mi>n</m:mi></m:math>&#160;matrix of the right singular vectors.</div>
<div class="paramtext">If <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#JOBV"><m:mi mathcolor="#EE0000" mathvariant="bold">JOBV</m:mi></m:maction><m:mo>=</m:mo><m:mtext>'A'</m:mtext></m:math>, <a class="arg" href="#V">V</a> contains the product of the computed right singular vector matrix and the initial matrix in the array <a class="arg" href="#V">V</a>.</div>
<div class="paramtext">If <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#JOBV"><m:mi mathcolor="#EE0000" mathvariant="bold">JOBV</m:mi></m:maction><m:mo>=</m:mo><m:mtext>'N'</m:mtext></m:math>, <a class="arg" href="#V">V</a> is not referenced.</div>
</div>
</dd><dt class="paramhead"><a name="LDV" id="LDV"/>11: &#8194; LDV &#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="#V">V</a> as declared in the (sub)program from which F08KJF (DGESVJ) 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="#JOBV"><m:mi mathcolor="#EE0000" mathvariant="bold">JOBV</m:mi></m:maction><m:mo>=</m:mo><m:mtext>'V'</m:mtext></m:math>, <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#LDV"><m:mi mathcolor="#EE0000" mathvariant="bold">LDV</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">if <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#JOBV"><m:mi mathcolor="#EE0000" mathvariant="bold">JOBV</m:mi></m:maction><m:mo>=</m:mo><m:mtext>'A'</m:mtext></m:math>, <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#LDV"><m:mi mathcolor="#EE0000" mathvariant="bold">LDV</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="#MV"><m:mi mathcolor="#EE0000" mathvariant="bold">MV</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="#LDV"><m:mi mathcolor="#EE0000" mathvariant="bold">LDV</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="WORK" id="WORK"/>12: &#8194; WORK(<a class="arg" href="#LWORK">LWORK</a>) &#8211; REAL&#160;(KIND=nag_wp)&#160;array<span class="pclass">Communication Array</span></dt><dd>
<div class="paramtext"><i>On entry</i>: if <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#JOBU"><m:mi mathcolor="#EE0000" mathvariant="bold">JOBU</m:mi></m:maction><m:mo>=</m:mo><m:mtext>'C'</m:mtext></m:math>, <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#WORK"><m:mi mathcolor="#EE0000" mathvariant="bold">WORK</m:mi></m:maction><m:mfenced separators=""><m:mn>1</m:mn></m:mfenced><m:mo>=</m:mo><m:mi mathvariant="italic">ctol</m:mi></m:math>, where <m:math><m:mi mathvariant="italic">ctol</m:mi></m:math>&#160;defines the threshold for convergence.  The process stops if all columns of <m:math><m:mi>A</m:mi></m:math>&#160;are mutually orthogonal up to <m:math><m:mi mathvariant="italic">ctol</m:mi><m:mo>&#215;</m:mo><m:mi>&#949;</m:mi></m:math>.  It is required that <m:math><m:mi mathvariant="italic">ctol</m:mi><m:mo>&#8805;</m:mo><m:mn>1</m:mn></m:math>, i.e., it is not possible to force the routine to obtain orthogonality below <m:math><m:mi>&#949;</m:mi></m:math>.  <m:math><m:mi mathvariant="italic">ctol</m:mi></m:math>&#160;greater than <m:math><m:mn>1</m:mn><m:mo>/</m:mo><m:mi>&#949;</m:mi></m:math>&#160;is meaningless, where <m:math><m:mi>&#949;</m:mi></m:math>&#160;is the <span class="bitalic">machine precision</span>. </div>
<div class="paramtext"><i>On exit</i>: contains information about the completed job.

<dl>
<dt class="paramval"><m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#WORK"><m:mi mathcolor="#EE0000" mathvariant="bold">WORK</m:mi></m:maction><m:mfenced separators=""><m:mn>1</m:mn></m:mfenced></m:math></dt>
<dd>the scaling factor, <m:math><m:mi>&#945;</m:mi></m:math>, such that <m:math><m:mi>&#945;</m:mi><m:mo>&#215;</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#SVA"><m:mi mathcolor="#EE0000" mathvariant="bold">SVA</m:mi></m:maction><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:math>&#160;are the computed singular values of <m:math><m:mi>A</m:mi></m:math>.  (See description of <a class="arg" href="#SVA">SVA</a>.)</dd>
<dt class="paramval"><m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#WORK"><m:mi mathcolor="#EE0000" mathvariant="bold">WORK</m:mi></m:maction><m:mfenced separators=""><m:mn>2</m:mn></m:mfenced></m:math></dt>
<dd><m:math><m:mrow><m:mi>nint</m:mi><m:mfenced separators=""><m:maction actiontype="link" dsi:type="simple" dsi:href="#WORK"><m:mi mathcolor="#EE0000" mathvariant="bold">WORK</m:mi></m:maction><m:mfenced separators=""><m:mn>2</m:mn></m:mfenced></m:mfenced></m:mrow></m:math>gives the number of the computed nonzero singular values.</dd>
<dt class="paramval"><m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#WORK"><m:mi mathcolor="#EE0000" mathvariant="bold">WORK</m:mi></m:maction><m:mfenced separators=""><m:mn>3</m:mn></m:mfenced></m:math></dt>
<dd><m:math><m:mrow><m:mi>nint</m:mi><m:mfenced separators=""><m:maction actiontype="link" dsi:type="simple" dsi:href="#WORK"><m:mi mathcolor="#EE0000" mathvariant="bold">WORK</m:mi></m:maction><m:mfenced separators=""><m:mn>3</m:mn></m:mfenced></m:mfenced></m:mrow></m:math>&#160;gives the number of the computed singular values that are larger than the underflow threshold.</dd>
<dt class="paramval"><m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#WORK"><m:mi mathcolor="#EE0000" mathvariant="bold">WORK</m:mi></m:maction><m:mfenced separators=""><m:mn>4</m:mn></m:mfenced></m:math></dt>
<dd><m:math><m:mrow><m:mi>nint</m:mi><m:mfenced separators=""><m:maction actiontype="link" dsi:type="simple" dsi:href="#WORK"><m:mi mathcolor="#EE0000" mathvariant="bold">WORK</m:mi></m:maction><m:mfenced separators=""><m:mn>4</m:mn></m:mfenced></m:mfenced></m:mrow></m:math>&#160;gives the number of iterations (sweeps of Jacobi rotations) needed for numerical convergence.</dd>
<dt class="paramval"><m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#WORK"><m:mi mathcolor="#EE0000" mathvariant="bold">WORK</m:mi></m:maction><m:mfenced separators=""><m:mn>5</m:mn></m:mfenced></m:math></dt>
<dd><m:math><m:msub><m:mi mathvariant="normal">max</m:mi><m:mrow><m:mi>i</m:mi><m:mo>&#8800;</m:mo><m:mi>j</m:mi></m:mrow></m:msub><m:mfenced open="|" close="|" separators=""><m:mrow><m:mi>cos</m:mi><m:mfenced separators=""><m:mrow><m:mi>A</m:mi><m:mfenced separators=""><m:mo>:</m:mo><m:mo>,</m:mo><m:mi>i</m:mi></m:mfenced></m:mrow><m:mo>,</m:mo><m:mrow><m:mi>A</m:mi><m:mfenced separators=""><m:mo>:</m:mo><m:mo>,</m:mo><m:mi>j</m:mi></m:mfenced></m:mrow></m:mfenced></m:mrow></m:mfenced></m:math>&#160;in the last iteration (sweep).  This is useful information in cases when F08KJF (DGESVJ) did not converge, as it can be used to estimate whether the output is still useful and for subsequent analysis.</dd>
<dt class="paramval"><m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#WORK"><m:mi mathcolor="#EE0000" mathvariant="bold">WORK</m:mi></m:maction><m:mfenced separators=""><m:mn>6</m:mn></m:mfenced></m:math></dt>
<dd>The largest absolute value over all sines of the Jacobi rotation angles in the last sweep. It can be useful for subsequent analysis.</dd></dl>
</div><div class="paramtext"><i>Constraint</i>:
  
if <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#JOBU"><m:mi mathcolor="#EE0000" mathvariant="bold">JOBU</m:mi></m:maction><m:mo>=</m:mo><m:mtext>'C'</m:mtext></m:math>, <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#WORK"><m:mi mathcolor="#EE0000" mathvariant="bold">WORK</m:mi></m:maction><m:mfenced separators=""><m:mn>1</m:mn></m:mfenced><m:mo>&#8805;</m:mo><m:mn>1.0</m:mn></m:math>.
</div>
</dd><dt class="paramhead"><a name="LWORK" id="LWORK"/>13: &#8194; LWORK &#8211; INTEGER<span class="pclass">Input</span></dt><dd>
<div class="paramtext"><i>On entry</i>: the dimension of the array <a class="arg" href="#WORK">WORK</a> as declared in the (sub)program from which F08KJF (DGESVJ) is called.</div><div class="paramtext"><i>Constraint</i>:
  <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#LWORK"><m:mi mathcolor="#EE0000" mathvariant="bold">LWORK</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>6</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:maction actiontype="link" dsi:type="simple" dsi:href="#N"><m:mi mathcolor="#EE0000" mathvariant="bold">N</m:mi></m:maction></m:mrow></m:mfenced></m:mrow></m:math>.
</div>
</dd><dt class="paramhead"><a name="INFO" id="INFO"/>14: &#8194; INFO &#8211; INTEGER<span class="pclass">Output</span></dt><dd><div class="paramtext"><i>On exit</i>: <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#INFO"><m:mi mathcolor="#EE0000" mathvariant="bold">INFO</m:mi></m:maction><m:mo>=</m:mo><m:mn>0</m:mn></m:math>&#160;unless the routine detects an error (see <a class="sec" href="#errors">Section 6</a>).</div></dd></dl><h2 class="standard"><a class="sec" name="errors" id="errors"/>6&#160;&#160;Error Indicators and Warnings</h2>
<div class="paramtext">Errors or warnings detected by the routine:</div>
<dl class="ifail">
<dt class="errorhead"><a name="INlt0" id="INlt0"/><m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#INFO"><m:mi mathcolor="#EE0000" mathvariant="bold">INFO</m:mi></m:maction><m:mo>&lt;</m:mo><m:mn>0</m:mn></m:math></dt>
<dd><div class="paramtext">If <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#INFO"><m:mi mathcolor="#EE0000" mathvariant="bold">INFO</m:mi></m:maction><m:mo>=</m:mo><m:mo>-</m:mo><m:mi>i</m:mi></m:math>, argument <m:math><m:mi>i</m:mi></m:math>&#160;had an illegal value. An explanatory message is output, and execution of the program is terminated.</div></dd>
</dl><dl class="ifail">
<dt class="errorhead"><a name="INgt0" id="INgt0"/><m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#INFO"><m:mi mathcolor="#EE0000" mathvariant="bold">INFO</m:mi></m:maction><m:mo>&gt;</m:mo><m:mn>0</m:mn></m:math></dt>
<dd>
<div class="paramtext">F08KJF (DGESVJ) did not converge in <m:math><m:mn>30</m:mn></m:math>&#160;iterations (sweeps), but its output might still be useful.</div>
</dd>
</dl><h2 class="standard"><a class="sec" name="accuracy" id="accuracy"/>7&#160;&#160;Accuracy</h2>
<div class="paramtext">The computed singular value decomposition is nearly the exact singular value decomposition for a nearby matrix <m:math>
 <m:mfenced separators=""><m:mi>A</m:mi><m:mo>+</m:mo><m:mi>E</m:mi></m:mfenced>
</m:math>, where

<div class="formula"><table class="formula"><tr><td class="formula"><m:math display="block">
 <m:msub><m:mfenced open="&#8214;" close="&#8214;" separators=""><m:mi>E</m:mi></m:mfenced><m:mn>2</m:mn></m:msub>
 <m:mo>=</m:mo>
 <m:mrow><m:mi mathvariant="italic">O</m:mi><m:mfenced separators=""><m:mi>&#949;</m:mi></m:mfenced></m:mrow>
 <m:msub><m:mfenced open="&#8214;" close="&#8214;" separators=""><m:mi>A</m:mi></m:mfenced><m:mn>2</m:mn></m:msub>
 <m:mtext>,</m:mtext>
</m:math></td><td class="formula2"/></tr></table></div>

and <m:math>
 <m:mi>&#949;</m:mi>
</m:math>&#160;is the <span class="bitalic">machine precision</span>.  In addition, the computed singular vectors are nearly orthogonal to working precision.  See Section 4.9 of <a class="ref" href="#ref252">Anderson <span class="italic">et al.</span> (1999)</a> for further details.</div><div class="paramtext">See Section 6 of <a class="ref" href="#ref884">Drmac and Veselic (2008a)</a> for a detailed discussion of the accuracy of the computed SVD.</div><h2 class="standard"><a class="sec" name="fcomments" id="fcomments"/>8&#160;&#160;Further Comments</h2>
<div class="paramtext">This SVD algorithm is numerically superior to the bidiagonalization based <m:math><m:mi>Q</m:mi><m:mi>R</m:mi></m:math>&#160;algorithm implemented by <a class="rout" href="../F08/f08kbf.xml">F08KBF (DGESVD)</a> and the divide and conquer algorithm implemented by <a class="rout" href="../F08/f08kdf.xml">F08KDF (DGESDD)</a> algorithms and is considerably faster than previous implementations of the (equally accurate) Jacobi SVD method.  Moreover, this algorithm can compute the SVD faster than <a class="rout" href="../F08/f08kbf.xml">F08KBF (DGESVD)</a> and not much slower than <a class="rout" href="../F08/f08kdf.xml">F08KDF (DGESDD)</a>.  See Section 3.3 of <a class="ref" href="#ref885">Drmac and Veselic (2008b)</a> for the details.</div><h2 class="standard"><a class="sec" name="example" id="example"/>9&#160;&#160;Example</h2>
<div class="paramtext">This example finds the singular values and left and right singular vectors of the <m:math><m:mn>6</m:mn></m:math>&#160;by <m:math><m:mn>4</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>2.27</m:mn></m:mtd>
   <m:mtd><m:mrow><m:mo>-</m:mo><m:mn>1.54</m:mn></m:mrow></m:mtd>
   <m:mtd><m:mn>1.15</m:mn></m:mtd>
   <m:mtd><m:mrow><m:mo>-</m:mo><m:mn>1.94</m:mn></m:mrow></m:mtd>
</m:mtr><m:mtr>
   <m:mtd><m:mn>0.28</m:mn></m:mtd>
   <m:mtd><m:mrow><m:mo>-</m:mo><m:mn>1.67</m:mn></m:mrow></m:mtd>
   <m:mtd><m:mn>0.94</m:mn></m:mtd>
   <m:mtd><m:mrow><m:mo>-</m:mo><m:mn>0.78</m:mn></m:mrow></m:mtd>
</m:mtr><m:mtr>
   <m:mtd><m:mrow><m:mo>-</m:mo><m:mn>0.48</m:mn></m:mrow></m:mtd>
   <m:mtd><m:mrow><m:mo>-</m:mo><m:mn>3.09</m:mn></m:mrow></m:mtd>
   <m:mtd><m:mn>0.99</m:mn></m:mtd>
   <m:mtd><m:mrow><m:mo>-</m:mo><m:mn>0.21</m:mn></m:mrow></m:mtd>
</m:mtr><m:mtr>
   <m:mtd><m:mn>1.07</m:mn></m:mtd>
   <m:mtd><m:mn>1.22</m:mn></m:mtd>
   <m:mtd><m:mn>0.79</m:mn></m:mtd>
   <m:mtd><m:mn>0.63</m:mn></m:mtd>
</m:mtr><m:mtr>
   <m:mtd><m:mrow><m:mo>-</m:mo><m:mn>2.35</m:mn></m:mrow></m:mtd>
   <m:mtd><m:mn>2.93</m:mn></m:mtd>
   <m:mtd><m:mrow><m:mo>-</m:mo><m:mn>1.45</m:mn></m:mrow></m:mtd>
   <m:mtd><m:mn>2.30</m:mn></m:mtd>
</m:mtr><m:mtr>
   <m:mtd><m:mn>0.62</m:mn></m:mtd>
   <m:mtd><m:mrow><m:mo>-</m:mo><m:mn>7.39</m:mn></m:mrow></m:mtd>
   <m:mtd><m:mn>1.03</m:mn></m:mtd>
   <m:mtd><m:mrow><m:mo>-</m:mo><m:mn>2.57</m:mn></m:mrow></m:mtd>
</m:mtr>
</m:mtable></m:mfenced>
 <m:mtext>,</m:mtext>
</m:math></td><td class="formula2"/></tr></table></div>

together with approximate error bounds for the computed singular values and vectors.</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/f08kjfe.f90">Program Text (f08kjfe.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/f08kjfe.d">Program&#160;Data (f08kjfe.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/f08kjfe.r">Program Results (f08kjfe.r)</a></p>
<hr/><div><a class="rout" href="../../pdf/F08/f08kjf.pdf">F08KJF (DGESVJ) (PDF version)</a></div><div><a class="chap" href="f08conts.xml">F08 Chapter Contents</a></div><div><a class="chapint" href="f08intro.xml">F08 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>