Sophie

Sophie

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

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>Interpolation, least-squares fit, splines</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><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>
<div class="header">
  <div class="summary">
<a href="#nested-classes">Classes</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">Interpolation, least-squares fit, splines</div>  </div>
<div class="ingroups"><a class="el" href="group__mrpt__base__grp.html">[mrpt-base]</a></div></div>
<div class="contents">
<div class="dynheader">
Collaboration diagram for Interpolation, least-squares fit, splines:</div>
<div class="dyncontent">
<center><table><tr><td><img src="group__interpolation__grp.png" border="0" alt="" usemap="#group____interpolation____grp"/>
<map name="group____interpolation____grp" id="group____interpolation____grp">
<area shape="rect" id="node3" href="group__poses__grp.html" title="2D/3D points and poses" alt="" coords="635,7,797,33"/><area shape="rect" id="node2" href="group__mrpt__base__grp.html" title=" Back to list of all libraries | See all modules &#160;&#160;" alt="" coords="5,7,93,33"/></map>
</td></tr></table></center>
</div>
<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">class &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmrpt_1_1math_1_1_c_spline_interpolator1_d.html">mrpt::math::CSplineInterpolator1D</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">A (persistent) sequence of (x,y) coordinates, allowing queries of intermediate points through spline interpolation, where possible.  <a href="classmrpt_1_1math_1_1_c_spline_interpolator1_d.html#details">More...</a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">class &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmrpt_1_1poses_1_1_c_pose3_d_interpolator.html">mrpt::poses::CPose3DInterpolator</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">A trajectory in time and in 6D (<a class="el" href="classmrpt_1_1poses_1_1_c_pose3_d.html" title="A class used to store a 3D pose (a 3D translation + a rotation in 3D).">CPose3D</a>) that interpolates using splines the intervals between a set of given time-referenced poses.  <a href="classmrpt_1_1poses_1_1_c_pose3_d_interpolator.html#details">More...</a><br/></td></tr>
<tr><td colspan="2"><h2><a name="func-members"></a>
Functions</h2></td></tr>
<tr><td class="memTemplParams" colspan="2">template&lt;class T , class VECTOR &gt; </td></tr>
<tr><td class="memTemplItemLeft" align="right" valign="top">T&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="group__interpolation__grp.html#gaeb1c0badda6737f8362ce902e10961dc">mrpt::math::interpolate</a> (const T &amp;x, const VECTOR &amp;ys, const T &amp;x0, const T &amp;x1)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Interpolate a data sequence "ys" ranging from "x0" to "x1" (equally spaced), to obtain the approximation of the sequence at the point "x".  <a href="#gaeb1c0badda6737f8362ce902e10961dc"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">double BASE_IMPEXP&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__interpolation__grp.html#ga199ae09bf97644048fe53590964abd1b">mrpt::math::interpolate2points</a> (const double x, const double x0, const double y0, const double x1, const double y1, bool wrap2pi=false)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Linear interpolation/extrapolation: evaluates at "x" the line (x0,y0)-(x1,y1).  <a href="#ga199ae09bf97644048fe53590964abd1b"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">double BASE_IMPEXP&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__interpolation__grp.html#gadab1f3df3e592268d89214b345f7f816">mrpt::math::spline</a> (const double t, const vector_double &amp;x, const vector_double &amp;y, bool wrap2pi=false)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Interpolates the value of a function in a point "t" given 4 SORTED points where "t" is between the two middle points If wrap2pi is true, output "y" values are wrapped to ]-pi,pi] (It is assumed that input "y" values already are in the correct range).  <a href="#gadab1f3df3e592268d89214b345f7f816"></a><br/></td></tr>
<tr><td class="memTemplParams" colspan="2">template&lt;typename NUMTYPE , class VECTORLIKE &gt; </td></tr>
<tr><td class="memTemplItemLeft" align="right" valign="top">NUMTYPE&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="group__interpolation__grp.html#ga1e31a6d4b982eee16bab9ae66c0ee042">mrpt::math::leastSquareLinearFit</a> (const NUMTYPE t, const VECTORLIKE &amp;x, const VECTORLIKE &amp;y, bool wrap2pi=false)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Interpolates or extrapolates using a least-square linear fit of the set of values "x" and "y", evaluated at a single point "t".  <a href="#ga1e31a6d4b982eee16bab9ae66c0ee042"></a><br/></td></tr>
<tr><td class="memTemplParams" colspan="2">template&lt;class VECTORLIKE1 , class VECTORLIKE2 , class VECTORLIKE3 &gt; </td></tr>
<tr><td class="memTemplItemLeft" align="right" valign="top">void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="group__interpolation__grp.html#ga4939a6f537e90519df7149c550ed71c8">mrpt::math::leastSquareLinearFit</a> (const VECTORLIKE1 &amp;ts, VECTORLIKE2 &amp;outs, const VECTORLIKE3 &amp;x, const VECTORLIKE3 &amp;y, bool wrap2pi=false)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Interpolates or extrapolates using a least-square linear fit of the set of values "x" and "y", evaluated at a sequence of points "ts" and returned at "outs".  <a href="#ga4939a6f537e90519df7149c550ed71c8"></a><br/></td></tr>
</table>
<hr/><h2>Function Documentation</h2>
<a class="anchor" id="gaeb1c0badda6737f8362ce902e10961dc"></a><!-- doxytag: member="mrpt::math::interpolate" ref="gaeb1c0badda6737f8362ce902e10961dc" args="(const T &amp;x, const VECTOR &amp;ys, const T &amp;x0, const T &amp;x1)" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class T , class VECTOR &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">T mrpt::math::interpolate </td>
          <td>(</td>
          <td class="paramtype">const T &amp;&#160;</td>
          <td class="paramname"><em>x</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const VECTOR &amp;&#160;</td>
          <td class="paramname"><em>ys</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const T &amp;&#160;</td>
          <td class="paramname"><em>x0</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const T &amp;&#160;</td>
          <td class="paramname"><em>x1</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Interpolate a data sequence "ys" ranging from "x0" to "x1" (equally spaced), to obtain the approximation of the sequence at the point "x". </p>
<p>If the point "x" is out of the range [x0,x1], the closest extreme "ys" value is returned. </p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="group__interpolation__grp.html#gadab1f3df3e592268d89214b345f7f816" title="Interpolates the value of a function in a point &quot;t&quot; given 4 SORTED points where &quot;t&quot; is between the tw...">spline</a>, <a class="el" href="group__interpolation__grp.html#ga199ae09bf97644048fe53590964abd1b" title="Linear interpolation/extrapolation: evaluates at &quot;x&quot; the line (x0,y0)-(x1,y1).">interpolate2points</a> </dd></dl>

<p>Definition at line <a class="el" href="base_2include_2mrpt_2math_2utils_8h_source.html#l01046">1046</a> of file <a class="el" href="base_2include_2mrpt_2math_2utils_8h_source.html">base/include/mrpt/math/utils.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>, and <a class="el" href="mrpt__macros_8h_source.html#l00374">MRPT_END</a>.</p>

</div>
</div>
<a class="anchor" id="ga199ae09bf97644048fe53590964abd1b"></a><!-- doxytag: member="mrpt::math::interpolate2points" ref="ga199ae09bf97644048fe53590964abd1b" args="(const double x, const double x0, const double y0, const double x1, const double y1, bool wrap2pi=false)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">double BASE_IMPEXP mrpt::math::interpolate2points </td>
          <td>(</td>
          <td class="paramtype">const double&#160;</td>
          <td class="paramname"><em>x</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const double&#160;</td>
          <td class="paramname"><em>x0</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const double&#160;</td>
          <td class="paramname"><em>y0</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const double&#160;</td>
          <td class="paramname"><em>x1</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const double&#160;</td>
          <td class="paramname"><em>y1</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>wrap2pi</em> = <code>false</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Linear interpolation/extrapolation: evaluates at "x" the line (x0,y0)-(x1,y1). </p>
<p>If wrap2pi is true, output is wrapped to ]-pi,pi] (It is assumed that input "y" values already are in the correct range). </p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="group__interpolation__grp.html#gadab1f3df3e592268d89214b345f7f816" title="Interpolates the value of a function in a point &quot;t&quot; given 4 SORTED points where &quot;t&quot; is between the tw...">spline</a>, <a class="el" href="group__interpolation__grp.html#gaeb1c0badda6737f8362ce902e10961dc" title="Interpolate a data sequence &quot;ys&quot; ranging from &quot;x0&quot; to &quot;x1&quot; (equally spaced), to obtain the approximat...">interpolate</a>, <a class="el" href="group__interpolation__grp.html#ga1e31a6d4b982eee16bab9ae66c0ee042" title="Interpolates or extrapolates using a least-square linear fit of the set of values &quot;x&quot; and &quot;y&quot;...">leastSquareLinearFit</a> </dd></dl>

</div>
</div>
<a class="anchor" id="ga1e31a6d4b982eee16bab9ae66c0ee042"></a><!-- doxytag: member="mrpt::math::leastSquareLinearFit" ref="ga1e31a6d4b982eee16bab9ae66c0ee042" args="(const NUMTYPE t, const VECTORLIKE &amp;x, const VECTORLIKE &amp;y, bool wrap2pi=false)" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename NUMTYPE , class VECTORLIKE &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">NUMTYPE mrpt::math::leastSquareLinearFit </td>
          <td>(</td>
          <td class="paramtype">const NUMTYPE&#160;</td>
          <td class="paramname"><em>t</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const VECTORLIKE &amp;&#160;</td>
          <td class="paramname"><em>x</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const VECTORLIKE &amp;&#160;</td>
          <td class="paramname"><em>y</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>wrap2pi</em> = <code>false</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Interpolates or extrapolates using a least-square linear fit of the set of values "x" and "y", evaluated at a single point "t". </p>
<p>The vectors x and y must have size &gt;=2, and all values of "x" must be different. If wrap2pi is true, output "y" values are wrapped to ]-pi,pi] (It is assumed that input "y" values already are in the correct range). </p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="group__interpolation__grp.html#gadab1f3df3e592268d89214b345f7f816" title="Interpolates the value of a function in a point &quot;t&quot; given 4 SORTED points where &quot;t&quot; is between the tw...">spline</a> </dd>
<dd>
<a class="el" href="group__geometry__grp.html#ga7c40628072431c08a126bef3bb2b9a27" title="Using eigenvalues, gets the best fitting line for a set of 2D points.">getRegressionLine</a>, <a class="el" href="group__geometry__grp.html#ga14d21b4e5b6277e7c0ea4f00b2eb2b3e" title="Using eigenvalues, gets the best fitting plane for a set of 3D points.">getRegressionPlane</a> </dd></dl>

<p>Definition at line <a class="el" href="base_2include_2mrpt_2math_2utils_8h_source.html#l01084">1084</a> of file <a class="el" href="base_2include_2mrpt_2math_2utils_8h_source.html">base/include/mrpt/math/utils.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#l00188">mrpt::math::wrapToPi()</a>, and <a class="el" href="mrpt__macros_8h_source.html#l00374">MRPT_END</a>.</p>

</div>
</div>
<a class="anchor" id="ga4939a6f537e90519df7149c550ed71c8"></a><!-- doxytag: member="mrpt::math::leastSquareLinearFit" ref="ga4939a6f537e90519df7149c550ed71c8" args="(const VECTORLIKE1 &amp;ts, VECTORLIKE2 &amp;outs, const VECTORLIKE3 &amp;x, const VECTORLIKE3 &amp;y, bool wrap2pi=false)" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class VECTORLIKE1 , class VECTORLIKE2 , class VECTORLIKE3 &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">void mrpt::math::leastSquareLinearFit </td>
          <td>(</td>
          <td class="paramtype">const VECTORLIKE1 &amp;&#160;</td>
          <td class="paramname"><em>ts</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">VECTORLIKE2 &amp;&#160;</td>
          <td class="paramname"><em>outs</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const VECTORLIKE3 &amp;&#160;</td>
          <td class="paramname"><em>x</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const VECTORLIKE3 &amp;&#160;</td>
          <td class="paramname"><em>y</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>wrap2pi</em> = <code>false</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Interpolates or extrapolates using a least-square linear fit of the set of values "x" and "y", evaluated at a sequence of points "ts" and returned at "outs". </p>
<p>If wrap2pi is true, output "y" values are wrapped to ]-pi,pi] (It is assumed that input "y" values already are in the correct range). </p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="group__interpolation__grp.html#gadab1f3df3e592268d89214b345f7f816" title="Interpolates the value of a function in a point &quot;t&quot; given 4 SORTED points where &quot;t&quot; is between the tw...">spline</a>, <a class="el" href="group__geometry__grp.html#ga7c40628072431c08a126bef3bb2b9a27" title="Using eigenvalues, gets the best fitting line for a set of 2D points.">getRegressionLine</a>, <a class="el" href="group__geometry__grp.html#ga14d21b4e5b6277e7c0ea4f00b2eb2b3e" title="Using eigenvalues, gets the best fitting plane for a set of 3D points.">getRegressionPlane</a> </dd></dl>

<p>Definition at line <a class="el" href="base_2include_2mrpt_2math_2utils_8h_source.html#l01134">1134</a> of file <a class="el" href="base_2include_2mrpt_2math_2utils_8h_source.html">base/include/mrpt/math/utils.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#l00188">mrpt::math::wrapToPi()</a>, and <a class="el" href="mrpt__macros_8h_source.html#l00374">MRPT_END</a>.</p>

</div>
</div>
<a class="anchor" id="gadab1f3df3e592268d89214b345f7f816"></a><!-- doxytag: member="mrpt::math::spline" ref="gadab1f3df3e592268d89214b345f7f816" args="(const double t, const vector_double &amp;x, const vector_double &amp;y, bool wrap2pi=false)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">double BASE_IMPEXP mrpt::math::spline </td>
          <td>(</td>
          <td class="paramtype">const double&#160;</td>
          <td class="paramname"><em>t</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const vector_double &amp;&#160;</td>
          <td class="paramname"><em>x</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const vector_double &amp;&#160;</td>
          <td class="paramname"><em>y</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>wrap2pi</em> = <code>false</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Interpolates the value of a function in a point "t" given 4 SORTED points where "t" is between the two middle points If wrap2pi is true, output "y" values are wrapped to ]-pi,pi] (It is assumed that input "y" values already are in the correct range). </p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="group__interpolation__grp.html#ga1e31a6d4b982eee16bab9ae66c0ee042" title="Interpolates or extrapolates using a least-square linear fit of the set of values &quot;x&quot; and &quot;y&quot;...">leastSquareLinearFit</a> </dd></dl>

</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>