<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> <title>mrpt::math::CSparseMatrix::CholeskyDecomp Class Reference</title> <link href="doxygen.css" rel="stylesheet" type="text/css"> <link href="tabs.css" rel="stylesheet" type="text/css"> </head><body> <div align="left"><a href="http://www.mrpt.org/">Main MRPT website</a> > <b>C++ reference</b> </div> <div align="right"> <a href="index.html"><img border="0" src="mrpt_logo.png" alt="MRPT logo"></a> </div> <!-- Generated by Doxygen 1.7.5 --> <script type="text/javascript"> var searchBox = new SearchBox("searchBox", "search",false,'Search'); </script> <div id="navrow1" class="tabs"> <ul class="tablist"> <li><a href="index.html"><span>Main Page</span></a></li> <li><a href="pages.html"><span>Related Pages</span></a></li> <li><a href="modules.html"><span>Modules</span></a></li> <li><a href="namespaces.html"><span>Namespaces</span></a></li> <li class="current"><a href="annotated.html"><span>Classes</span></a></li> <li><a href="files.html"><span>Files</span></a></li> <li> <div id="MSearchBox" class="MSearchBoxInactive"> <div class="left"> <form id="FSearchBox" action="search.php" method="get"> <img id="MSearchSelect" src="search/mag.png" alt=""/> <input type="text" id="MSearchField" name="query" value="Search" size="20" accesskey="S" onfocus="searchBox.OnSearchFieldFocus(true)" onblur="searchBox.OnSearchFieldFocus(false)"/> </form> </div><div class="right"></div> </div> </li> </ul> </div> <div id="navrow2" class="tabs2"> <ul class="tablist"> <li><a href="annotated.html"><span>Class List</span></a></li> <li><a href="classes.html"><span>Class Index</span></a></li> <li><a href="inherits.html"><span>Class Hierarchy</span></a></li> <li><a href="functions.html"><span>Class Members</span></a></li> </ul> </div> <div id="nav-path" class="navpath"> <ul> <li class="navelem"><a class="el" href="namespacemrpt.html">mrpt</a> </li> <li class="navelem"><a class="el" href="namespacemrpt_1_1math.html">math</a> </li> <li class="navelem"><a class="el" href="classmrpt_1_1math_1_1_c_sparse_matrix.html">CSparseMatrix</a> </li> <li class="navelem"><a class="el" href="classmrpt_1_1math_1_1_c_sparse_matrix_1_1_cholesky_decomp.html">CholeskyDecomp</a> </li> </ul> </div> </div> <div class="header"> <div class="summary"> <a href="#pub-methods">Public Member Functions</a> | <a href="#pri-attribs">Private Attributes</a> </div> <div class="headertitle"> <div class="title">mrpt::math::CSparseMatrix::CholeskyDecomp Class Reference</div> </div> </div> <div class="contents"> <!-- doxytag: class="mrpt::math::CSparseMatrix::CholeskyDecomp" --><!-- doxytag: inherits="mrpt::utils::CUncopiable" --><hr/><a name="details" id="details"></a><h2>Detailed Description</h2> <div class="textblock"><p>Auxiliary class to hold the results of a Cholesky factorization of a sparse matrix. </p> <p>Usage example: </p> <div class="fragment"><pre class="fragment"> <a class="code" href="classmrpt_1_1math_1_1_c_sparse_matrix.html#a5d836fcbf333fcd2e5fda9de14d4dad5" title="Create an initially empty sparse matrix, in the "triplet" form.">CSparseMatrix</a> SM(100,100); SM.insert_entry(i,j, val); ... SM.compressFromTriplet(); <span class="comment">// Do Cholesky decomposition:</span> <a class="code" href="classmrpt_1_1math_1_1_c_sparse_matrix.html#a5d836fcbf333fcd2e5fda9de14d4dad5" title="Create an initially empty sparse matrix, in the "triplet" form.">CSparseMatrix</a><a class="code" href="classmrpt_1_1math_1_1_c_sparse_matrix_1_1_cholesky_decomp.html#a200be8e54166dffb89bab6392b714177" title="Constructor from a square definite-positive sparse matrix A, which can be use to solve Ax=b The actua...">::CholeskyDecomp</a> CD(SM); CD.get_inverse(); ... </pre></div><dl class="note"><dt><b>Note:</b></dt><dd>Only the upper triangular part of the input matrix is accessed. </dd> <dd> This class was initially adapted from "robotvision", by Hauke Strasdat, Steven Lovegrove and Andrew J. Davison. See <a href="http://www.openslam.org/robotvision.html">http://www.openslam.org/robotvision.html</a> </dd> <dd> This class designed to be "uncopiable". </dd></dl> <dl class="see"><dt><b>See also:</b></dt><dd>The main class: <a class="el" href="classmrpt_1_1math_1_1_c_sparse_matrix.html" title="A sparse matrix capable of efficient math operations (a wrapper around the CSparse library) The type ...">CSparseMatrix</a> </dd></dl> </div> <p><code>#include <<a class="el" href="_c_sparse_matrix_8h_source.html">mrpt/math/CSparseMatrix.h</a>></code></p> <div class="dynheader"> Inheritance diagram for mrpt::math::CSparseMatrix::CholeskyDecomp:</div> <div class="dyncontent"> <div class="center"><img src="classmrpt_1_1math_1_1_c_sparse_matrix_1_1_cholesky_decomp__inherit__graph.png" border="0" usemap="#mrpt_1_1math_1_1_c_sparse_matrix_1_1_cholesky_decomp_inherit__map" alt="Inheritance graph"/></div> <map name="mrpt_1_1math_1_1_c_sparse_matrix_1_1_cholesky_decomp_inherit__map" id="mrpt_1_1math_1_1_c_sparse_matrix_1_1_cholesky_decomp_inherit__map"> <area shape="rect" id="node2" href="classmrpt_1_1utils_1_1_c_uncopiable.html" title="The base class of classes that cannot be copied: compile-time errors will be issued on any copy opera..." alt="" coords="69,5,232,32"/></map> <center><span class="legend">[<a href="graph_legend.html">legend</a>]</span></center></div> <p><a href="classmrpt_1_1math_1_1_c_sparse_matrix_1_1_cholesky_decomp-members.html">List of all members.</a></p> <table class="memberdecls"> <tr><td colspan="2"><h2><a name="pub-methods"></a> Public Member Functions</h2></td></tr> <tr><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classmrpt_1_1math_1_1_c_sparse_matrix_1_1_cholesky_decomp.html#a200be8e54166dffb89bab6392b714177">CholeskyDecomp</a> (const <a class="el" href="classmrpt_1_1math_1_1_c_sparse_matrix.html">CSparseMatrix</a> &A)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Constructor from a square definite-positive sparse matrix A, which can be use to solve Ax=b The actual Cholesky decomposition takes places in this constructor. <a href="#a200be8e54166dffb89bab6392b714177"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">virtual </td><td class="memItemRight" valign="bottom"><a class="el" href="classmrpt_1_1math_1_1_c_sparse_matrix_1_1_cholesky_decomp.html#a50c1e3a1edce68ea8a8e3c92cc9a191a">~CholeskyDecomp</a> ()</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Destructor. <a href="#a50c1e3a1edce68ea8a8e3c92cc9a191a"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="namespacemrpt_1_1math.html#a3814c2b868f059d6a7ab0d8ecd2311d6">CMatrixDouble</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classmrpt_1_1math_1_1_c_sparse_matrix_1_1_cholesky_decomp.html#a683ec672fe111c51f8077dfe91a02b5b">get_L</a> () const </td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Return the L matrix (L*L' = M), as a dense matrix. <a href="#a683ec672fe111c51f8077dfe91a02b5b"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classmrpt_1_1math_1_1_c_sparse_matrix_1_1_cholesky_decomp.html#a4e4ca44fbf5e057cbbe3550e0a2e7c41">get_L</a> (<a class="el" href="namespacemrpt_1_1math.html#a3814c2b868f059d6a7ab0d8ecd2311d6">CMatrixDouble</a> &out_L) const </td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Return the L matrix (L*L' = M), as a dense matrix. <a href="#a4e4ca44fbf5e057cbbe3550e0a2e7c41"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="namespacemrpt.html#a4a6aab2c98368ca6b554c04f8fe84cfb">mrpt::vector_double</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classmrpt_1_1math_1_1_c_sparse_matrix_1_1_cholesky_decomp.html#a68d1c1d3ac8e5636d61cf9ad6d6ef438">backsub</a> (const <a class="el" href="namespacemrpt.html#a4a6aab2c98368ca6b554c04f8fe84cfb">mrpt::vector_double</a> &b) const </td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Return the vector from a back-substitution step that solves: Ux=b. <a href="#a68d1c1d3ac8e5636d61cf9ad6d6ef438"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classmrpt_1_1math_1_1_c_sparse_matrix_1_1_cholesky_decomp.html#a353252658a5a501ade8cad7e7c03151f">backsub</a> (const <a class="el" href="namespacemrpt.html#a4a6aab2c98368ca6b554c04f8fe84cfb">mrpt::vector_double</a> &b, <a class="el" href="namespacemrpt.html#a4a6aab2c98368ca6b554c04f8fe84cfb">mrpt::vector_double</a> &result_x) const </td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Return the vector from a back-substitution step that solves: Ux=b. <a href="#a353252658a5a501ade8cad7e7c03151f"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classmrpt_1_1math_1_1_c_sparse_matrix_1_1_cholesky_decomp.html#a0089aca42cb44a486ebacf3d7834eb69">update</a> (const <a class="el" href="classmrpt_1_1math_1_1_c_sparse_matrix.html">CSparseMatrix</a> &new_SM)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Update the Cholesky factorization from an updated vesion of the original input, square definite-positive sparse matrix. <a href="#a0089aca42cb44a486ebacf3d7834eb69"></a><br/></td></tr> <tr><td colspan="2"><h2><a name="pri-attribs"></a> Private Attributes</h2></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="cs_8h.html#afdd66916fadd9fd39cd279717aa5c6b9">css</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classmrpt_1_1math_1_1_c_sparse_matrix_1_1_cholesky_decomp.html#a93f179dd287779e018e95829cf3a5c68">m_symbolic_structure</a></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="cs_8h.html#aa81f48a471a94557a00da42ceb21dc68">csn</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classmrpt_1_1math_1_1_c_sparse_matrix_1_1_cholesky_decomp.html#a38a4c14675e0045a800633651774b90d">m_numeric_structure</a></td></tr> <tr><td class="memItemLeft" align="right" valign="top">const <a class="el" href="classmrpt_1_1math_1_1_c_sparse_matrix.html">CSparseMatrix</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classmrpt_1_1math_1_1_c_sparse_matrix_1_1_cholesky_decomp.html#ac391e5c78a90a580d501f8141364d727">m_originalSM</a></td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">A const reference to the original matrix used to build this decomposition. <a href="#ac391e5c78a90a580d501f8141364d727"></a><br/></td></tr> </table> <hr/><h2>Constructor & Destructor Documentation</h2> <a class="anchor" id="a200be8e54166dffb89bab6392b714177"></a><!-- doxytag: member="mrpt::math::CSparseMatrix::CholeskyDecomp::CholeskyDecomp" ref="a200be8e54166dffb89bab6392b714177" args="(const CSparseMatrix &A)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">mrpt::math::CSparseMatrix::CholeskyDecomp::CholeskyDecomp </td> <td>(</td> <td class="paramtype">const <a class="el" href="classmrpt_1_1math_1_1_c_sparse_matrix.html">CSparseMatrix</a> & </td> <td class="paramname"><em>A</em></td><td>)</td> <td></td> </tr> </table> </div> <div class="memdoc"> <p>Constructor from a square definite-positive sparse matrix A, which can be use to solve Ax=b The actual Cholesky decomposition takes places in this constructor. </p> <dl class="note"><dt><b>Note:</b></dt><dd>Only the upper triangular part of the matrix is accessed. </dd></dl> <dl><dt><b>Exceptions:</b></dt><dd> <table class="exception"> <tr><td class="paramname"><a class="el" href="classstd_1_1runtime__error.html" title="STL class.">std::runtime_error</a></td><td>On non-square input matrix. </td></tr> <tr><td class="paramname"><a class="el" href="classmrpt_1_1math_1_1_c_exception_not_def_pos.html" title="Used in mrpt::math::CSparseMatrix.">mrpt::math::CExceptionNotDefPos</a></td><td>On non-definite-positive matrix as input. </td></tr> </table> </dd> </dl> </div> </div> <a class="anchor" id="a50c1e3a1edce68ea8a8e3c92cc9a191a"></a><!-- doxytag: member="mrpt::math::CSparseMatrix::CholeskyDecomp::~CholeskyDecomp" ref="a50c1e3a1edce68ea8a8e3c92cc9a191a" args="()" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">virtual mrpt::math::CSparseMatrix::CholeskyDecomp::~CholeskyDecomp </td> <td>(</td> <td class="paramname"></td><td>)</td> <td><code> [virtual]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Destructor. </p> </div> </div> <hr/><h2>Member Function Documentation</h2> <a class="anchor" id="a68d1c1d3ac8e5636d61cf9ad6d6ef438"></a><!-- doxytag: member="mrpt::math::CSparseMatrix::CholeskyDecomp::backsub" ref="a68d1c1d3ac8e5636d61cf9ad6d6ef438" args="(const mrpt::vector_double &b) const " --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="namespacemrpt.html#a4a6aab2c98368ca6b554c04f8fe84cfb">mrpt::vector_double</a> mrpt::math::CSparseMatrix::CholeskyDecomp::backsub </td> <td>(</td> <td class="paramtype">const <a class="el" href="namespacemrpt.html#a4a6aab2c98368ca6b554c04f8fe84cfb">mrpt::vector_double</a> & </td> <td class="paramname"><em>b</em></td><td>)</td> <td> const<code> [inline]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Return the vector from a back-substitution step that solves: Ux=b. </p> <p>Definition at line <a class="el" href="_c_sparse_matrix_8h_source.html#l00368">368</a> of file <a class="el" href="_c_sparse_matrix_8h_source.html">CSparseMatrix.h</a>.</p> <p>References <a class="el" href="_c_sparse_matrix_8h_source.html#l00368">backsub()</a>.</p> <p>Referenced by <a class="el" href="_c_sparse_matrix_8h_source.html#l00368">backsub()</a>.</p> </div> </div> <a class="anchor" id="a353252658a5a501ade8cad7e7c03151f"></a><!-- doxytag: member="mrpt::math::CSparseMatrix::CholeskyDecomp::backsub" ref="a353252658a5a501ade8cad7e7c03151f" args="(const mrpt::vector_double &b, mrpt::vector_double &result_x) const " --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void mrpt::math::CSparseMatrix::CholeskyDecomp::backsub </td> <td>(</td> <td class="paramtype">const <a class="el" href="namespacemrpt.html#a4a6aab2c98368ca6b554c04f8fe84cfb">mrpt::vector_double</a> & </td> <td class="paramname"><em>b</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"><a class="el" href="namespacemrpt.html#a4a6aab2c98368ca6b554c04f8fe84cfb">mrpt::vector_double</a> & </td> <td class="paramname"><em>result_x</em> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td> const</td> </tr> </table> </div> <div class="memdoc"> <p>Return the vector from a back-substitution step that solves: Ux=b. </p> </div> </div> <a class="anchor" id="a683ec672fe111c51f8077dfe91a02b5b"></a><!-- doxytag: member="mrpt::math::CSparseMatrix::CholeskyDecomp::get_L" ref="a683ec672fe111c51f8077dfe91a02b5b" args="() const " --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="namespacemrpt_1_1math.html#a3814c2b868f059d6a7ab0d8ecd2311d6">CMatrixDouble</a> mrpt::math::CSparseMatrix::CholeskyDecomp::get_L </td> <td>(</td> <td class="paramname"></td><td>)</td> <td> const<code> [inline]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Return the L matrix (L*L' = M), as a dense matrix. </p> <p>Definition at line <a class="el" href="_c_sparse_matrix_8h_source.html#l00362">362</a> of file <a class="el" href="_c_sparse_matrix_8h_source.html">CSparseMatrix.h</a>.</p> <p>References <a class="el" href="_c_sparse_matrix_8h_source.html#l00362">get_L()</a>.</p> <p>Referenced by <a class="el" href="_c_sparse_matrix_8h_source.html#l00362">get_L()</a>.</p> </div> </div> <a class="anchor" id="a4e4ca44fbf5e057cbbe3550e0a2e7c41"></a><!-- doxytag: member="mrpt::math::CSparseMatrix::CholeskyDecomp::get_L" ref="a4e4ca44fbf5e057cbbe3550e0a2e7c41" args="(CMatrixDouble &out_L) const " --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void mrpt::math::CSparseMatrix::CholeskyDecomp::get_L </td> <td>(</td> <td class="paramtype"><a class="el" href="namespacemrpt_1_1math.html#a3814c2b868f059d6a7ab0d8ecd2311d6">CMatrixDouble</a> & </td> <td class="paramname"><em>out_L</em></td><td>)</td> <td> const</td> </tr> </table> </div> <div class="memdoc"> <p>Return the L matrix (L*L' = M), as a dense matrix. </p> </div> </div> <a class="anchor" id="a0089aca42cb44a486ebacf3d7834eb69"></a><!-- doxytag: member="mrpt::math::CSparseMatrix::CholeskyDecomp::update" ref="a0089aca42cb44a486ebacf3d7834eb69" args="(const CSparseMatrix &new_SM)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void mrpt::math::CSparseMatrix::CholeskyDecomp::update </td> <td>(</td> <td class="paramtype">const <a class="el" href="classmrpt_1_1math_1_1_c_sparse_matrix.html">CSparseMatrix</a> & </td> <td class="paramname"><em>new_SM</em></td><td>)</td> <td></td> </tr> </table> </div> <div class="memdoc"> <p>Update the Cholesky factorization from an updated vesion of the original input, square definite-positive sparse matrix. </p> <p>NOTE: This new matrix MUST HAVE exactly the same sparse structure than the original one. </p> </div> </div> <hr/><h2>Member Data Documentation</h2> <a class="anchor" id="a38a4c14675e0045a800633651774b90d"></a><!-- doxytag: member="mrpt::math::CSparseMatrix::CholeskyDecomp::m_numeric_structure" ref="a38a4c14675e0045a800633651774b90d" args="" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="cs_8h.html#aa81f48a471a94557a00da42ceb21dc68">csn</a>* <a class="el" href="classmrpt_1_1math_1_1_c_sparse_matrix_1_1_cholesky_decomp.html#a38a4c14675e0045a800633651774b90d">mrpt::math::CSparseMatrix::CholeskyDecomp::m_numeric_structure</a><code> [private]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Definition at line <a class="el" href="_c_sparse_matrix_8h_source.html#l00346">346</a> of file <a class="el" href="_c_sparse_matrix_8h_source.html">CSparseMatrix.h</a>.</p> </div> </div> <a class="anchor" id="ac391e5c78a90a580d501f8141364d727"></a><!-- doxytag: member="mrpt::math::CSparseMatrix::CholeskyDecomp::m_originalSM" ref="ac391e5c78a90a580d501f8141364d727" args="" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">const <a class="el" href="classmrpt_1_1math_1_1_c_sparse_matrix.html">CSparseMatrix</a>* <a class="el" href="classmrpt_1_1math_1_1_c_sparse_matrix_1_1_cholesky_decomp.html#ac391e5c78a90a580d501f8141364d727">mrpt::math::CSparseMatrix::CholeskyDecomp::m_originalSM</a><code> [private]</code></td> </tr> </table> </div> <div class="memdoc"> <p>A const reference to the original matrix used to build this decomposition. </p> <p>Definition at line <a class="el" href="_c_sparse_matrix_8h_source.html#l00347">347</a> of file <a class="el" href="_c_sparse_matrix_8h_source.html">CSparseMatrix.h</a>.</p> </div> </div> <a class="anchor" id="a93f179dd287779e018e95829cf3a5c68"></a><!-- doxytag: member="mrpt::math::CSparseMatrix::CholeskyDecomp::m_symbolic_structure" ref="a93f179dd287779e018e95829cf3a5c68" args="" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="cs_8h.html#afdd66916fadd9fd39cd279717aa5c6b9">css</a>* <a class="el" href="classmrpt_1_1math_1_1_c_sparse_matrix_1_1_cholesky_decomp.html#a93f179dd287779e018e95829cf3a5c68">mrpt::math::CSparseMatrix::CholeskyDecomp::m_symbolic_structure</a><code> [private]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Definition at line <a class="el" href="_c_sparse_matrix_8h_source.html#l00345">345</a> of file <a class="el" href="_c_sparse_matrix_8h_source.html">CSparseMatrix.h</a>.</p> </div> </div> </div> <br><hr><br> <table border="0" width="100%"> <tr> <td> Page generated by <a href="http://www.doxygen.org" target="_blank">Doxygen 1.7.5</a> for MRPT 0.9.5 SVN: at Sun Sep 25 17:20:18 UTC 2011</td><td></td> <td width="100"> </td> <td width="150"> </td></tr> </table> </body></html>