<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/> <meta name="generator" content="Doxygen 1.8.5"/> <title>Eigen-unsupported: JacobiSVD< _MatrixType, QRPreconditioner > Class Template Reference</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="dynsections.js"></script> <link href="navtree.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="resize.js"></script> <script type="text/javascript" src="navtree.js"></script> <script type="text/javascript"> $(document).ready(initResizable); $(window).load(resizeHeight); </script> <link href="search/search.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="search/search.js"></script> <script type="text/javascript"> $(document).ready(function() { searchBox.OnSelectItem(0); }); </script> <link href="doxygen.css" rel="stylesheet" type="text/css" /> <link href="eigendoxy.css" rel="stylesheet" type="text/css"> <!-- --> <script type="text/javascript" src="eigen_navtree_hacks.js"></script> <!-- <script type="text/javascript"> --> <!-- </script> --> </head> <body> <div id="top"><!-- do not remove this div, it is closed by doxygen! --> <!-- <a name="top"></a> --> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 56px;"> <td id="projectlogo"><img alt="Logo" src="Eigen_Silly_Professor_64x64.png"/></td> <td style="padding-left: 0.5em;"> <div id="projectname"><a href="http://eigen.tuxfamily.org">Eigen-unsupported</a>  <span id="projectnumber">3.2.0</span> </div> </td> <td> <div id="MSearchBox" class="MSearchBoxInactive"> <span class="left"> <img id="MSearchSelect" src="search/mag_sel.png" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" alt=""/> <input type="text" id="MSearchField" value="Search" accesskey="S" onfocus="searchBox.OnSearchFieldFocus(true)" onblur="searchBox.OnSearchFieldFocus(false)" onkeyup="searchBox.OnSearchFieldChange(event)"/> </span><span class="right"> <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a> </span> </div> </td> </tr> </tbody> </table> </div> <!-- end header part --> <!-- Generated by Doxygen 1.8.5 --> <script type="text/javascript"> var searchBox = new SearchBox("searchBox", "search",false,'Search'); </script> </div><!-- top --> <div id="side-nav" class="ui-resizable side-nav-resizable"> <div id="nav-tree"> <div id="nav-tree-contents"> <div id="nav-sync" class="sync"></div> </div> </div> <div id="splitbar" style="-moz-user-select:none;" class="ui-resizable-handle"> </div> </div> <script type="text/javascript"> $(document).ready(function(){initNavTree('classEigen_1_1JacobiSVD.html','');}); </script> <div id="doc-content"> <!-- window showing the filter options --> <div id="MSearchSelectWindow" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> <a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark"> </span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark"> </span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark"> </span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark"> </span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark"> </span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark"> </span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark"> </span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark"> </span>Groups</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark"> </span>Pages</a></div> <!-- iframe showing the search results (closed by default) --> <div id="MSearchResultsWindow"> <iframe src="javascript:void(0)" frameborder="0" name="MSearchResults" id="MSearchResults"> </iframe> </div> <div class="header"> <div class="summary"> <a href="classEigen_1_1JacobiSVD-members.html">List of all members</a> | <a href="#pub-methods">Public Member Functions</a> </div> <div class="headertitle"> <div class="title">JacobiSVD< _MatrixType, QRPreconditioner > Class Template Reference<div class="ingroups"><a class="el" href="group__SVD__Module.html">SVD module</a></div></div> </div> </div><!--header--> <div class="contents"> <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2> <div class="textblock"><h3>template<typename _MatrixType, int QRPreconditioner><br/> class Eigen::JacobiSVD< _MatrixType, QRPreconditioner ></h3> <p>Two-sided Jacobi SVD decomposition of a rectangular matrix. </p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">MatrixType</td><td>the type of the matrix of which we are computing the SVD decomposition </td></tr> <tr><td class="paramname">QRPreconditioner</td><td>this optional parameter allows to specify the type of QR decomposition that will be used internally for the R-SVD step for non-square matrices. See discussion of possible values below.</td></tr> </table> </dd> </dl> <p>SVD decomposition consists in decomposing any n-by-p matrix <em>A</em> as a product </p> <p class="formulaDsp"> <img class="formulaDsp" alt="\[ A = U S V^* \]" src="form_93.png"/> </p> <p> where <em>U</em> is a n-by-n unitary, <em>V</em> is a p-by-p unitary, and <em>S</em> is a n-by-p real positive matrix which is zero outside of its main diagonal; the diagonal entries of S are known as the <em>singular</em> <em>values</em> of <em>A</em> and the columns of <em>U</em> and <em>V</em> are known as the left and right <em>singular</em> <em>vectors</em> of <em>A</em> respectively.</p> <p>Singular values are always sorted in decreasing order.</p> <p>This <a class="el" href="classEigen_1_1JacobiSVD.html" title="Two-sided Jacobi SVD decomposition of a rectangular matrix. ">JacobiSVD</a> decomposition computes only the singular values by default. If you want <em>U</em> or <em>V</em>, you need to ask for them explicitly.</p> <p>You can ask for only <em>thin</em> <em>U</em> or <em>V</em> to be computed, meaning the following. In case of a rectangular n-by-p matrix, letting <em>m</em> be the smaller value among <em>n</em> and <em>p</em>, there are only <em>m</em> singular vectors; the remaining columns of <em>U</em> and <em>V</em> do not correspond to actual singular vectors. Asking for <em>thin</em> <em>U</em> or <em>V</em> means asking for only their <em>m</em> first columns to be formed. So <em>U</em> is then a n-by-m matrix, and <em>V</em> is then a p-by-m matrix. Notice that thin <em>U</em> and <em>V</em> are all you need for (least squares) solving.</p> <p>Here's an example demonstrating basic usage: </p> <div class="fragment"><div class="line">MatrixXf m = MatrixXf::Random(3,2);</div> <div class="line">cout << <span class="stringliteral">"Here is the matrix m:"</span> << endl << m << endl;</div> <div class="line">JacobiSVD<MatrixXf> svd(m, ComputeThinU | ComputeThinV);</div> <div class="line">cout << <span class="stringliteral">"Its singular values are:"</span> << endl << svd.singularValues() << endl;</div> <div class="line">cout << <span class="stringliteral">"Its left singular vectors are the columns of the thin U matrix:"</span> << endl << svd.matrixU() << endl;</div> <div class="line">cout << <span class="stringliteral">"Its right singular vectors are the columns of the thin V matrix:"</span> << endl << svd.matrixV() << endl;</div> <div class="line">Vector3f rhs(1, 0, 0);</div> <div class="line">cout << <span class="stringliteral">"Now consider this rhs vector:"</span> << endl << rhs << endl;</div> <div class="line">cout << <span class="stringliteral">"A least-squares solution of m*x = rhs is:"</span> << endl << svd.solve(rhs) << endl;</div> </div><!-- fragment --><p> Output: </p> <pre class="fragment">Here is the matrix m: 0.68 0.597 -0.211 0.823 0.566 -0.605 Its singular values are: 1.19 0.899 Its left singular vectors are the columns of the thin U matrix: 0.388 0.866 0.712 -0.0634 -0.586 0.496 Its right singular vectors are the columns of the thin V matrix: -0.183 0.983 0.983 0.183 Now consider this rhs vector: 1 0 0 A least-squares solution of m*x = rhs is: 0.888 0.496 </pre><p>This <a class="el" href="classEigen_1_1JacobiSVD.html" title="Two-sided Jacobi SVD decomposition of a rectangular matrix. ">JacobiSVD</a> class is a two-sided Jacobi R-SVD decomposition, ensuring optimal reliability and accuracy. The downside is that it's slower than bidiagonalizing SVD algorithms for large square matrices; however its complexity is still <img class="formulaInl" alt="$ O(n^2p) $" src="form_94.png"/> where <em>n</em> is the smaller dimension and <em>p</em> is the greater dimension, meaning that it is still of the same order of complexity as the faster bidiagonalizing R-SVD algorithms. In particular, like any R-SVD, it takes advantage of non-squareness in that its complexity is only linear in the greater dimension.</p> <p>If the input matrix has inf or nan coefficients, the result of the computation is undefined, but the computation is guaranteed to terminate in finite (and reasonable) time.</p> <p>The possible values for QRPreconditioner are: </p> <ul> <li>ColPivHouseholderQRPreconditioner is the default. In practice it's very safe. It uses column-pivoting QR. </li> <li>FullPivHouseholderQRPreconditioner, is the safest and slowest. It uses full-pivoting QR. Contrary to other QRs, it doesn't allow computing thin unitaries. </li> <li>HouseholderQRPreconditioner is the fastest, and less safe and accurate than the pivoting variants. It uses non-pivoting QR. This is very similar in safety and accuracy to the bidiagonalization process used by bidiagonalizing SVD algorithms (since bidiagonalization is inherently non-pivoting). However the resulting SVD is still more reliable than bidiagonalizing SVDs because the Jacobi-based iterarive process is more reliable than the optimized bidiagonal SVD iterations. </li> <li>NoQRPreconditioner allows not to use a QR preconditioner at all. This is useful if you know that you will only be computing <a class="el" href="classEigen_1_1JacobiSVD.html" title="Two-sided Jacobi SVD decomposition of a rectangular matrix. ">JacobiSVD</a> decompositions of square matrices. Non-square matrices require a QR preconditioner. Using this option will result in faster compilation and smaller executable code. It won't significantly speed up computation, since <a class="el" href="classEigen_1_1JacobiSVD.html" title="Two-sided Jacobi SVD decomposition of a rectangular matrix. ">JacobiSVD</a> is always checking if QR preconditioning is needed before applying it anyway.</li> </ul> <dl class="section see"><dt>See Also</dt><dd>MatrixBase::jacobiSvd() </dd></dl> </div><div id="dynsection-0" onclick="return toggleVisibility(this)" class="dynheader closed" style="cursor:pointer;"> <img id="dynsection-0-trigger" src="closed.png" alt="+"/> Inheritance diagram for JacobiSVD< _MatrixType, QRPreconditioner >:</div> <div id="dynsection-0-summary" class="dynsummary" style="display:block;"> </div> <div id="dynsection-0-content" class="dyncontent" style="display:none;"> <div class="center"><img src="classEigen_1_1JacobiSVD__inherit__graph.png" border="0" usemap="#JacobiSVD_3_01__MatrixType_00_01QRPreconditioner_01_4_inherit__map" alt="Inheritance graph"/></div> <map name="JacobiSVD_3_01__MatrixType_00_01QRPreconditioner_01_4_inherit__map" id="JacobiSVD_3_01__MatrixType_00_01QRPreconditioner_01_4_inherit__map"> <area shape="rect" id="node2" href="classEigen_1_1SVDBase.html" title="Mother class of SVD classes algorithms. " alt="" coords="5,5,189,435"/></map> </div> <table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a> Public Member Functions</h2></td></tr> <tr class="memitem:a3b2bfdc0a8dd672390fb4ba22f4ef434"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classEigen_1_1SVDBase.html">SVDBase</a>< MatrixType > & </td><td class="memItemRight" valign="bottom"><a class="el" href="classEigen_1_1JacobiSVD.html#a3b2bfdc0a8dd672390fb4ba22f4ef434">compute</a> (const MatrixType &matrix, unsigned int computationOptions)</td></tr> <tr class="memdesc:a3b2bfdc0a8dd672390fb4ba22f4ef434"><td class="mdescLeft"> </td><td class="mdescRight">Method performing the decomposition of given matrix using custom options. <a href="#a3b2bfdc0a8dd672390fb4ba22f4ef434">More...</a><br/></td></tr> <tr class="separator:a3b2bfdc0a8dd672390fb4ba22f4ef434"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a26e02670d0a94c92ab41c2bc7f70e781"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classEigen_1_1SVDBase.html">SVDBase</a>< MatrixType > & </td><td class="memItemRight" valign="bottom"><a class="el" href="classEigen_1_1JacobiSVD.html#a26e02670d0a94c92ab41c2bc7f70e781">compute</a> (const MatrixType &matrix)</td></tr> <tr class="memdesc:a26e02670d0a94c92ab41c2bc7f70e781"><td class="mdescLeft"> </td><td class="mdescRight">Method performing the decomposition of given matrix using current options. <a href="#a26e02670d0a94c92ab41c2bc7f70e781">More...</a><br/></td></tr> <tr class="separator:a26e02670d0a94c92ab41c2bc7f70e781"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a1ffab6aab715fe0918a841611a95e9aa"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classEigen_1_1SVDBase.html#a1ffab6aab715fe0918a841611a95e9aa">computeU</a> () const </td></tr> <tr class="separator:a1ffab6aab715fe0918a841611a95e9aa"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a92e99646eefbeb071ef220841555a703"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classEigen_1_1SVDBase.html#a92e99646eefbeb071ef220841555a703">computeV</a> () const </td></tr> <tr class="separator:a92e99646eefbeb071ef220841555a703"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a0e963136a69da877ff06f27e7b746351"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classEigen_1_1JacobiSVD.html#a0e963136a69da877ff06f27e7b746351">JacobiSVD</a> ()</td></tr> <tr class="memdesc:a0e963136a69da877ff06f27e7b746351"><td class="mdescLeft"> </td><td class="mdescRight">Default Constructor. <a href="#a0e963136a69da877ff06f27e7b746351">More...</a><br/></td></tr> <tr class="separator:a0e963136a69da877ff06f27e7b746351"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a18cfaad45164fc79a0b5e65c194d049d"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classEigen_1_1JacobiSVD.html#a18cfaad45164fc79a0b5e65c194d049d">JacobiSVD</a> (Index rows, Index cols, unsigned int computationOptions=0)</td></tr> <tr class="memdesc:a18cfaad45164fc79a0b5e65c194d049d"><td class="mdescLeft"> </td><td class="mdescRight">Default Constructor with memory preallocation. <a href="#a18cfaad45164fc79a0b5e65c194d049d">More...</a><br/></td></tr> <tr class="separator:a18cfaad45164fc79a0b5e65c194d049d"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:af7d98465f0e886d96423857591a34b26"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classEigen_1_1JacobiSVD.html#af7d98465f0e886d96423857591a34b26">JacobiSVD</a> (const MatrixType &matrix, unsigned int computationOptions=0)</td></tr> <tr class="memdesc:af7d98465f0e886d96423857591a34b26"><td class="mdescLeft"> </td><td class="mdescRight">Constructor performing the decomposition of given matrix. <a href="#af7d98465f0e886d96423857591a34b26">More...</a><br/></td></tr> <tr class="separator:af7d98465f0e886d96423857591a34b26"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a49e16a4adf4fe58a2d65a5e5a31e7654"><td class="memItemLeft" align="right" valign="top">const MatrixUType & </td><td class="memItemRight" valign="bottom"><a class="el" href="classEigen_1_1SVDBase.html#a49e16a4adf4fe58a2d65a5e5a31e7654">matrixU</a> () const </td></tr> <tr class="separator:a49e16a4adf4fe58a2d65a5e5a31e7654"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:ae5158ab7ca44a705c2a3b56ec926b42a"><td class="memItemLeft" align="right" valign="top">const MatrixVType & </td><td class="memItemRight" valign="bottom"><a class="el" href="classEigen_1_1SVDBase.html#ae5158ab7ca44a705c2a3b56ec926b42a">matrixV</a> () const </td></tr> <tr class="separator:ae5158ab7ca44a705c2a3b56ec926b42a"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:aa468765ea9b7f0e92380fa206e6498bd"><td class="memItemLeft" align="right" valign="top">Index </td><td class="memItemRight" valign="bottom"><a class="el" href="classEigen_1_1SVDBase.html#aa468765ea9b7f0e92380fa206e6498bd">nonzeroSingularValues</a> () const </td></tr> <tr class="separator:aa468765ea9b7f0e92380fa206e6498bd"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a48d4068b97dfbb83d62599e56e26797a"><td class="memItemLeft" align="right" valign="top">const SingularValuesType & </td><td class="memItemRight" valign="bottom"><a class="el" href="classEigen_1_1SVDBase.html#a48d4068b97dfbb83d62599e56e26797a">singularValues</a> () const </td></tr> <tr class="separator:a48d4068b97dfbb83d62599e56e26797a"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:ae86e342cd51b067b08f8de8bae77537f"><td class="memTemplParams" colspan="2">template<typename Rhs > </td></tr> <tr class="memitem:ae86e342cd51b067b08f8de8bae77537f"><td class="memTemplItemLeft" align="right" valign="top">const internal::solve_retval<br class="typebreak"/> < <a class="el" href="classEigen_1_1JacobiSVD.html">JacobiSVD</a>, Rhs > </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classEigen_1_1JacobiSVD.html#ae86e342cd51b067b08f8de8bae77537f">solve</a> (const MatrixBase< Rhs > &b) const </td></tr> <tr class="separator:ae86e342cd51b067b08f8de8bae77537f"><td class="memSeparator" colspan="2"> </td></tr> </table> <h2 class="groupheader">Constructor & Destructor Documentation</h2> <a class="anchor" id="a0e963136a69da877ff06f27e7b746351"></a> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname"><a class="el" href="classEigen_1_1JacobiSVD.html">JacobiSVD</a> </td> <td>(</td> <td class="paramname"></td><td>)</td> <td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">inline</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Default Constructor. </p> <p>The default constructor is useful in cases in which the user intends to perform decompositions via <a class="el" href="classEigen_1_1JacobiSVD.html#a26e02670d0a94c92ab41c2bc7f70e781" title="Method performing the decomposition of given matrix using current options. ">JacobiSVD::compute(const MatrixType&)</a>. </p> </div> </div> <a class="anchor" id="a18cfaad45164fc79a0b5e65c194d049d"></a> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname"><a class="el" href="classEigen_1_1JacobiSVD.html">JacobiSVD</a> </td> <td>(</td> <td class="paramtype">Index </td> <td class="paramname"><em>rows</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">Index </td> <td class="paramname"><em>cols</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">unsigned int </td> <td class="paramname"><em>computationOptions</em> = <code>0</code> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">inline</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Default Constructor with memory preallocation. </p> <p>Like the default constructor but with preallocation of the internal data according to the specified problem size. </p> <dl class="section see"><dt>See Also</dt><dd><a class="el" href="classEigen_1_1JacobiSVD.html#a0e963136a69da877ff06f27e7b746351" title="Default Constructor. ">JacobiSVD()</a> </dd></dl> </div> </div> <a class="anchor" id="af7d98465f0e886d96423857591a34b26"></a> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname"><a class="el" href="classEigen_1_1JacobiSVD.html">JacobiSVD</a> </td> <td>(</td> <td class="paramtype">const MatrixType & </td> <td class="paramname"><em>matrix</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">unsigned int </td> <td class="paramname"><em>computationOptions</em> = <code>0</code> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">inline</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Constructor performing the decomposition of given matrix. </p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">matrix</td><td>the matrix to decompose </td></tr> <tr><td class="paramname">computationOptions</td><td>optional parameter allowing to specify if you want full or thin U or V unitaries to be computed. By default, none is computed. This is a bit-field, the possible bits are #ComputeFullU, #ComputeThinU, #ComputeFullV, #ComputeThinV.</td></tr> </table> </dd> </dl> <p>Thin unitaries are only available if your matrix type has a Dynamic number of columns (for example MatrixXf). They also are not available with the (non-default) FullPivHouseholderQR preconditioner. </p> </div> </div> <h2 class="groupheader">Member Function Documentation</h2> <a class="anchor" id="a3b2bfdc0a8dd672390fb4ba22f4ef434"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="classEigen_1_1SVDBase.html">SVDBase</a>< MatrixType > & compute </td> <td>(</td> <td class="paramtype">const MatrixType & </td> <td class="paramname"><em>matrix</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">unsigned int </td> <td class="paramname"><em>computationOptions</em> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div><div class="memdoc"> <p>Method performing the decomposition of given matrix using custom options. </p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">matrix</td><td>the matrix to decompose </td></tr> <tr><td class="paramname">computationOptions</td><td>optional parameter allowing to specify if you want full or thin U or V unitaries to be computed. By default, none is computed. This is a bit-field, the possible bits are #ComputeFullU, #ComputeThinU, #ComputeFullV, #ComputeThinV.</td></tr> </table> </dd> </dl> <p>Thin unitaries are only available if your matrix type has a Dynamic number of columns (for example MatrixXf). They also are not available with the (non-default) FullPivHouseholderQR preconditioner. </p> </div> </div> <a class="anchor" id="a26e02670d0a94c92ab41c2bc7f70e781"></a> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname"><a class="el" href="classEigen_1_1SVDBase.html">SVDBase</a><MatrixType>& compute </td> <td>(</td> <td class="paramtype">const MatrixType & </td> <td class="paramname"><em>matrix</em></td><td>)</td> <td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">inline</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Method performing the decomposition of given matrix using current options. </p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">matrix</td><td>the matrix to decompose</td></tr> </table> </dd> </dl> <p>This method uses the current <em>computationOptions</em>, as already passed to the constructor or to <a class="el" href="classEigen_1_1JacobiSVD.html#a3b2bfdc0a8dd672390fb4ba22f4ef434" title="Method performing the decomposition of given matrix using custom options. ">compute(const MatrixType&, unsigned int)</a>. </p> </div> </div> <a class="anchor" id="a1ffab6aab715fe0918a841611a95e9aa"></a> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">bool computeU </td> <td>(</td> <td class="paramname"></td><td>)</td> <td> const</td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">inherited</span></span> </td> </tr> </table> </div><div class="memdoc"> <dl class="section return"><dt>Returns</dt><dd>true if <em>U</em> (full or thin) is asked for in this SVD decomposition </dd></dl> <p>Referenced by <a class="el" href="classEigen_1_1SVDBase.html#a49e16a4adf4fe58a2d65a5e5a31e7654">SVDBase< _MatrixType >::matrixU()</a>.</p> </div> </div> <a class="anchor" id="a92e99646eefbeb071ef220841555a703"></a> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">bool computeV </td> <td>(</td> <td class="paramname"></td><td>)</td> <td> const</td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">inherited</span></span> </td> </tr> </table> </div><div class="memdoc"> <dl class="section return"><dt>Returns</dt><dd>true if <em>V</em> (full or thin) is asked for in this SVD decomposition </dd></dl> <p>Referenced by <a class="el" href="classEigen_1_1SVDBase.html#ae5158ab7ca44a705c2a3b56ec926b42a">SVDBase< _MatrixType >::matrixV()</a>.</p> </div> </div> <a class="anchor" id="a49e16a4adf4fe58a2d65a5e5a31e7654"></a> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">const MatrixUType& matrixU </td> <td>(</td> <td class="paramname"></td><td>)</td> <td> const</td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">inherited</span></span> </td> </tr> </table> </div><div class="memdoc"> <dl class="section return"><dt>Returns</dt><dd>the <em>U</em> matrix.</dd></dl> <p>For the <a class="el" href="classEigen_1_1SVDBase.html" title="Mother class of SVD classes algorithms. ">SVDBase</a> decomposition of a n-by-p matrix, letting <em>m</em> be the minimum of <em>n</em> and <em>p</em>, the U matrix is n-by-n if you asked for #ComputeFullU, and is n-by-m if you asked for #ComputeThinU.</p> <p>The <em>m</em> first columns of <em>U</em> are the left singular vectors of the matrix being decomposed.</p> <p>This method asserts that you asked for <em>U</em> to be computed. </p> <p>References <a class="el" href="classEigen_1_1SVDBase.html#a1ffab6aab715fe0918a841611a95e9aa">SVDBase< _MatrixType >::computeU()</a>.</p> </div> </div> <a class="anchor" id="ae5158ab7ca44a705c2a3b56ec926b42a"></a> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">const MatrixVType& matrixV </td> <td>(</td> <td class="paramname"></td><td>)</td> <td> const</td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">inherited</span></span> </td> </tr> </table> </div><div class="memdoc"> <dl class="section return"><dt>Returns</dt><dd>the <em>V</em> matrix.</dd></dl> <p>For the SVD decomposition of a n-by-p matrix, letting <em>m</em> be the minimum of <em>n</em> and <em>p</em>, the V matrix is p-by-p if you asked for #ComputeFullV, and is p-by-m if you asked for ComputeThinV.</p> <p>The <em>m</em> first columns of <em>V</em> are the right singular vectors of the matrix being decomposed.</p> <p>This method asserts that you asked for <em>V</em> to be computed. </p> <p>References <a class="el" href="classEigen_1_1SVDBase.html#a92e99646eefbeb071ef220841555a703">SVDBase< _MatrixType >::computeV()</a>.</p> </div> </div> <a class="anchor" id="aa468765ea9b7f0e92380fa206e6498bd"></a> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">Index nonzeroSingularValues </td> <td>(</td> <td class="paramname"></td><td>)</td> <td> const</td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">inherited</span></span> </td> </tr> </table> </div><div class="memdoc"> <dl class="section return"><dt>Returns</dt><dd>the number of singular values that are not exactly 0 </dd></dl> </div> </div> <a class="anchor" id="a48d4068b97dfbb83d62599e56e26797a"></a> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">const SingularValuesType& singularValues </td> <td>(</td> <td class="paramname"></td><td>)</td> <td> const</td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">inherited</span></span> </td> </tr> </table> </div><div class="memdoc"> <dl class="section return"><dt>Returns</dt><dd>the vector of singular values.</dd></dl> <p>For the SVD decomposition of a n-by-p matrix, letting <em>m</em> be the minimum of <em>n</em> and <em>p</em>, the returned vector has size <em>m</em>. Singular values are always sorted in decreasing order. </p> </div> </div> <a class="anchor" id="ae86e342cd51b067b08f8de8bae77537f"></a> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">const internal::solve_retval<<a class="el" href="classEigen_1_1JacobiSVD.html">JacobiSVD</a>, Rhs> solve </td> <td>(</td> <td class="paramtype">const MatrixBase< Rhs > & </td> <td class="paramname"><em>b</em></td><td>)</td> <td> const</td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">inline</span></span> </td> </tr> </table> </div><div class="memdoc"> <dl class="section return"><dt>Returns</dt><dd>a (least squares) solution of <img class="formulaInl" alt="$ A x = b $" src="form_64.png"/> using the current SVD decomposition of A.</dd></dl> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">b</td><td>the right-hand-side of the equation to solve.</td></tr> </table> </dd> </dl> <dl class="section note"><dt>Note</dt><dd>Solving requires both U and V to be computed. Thin U and V are enough, there is no need for full U or V.</dd> <dd> SVD solving is implicitly least-squares. Thus, this method serves both purposes of exact solving and least-squares solving. In other words, the returned solution is guaranteed to minimize the Euclidean norm <img class="formulaInl" alt="$ \Vert A x - b \Vert $" src="form_92.png"/>. </dd></dl> </div> </div> <hr/>The documentation for this class was generated from the following file:<ul> <li><a class="el" href="JacobiSVD_8h_source.html">JacobiSVD.h</a></li> </ul> </div><!-- contents --> </div><!-- doc-content --> <!-- start footer part --> <div id="nav-path" class="navpath"><!-- id is needed for treeview function! --> <ul> <li class="navelem"><a class="el" href="namespaceEigen.html">Eigen</a></li><li class="navelem"><a class="el" href="classEigen_1_1JacobiSVD.html">JacobiSVD</a></li> <li class="footer">Generated on Mon Oct 28 2013 11:05:27 for Eigen-unsupported by <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.5 </li> </ul> </div> <!-- Piwik --> <!-- <script type="text/javascript"> var pkBaseURL = (("https:" == document.location.protocol) ? "https://stats.sylphide-consulting.com/piwik/" : "http://stats.sylphide-consulting.com/piwik/"); document.write(unescape("%3Cscript src='" + pkBaseURL + "piwik.js' type='text/javascript'%3E%3C/script%3E")); </script><script type="text/javascript"> try { var piwikTracker = Piwik.getTracker(pkBaseURL + "piwik.php", 20); piwikTracker.trackPageView(); piwikTracker.enableLinkTracking(); } catch( err ) {} </script><noscript><p><img src="http://stats.sylphide-consulting.com/piwik/piwik.php?idsite=20" style="border:0" alt="" /></p></noscript> --> <!-- End Piwik Tracking Code --> </body> </html>