Sophie

Sophie

distrib > Fedora > 16 > i386 > by-pkgid > 4bc66056a634db26a1f4d0845dc41ca6 > files > 4253

mrpt-doc-0.9.5-0.1.20110925svn2670.fc16.i686.rpm

<!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::CLevenbergMarquardtTempl 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> &gt; <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&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;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&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="inherits.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;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_levenberg_marquardt_templ.html">CLevenbergMarquardtTempl</a>      </li>
    </ul>
  </div>
</div>
<div class="header">
  <div class="summary">
<a href="#nested-classes">Classes</a> &#124;
<a href="#pub-types">Public Types</a> &#124;
<a href="#pub-static-methods">Static Public Member Functions</a>  </div>
  <div class="headertitle">
<div class="title">mrpt::math::CLevenbergMarquardtTempl Class Reference<div class="ingroups"><a class="el" href="group__mrpt__base__grp.html">[mrpt-base]</a></div></div>  </div>
</div>
<div class="contents">
<!-- doxytag: class="mrpt::math::CLevenbergMarquardtTempl" --><!-- doxytag: inherits="mrpt::utils::CDebugOutputCapable" --><hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><p>An implementation of the Levenberg-Marquardt algorithm for least-square minimization. </p>
<p>Refer to this <a href="http://www.mrpt.org/Levenberg%E2%80%93Marquardt_algorithm">page</a> for more details on the algorithm and its usage.</p>
<dl><dt><b>Template Parameters:</b></dt><dd>
  <table class="">
    <tr><td class="paramname">NUMTYPE</td><td>The numeric type for all the operations (float, double, or long double) </td></tr>
    <tr><td class="paramname">USERPARAM</td><td>The type of the "y" input to the user supplied evaluation functor. Default type is a vector of NUMTYPE. </td></tr>
  </table>
  </dd>
</dl>
</div>
<p><code>#include &lt;<a class="el" href="_c_levenberg_marquardt_8h_source.html">mrpt/math/CLevenbergMarquardt.h</a>&gt;</code></p>
<div class="dynheader">
Inheritance diagram for mrpt::math::CLevenbergMarquardtTempl:</div>
<div class="dyncontent">
<div class="center"><img src="classmrpt_1_1math_1_1_c_levenberg_marquardt_templ__inherit__graph.png" border="0" usemap="#mrpt_1_1math_1_1_c_levenberg_marquardt_templ_inherit__map" alt="Inheritance graph"/></div>
<map name="mrpt_1_1math_1_1_c_levenberg_marquardt_templ_inherit__map" id="mrpt_1_1math_1_1_c_levenberg_marquardt_templ_inherit__map">
<area shape="rect" id="node2" href="classmrpt_1_1utils_1_1_c_debug_output_capable.html" title="This base class provides a common printf&#45;like method to send debug information to std::cout..." alt="" coords="22,5,244,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_levenberg_marquardt_templ-members.html">List of all members.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="nested-classes"></a>
Classes</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structmrpt_1_1math_1_1_c_levenberg_marquardt_templ_1_1_t_result_info.html">TResultInfo</a></td></tr>
<tr><td colspan="2"><h2><a name="pub-types"></a>
Public Types</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">typedef <a class="el" href="eigen__plugins_8h.html#afd07186978da46f9908364e389f8a403">VECTORTYPE::value_type</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmrpt_1_1math_1_1_c_levenberg_marquardt_templ.html#aa1a845f3fb7ddebb03b619511751fc9b">NUMTYPE</a></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">typedef void(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmrpt_1_1math_1_1_c_levenberg_marquardt_templ.html#af1417a100aac50f016fcbd86455172fd">TFunctorEval</a> )(const VECTORTYPE &amp;x, const USERPARAM &amp;y, VECTORTYPE &amp;out)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">The type of the function passed to execute.  <a href="#af1417a100aac50f016fcbd86455172fd"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">typedef void(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmrpt_1_1math_1_1_c_levenberg_marquardt_templ.html#ac116d455d54d9d260f78be3264c1cf0e">TFunctorIncrement</a> )(VECTORTYPE &amp;x_new, const VECTORTYPE &amp;x_old, const VECTORTYPE &amp;x_incr, const USERPARAM &amp;user_param)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">The type of an optional functor passed to <em>execute</em> to replace the Euclidean addition "x_new = x_old + x_incr" by any other operation.  <a href="#ac116d455d54d9d260f78be3264c1cf0e"></a><br/></td></tr>
<tr><td colspan="2"><h2><a name="pub-static-methods"></a>
Static Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmrpt_1_1math_1_1_c_levenberg_marquardt_templ.html#a0d648bdc68df4a0fcd5d4e3438a0c3b2">execute</a> (VECTORTYPE &amp;out_optimal_x, const VECTORTYPE &amp;x0, <a class="el" href="classmrpt_1_1math_1_1_c_levenberg_marquardt_templ.html#af1417a100aac50f016fcbd86455172fd">TFunctorEval</a> functor, const VECTORTYPE &amp;increments, const USERPARAM &amp;userParam, <a class="el" href="structmrpt_1_1math_1_1_c_levenberg_marquardt_templ_1_1_t_result_info.html">TResultInfo</a> &amp;out_info, bool verbose=false, const size_t maxIter=200, const <a class="el" href="classmrpt_1_1math_1_1_c_levenberg_marquardt_templ.html#aa1a845f3fb7ddebb03b619511751fc9b">NUMTYPE</a> tau=1e-3, const NUMTYPE e1=1e-8, const NUMTYPE e2=1e-8, bool returnPath=true, TFunctorIncrement x_increment_adder=NULL)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Executes the LM-method, with derivatives estimated from <em>functor</em> is a user-provided function which takes as input two vectors, in this order:  <a href="#a0d648bdc68df4a0fcd5d4e3438a0c3b2"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmrpt_1_1utils_1_1_c_debug_output_capable.html#ab78281b5d70d6e295a8527a10fea66de">printf_debug</a> (const char *frmt,...)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Sends a formated text to "debugOut" if not NULL, or to cout otherwise.  <a href="#ab78281b5d70d6e295a8527a10fea66de"></a><br/></td></tr>
</table>
<hr/><h2>Member Typedef Documentation</h2>
<a class="anchor" id="aa1a845f3fb7ddebb03b619511751fc9b"></a><!-- doxytag: member="mrpt::math::CLevenbergMarquardtTempl::NUMTYPE" ref="aa1a845f3fb7ddebb03b619511751fc9b" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">typedef <a class="el" href="eigen__plugins_8h.html#afd07186978da46f9908364e389f8a403">VECTORTYPE::value_type</a> <a class="el" href="classmrpt_1_1math_1_1_c_levenberg_marquardt_templ.html#aa1a845f3fb7ddebb03b619511751fc9b">mrpt::math::CLevenbergMarquardtTempl::NUMTYPE</a></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Definition at line <a class="el" href="_c_levenberg_marquardt_8h_source.html#l00054">54</a> of file <a class="el" href="_c_levenberg_marquardt_8h_source.html">CLevenbergMarquardt.h</a>.</p>

</div>
</div>
<a class="anchor" id="af1417a100aac50f016fcbd86455172fd"></a><!-- doxytag: member="mrpt::math::CLevenbergMarquardtTempl::TFunctorEval" ref="af1417a100aac50f016fcbd86455172fd" args=")(const VECTORTYPE &amp;x, const USERPARAM &amp;y, VECTORTYPE &amp;out)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">typedef void(* <a class="el" href="classmrpt_1_1math_1_1_c_levenberg_marquardt_templ.html#af1417a100aac50f016fcbd86455172fd">mrpt::math::CLevenbergMarquardtTempl::TFunctorEval</a>)(const VECTORTYPE &amp;x, const USERPARAM &amp;y, VECTORTYPE &amp;out)</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>The type of the function passed to execute. </p>
<p>The user must supply a function which evaluates the error of a given point in the solution space. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">x</td><td>The state point under examination. </td></tr>
    <tr><td class="paramname">y</td><td>The same object passed to "execute" as the parameter "userParam". </td></tr>
    <tr><td class="paramname">out</td><td>The vector of (non-squared) errors, of the average square root error, for the given "x". The functor code must set the size of this vector. </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="_c_levenberg_marquardt_8h_source.html#l00062">62</a> of file <a class="el" href="_c_levenberg_marquardt_8h_source.html">CLevenbergMarquardt.h</a>.</p>

</div>
</div>
<a class="anchor" id="ac116d455d54d9d260f78be3264c1cf0e"></a><!-- doxytag: member="mrpt::math::CLevenbergMarquardtTempl::TFunctorIncrement" ref="ac116d455d54d9d260f78be3264c1cf0e" args=")(VECTORTYPE &amp;x_new, const VECTORTYPE &amp;x_old, const VECTORTYPE &amp;x_incr, const USERPARAM &amp;user_param)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">typedef void(* <a class="el" href="classmrpt_1_1math_1_1_c_levenberg_marquardt_templ.html#ac116d455d54d9d260f78be3264c1cf0e">mrpt::math::CLevenbergMarquardtTempl::TFunctorIncrement</a>)(VECTORTYPE &amp;x_new, const VECTORTYPE &amp;x_old, const VECTORTYPE &amp;x_incr, const USERPARAM &amp;user_param)</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>The type of an optional functor passed to <em>execute</em> to replace the Euclidean addition "x_new = x_old + x_incr" by any other operation. </p>

<p>Definition at line <a class="el" href="_c_levenberg_marquardt_8h_source.html#l00069">69</a> of file <a class="el" href="_c_levenberg_marquardt_8h_source.html">CLevenbergMarquardt.h</a>.</p>

</div>
</div>
<hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="a0d648bdc68df4a0fcd5d4e3438a0c3b2"></a><!-- doxytag: member="mrpt::math::CLevenbergMarquardtTempl::execute" ref="a0d648bdc68df4a0fcd5d4e3438a0c3b2" args="(VECTORTYPE &amp;out_optimal_x, const VECTORTYPE &amp;x0, TFunctorEval functor, const VECTORTYPE &amp;increments, const USERPARAM &amp;userParam, TResultInfo &amp;out_info, bool verbose=false, const size_t maxIter=200, const NUMTYPE tau=1e&#45;3, const NUMTYPE e1=1e&#45;8, const NUMTYPE e2=1e&#45;8, bool returnPath=true, TFunctorIncrement x_increment_adder=NULL)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">static void mrpt::math::CLevenbergMarquardtTempl::execute </td>
          <td>(</td>
          <td class="paramtype">VECTORTYPE &amp;&#160;</td>
          <td class="paramname"><em>out_optimal_x</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const VECTORTYPE &amp;&#160;</td>
          <td class="paramname"><em>x0</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="classmrpt_1_1math_1_1_c_levenberg_marquardt_templ.html#af1417a100aac50f016fcbd86455172fd">TFunctorEval</a>&#160;</td>
          <td class="paramname"><em>functor</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const VECTORTYPE &amp;&#160;</td>
          <td class="paramname"><em>increments</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const USERPARAM &amp;&#160;</td>
          <td class="paramname"><em>userParam</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structmrpt_1_1math_1_1_c_levenberg_marquardt_templ_1_1_t_result_info.html">TResultInfo</a> &amp;&#160;</td>
          <td class="paramname"><em>out_info</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>verbose</em> = <code>false</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const size_t&#160;</td>
          <td class="paramname"><em>maxIter</em> = <code>200</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="classmrpt_1_1math_1_1_c_levenberg_marquardt_templ.html#aa1a845f3fb7ddebb03b619511751fc9b">NUMTYPE</a>&#160;</td>
          <td class="paramname"><em>tau</em> = <code>1e-3</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="classmrpt_1_1math_1_1_c_levenberg_marquardt_templ.html#aa1a845f3fb7ddebb03b619511751fc9b">NUMTYPE</a>&#160;</td>
          <td class="paramname"><em>e1</em> = <code>1e-8</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="classmrpt_1_1math_1_1_c_levenberg_marquardt_templ.html#aa1a845f3fb7ddebb03b619511751fc9b">NUMTYPE</a>&#160;</td>
          <td class="paramname"><em>e2</em> = <code>1e-8</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>returnPath</em> = <code>true</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="classmrpt_1_1math_1_1_c_levenberg_marquardt_templ.html#ac116d455d54d9d260f78be3264c1cf0e">TFunctorIncrement</a>&#160;</td>
          <td class="paramname"><em>x_increment_adder</em> = <code>NULL</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [inline, static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Executes the LM-method, with derivatives estimated from <em>functor</em> is a user-provided function which takes as input two vectors, in this order: </p>
<ul>
<li>x: The parameters to be optimized.</li>
<li>userParam: The vector passed to the LM algorithm, unmodified. and must return the "error vector", or the error (not squared) in each measured dimension, so the sum of the square of that output is the overall square error.</li>
</ul>
<p><em>x_increment_adder</em> Is an optional functor which may replace the Euclidean "x_new = x + x_increment" at the core of the incremental optimizer by any other operation. It can be used for example, in on-manifold optimizations. </p>

<p>Definition at line <a class="el" href="_c_levenberg_marquardt_8h_source.html#l00098">98</a> of file <a class="el" href="_c_levenberg_marquardt_8h_source.html">CLevenbergMarquardt.h</a>.</p>

<p>References <a class="el" href="mrpt__macros_8h_source.html#l00370">MRPT_START</a>, <a class="el" href="mrpt__macros_8h_source.html#l00282">ASSERT_</a>, <a class="el" href="base_2include_2mrpt_2math_2utils_8h_source.html#l00710">mrpt::math::estimateJacobian()</a>, <a class="el" href="ops__containers_8h_source.html#l00114">mrpt::math::norm_inf()</a>, <a class="el" href="classmrpt_1_1utils_1_1_c_debug_output_capable.html#ab78281b5d70d6e295a8527a10fea66de">mrpt::utils::CDebugOutputCapable::printf_debug()</a>, <a class="el" href="ops__containers_8h_source.html#l00115">mrpt::math::norm()</a>, <a class="el" href="_c_levenberg_marquardt_8h_source.html#l00080">mrpt::math::CLevenbergMarquardtTempl::TResultInfo::path</a>, <a class="el" href="namespacemrpt.html#a3a27af794b658df5491e2b7678f8ccb8">mrpt::format()</a>, <a class="el" href="stl__extensions_8h_source.html#l00233">mrpt::utils::sprintf_vector()</a>, <a class="el" href="_c_levenberg_marquardt_8h_source.html#l00077">mrpt::math::CLevenbergMarquardtTempl::TResultInfo::final_sqr_err</a>, <a class="el" href="_c_levenberg_marquardt_8h_source.html#l00078">mrpt::math::CLevenbergMarquardtTempl::TResultInfo::iterations_executed</a>, <a class="el" href="_c_levenberg_marquardt_8h_source.html#l00079">mrpt::math::CLevenbergMarquardtTempl::TResultInfo::last_err_vector</a>, and <a class="el" href="mrpt__macros_8h_source.html#l00374">MRPT_END</a>.</p>

</div>
</div>
<a class="anchor" id="ab78281b5d70d6e295a8527a10fea66de"></a><!-- doxytag: member="mrpt::math::CLevenbergMarquardtTempl::printf_debug" ref="ab78281b5d70d6e295a8527a10fea66de" args="(const char *frmt,...)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">static void mrpt::utils::CDebugOutputCapable::printf_debug </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>frmt</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>...</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [static, inherited]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Sends a formated text to "debugOut" if not NULL, or to cout otherwise. </p>

<p>Referenced by <a class="el" href="_c_levenberg_marquardt_8h_source.html#l00098">execute()</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>