Sophie

Sophie

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

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::bayes::CRejectionSamplingCapable 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_1bayes.html">bayes</a>      </li>
      <li class="navelem"><a class="el" href="classmrpt_1_1bayes_1_1_c_rejection_sampling_capable.html">CRejectionSamplingCapable</a>      </li>
    </ul>
  </div>
</div>
<div class="header">
  <div class="summary">
<a href="#pub-types">Public Types</a> &#124;
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pro-methods">Protected Member Functions</a>  </div>
  <div class="headertitle">
<div class="title">mrpt::bayes::CRejectionSamplingCapable Class Reference<div class="ingroups"><a class="el" href="group__mrpt__bayes__grp.html">[mrpt-bayes]</a></div></div>  </div>
</div>
<div class="contents">
<!-- doxytag: class="mrpt::bayes::CRejectionSamplingCapable" --><hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><p>A base class for implementing rejection sampling in a generic state space. </p>
<p>See the main method <a class="el" href="classmrpt_1_1bayes_1_1_c_rejection_sampling_capable.html#af0597f8c63106e2a4b64365147cf931f" title="Generates a set of N independent samples via rejection sampling.">CRejectionSamplingCapable::rejectionSampling</a> To use this class, create your own class as a child of this one and implement the desired virtual methods, and add any required internal data. </p>
</div>
<p><code>#include &lt;<a class="el" href="_c_rejection_sampling_capable_8h_source.html">mrpt/bayes/CRejectionSamplingCapable.h</a>&gt;</code></p>
<div class="dynheader">
Inheritance diagram for mrpt::bayes::CRejectionSamplingCapable:</div>
<div class="dyncontent">
<div class="center"><img src="classmrpt_1_1bayes_1_1_c_rejection_sampling_capable__inherit__graph.png" border="0" usemap="#mrpt_1_1bayes_1_1_c_rejection_sampling_capable_inherit__map" alt="Inheritance graph"/></div>
<map name="mrpt_1_1bayes_1_1_c_rejection_sampling_capable_inherit__map" id="mrpt_1_1bayes_1_1_c_rejection_sampling_capable_inherit__map">
<area shape="rect" id="node3" href="classmrpt_1_1bayes_1_1_c_rejection_sampling_capable.html" title="mrpt::bayes::CRejectionSamplingCapable\&lt; poses::CPose2D \&gt;" alt="" coords="5,96,395,123"/><area shape="rect" id="node5" href="classmrpt_1_1slam_1_1_c_rejection_sampling_range_only_localization.html" title="An implementation of rejection sampling for generating 2D robot pose from range&#45;only measurements wit..." alt="" coords="27,173,372,200"/></map>
<center><span class="legend">[<a href="graph_legend.html">legend</a>]</span></center></div>

<p><a href="classmrpt_1_1bayes_1_1_c_rejection_sampling_capable-members.html">List of all members.</a></p>
<table class="memberdecls">
<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="structmrpt_1_1bayes_1_1_c_probability_particle.html">CProbabilityParticle</a><br class="typebreak"/>
&lt; TStateSpace &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmrpt_1_1bayes_1_1_c_rejection_sampling_capable.html#a6c35abe1d7247665e9e7431aedee9e4f">TParticle</a></td></tr>
<tr><td colspan="2"><h2><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmrpt_1_1bayes_1_1_c_rejection_sampling_capable.html#adfb6b788cf338e5f2e3c72566ece1efc">~CRejectionSamplingCapable</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Virtual destructor.  <a href="#adfb6b788cf338e5f2e3c72566ece1efc"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmrpt_1_1bayes_1_1_c_rejection_sampling_capable.html#af0597f8c63106e2a4b64365147cf931f">rejectionSampling</a> (size_t desiredSamples, <a class="el" href="classstd_1_1vector.html">std::vector</a>&lt; <a class="el" href="classmrpt_1_1bayes_1_1_c_rejection_sampling_capable.html#a6c35abe1d7247665e9e7431aedee9e4f">TParticle</a> &gt; &amp;outSamples, size_t timeoutTrials=1000)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Generates a set of N independent samples via rejection sampling.  <a href="#af0597f8c63106e2a4b64365147cf931f"></a><br/></td></tr>
<tr><td colspan="2"><h2><a name="pro-methods"></a>
Protected Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmrpt_1_1bayes_1_1_c_rejection_sampling_capable.html#addc288e07f0bfea667f0b30c235007d2">RS_drawFromProposal</a> (TStateSpace &amp;outSample)=0</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Generates one sample, drawing from some proposal distribution.  <a href="#addc288e07f0bfea667f0b30c235007d2"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmrpt_1_1bayes_1_1_c_rejection_sampling_capable.html#a6cf91003f69f1cb70d8f0b18f3a49b79">RS_observationLikelihood</a> (const TStateSpace &amp;x)=0</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the NORMALIZED observation likelihood (linear, not exponential!!!) at a given point of the state space (values in the range [0,1]).  <a href="#a6cf91003f69f1cb70d8f0b18f3a49b79"></a><br/></td></tr>
</table>
<hr/><h2>Member Typedef Documentation</h2>
<a class="anchor" id="a6c35abe1d7247665e9e7431aedee9e4f"></a><!-- doxytag: member="mrpt::bayes::CRejectionSamplingCapable::TParticle" ref="a6c35abe1d7247665e9e7431aedee9e4f" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">typedef <a class="el" href="structmrpt_1_1bayes_1_1_c_probability_particle.html">CProbabilityParticle</a>&lt;TStateSpace&gt; <a class="el" href="classmrpt_1_1bayes_1_1_c_rejection_sampling_capable.html#a6c35abe1d7247665e9e7431aedee9e4f">mrpt::bayes::CRejectionSamplingCapable::TParticle</a></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Definition at line <a class="el" href="_c_rejection_sampling_capable_8h_source.html#l00050">50</a> of file <a class="el" href="_c_rejection_sampling_capable_8h_source.html">CRejectionSamplingCapable.h</a>.</p>

</div>
</div>
<hr/><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="adfb6b788cf338e5f2e3c72566ece1efc"></a><!-- doxytag: member="mrpt::bayes::CRejectionSamplingCapable::~CRejectionSamplingCapable" ref="adfb6b788cf338e5f2e3c72566ece1efc" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">virtual mrpt::bayes::CRejectionSamplingCapable::~CRejectionSamplingCapable </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td><code> [inline, virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Virtual destructor. </p>

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

</div>
</div>
<hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="af0597f8c63106e2a4b64365147cf931f"></a><!-- doxytag: member="mrpt::bayes::CRejectionSamplingCapable::rejectionSampling" ref="af0597f8c63106e2a4b64365147cf931f" args="(size_t desiredSamples, std::vector&lt; TParticle &gt; &amp;outSamples, size_t timeoutTrials=1000)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void mrpt::bayes::CRejectionSamplingCapable::rejectionSampling </td>
          <td>(</td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>desiredSamples</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="classstd_1_1vector.html">std::vector</a>&lt; <a class="el" href="classmrpt_1_1bayes_1_1_c_rejection_sampling_capable.html#a6c35abe1d7247665e9e7431aedee9e4f">TParticle</a> &gt; &amp;&#160;</td>
          <td class="paramname"><em>outSamples</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>timeoutTrials</em> = <code>1000</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Generates a set of N independent samples via rejection sampling. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">desiredSamples</td><td>The number of desired samples to generate </td></tr>
    <tr><td class="paramname">outSamples</td><td>The output samples. </td></tr>
    <tr><td class="paramname">timeoutTrials</td><td>The maximum number of rejection trials for each generated sample (i.e. the maximum number of iterations). This can be used to set a limit to the time complexity of the algorithm for difficult probability densities. All will have equal importance weights (a property of rejection sampling), although those samples generated at timeout will have a different importance weights. </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="_c_rejection_sampling_capable_8h_source.html#l00065">65</a> of file <a class="el" href="_c_rejection_sampling_capable_8h_source.html">CRejectionSamplingCapable.h</a>.</p>

</div>
</div>
<a class="anchor" id="addc288e07f0bfea667f0b30c235007d2"></a><!-- doxytag: member="mrpt::bayes::CRejectionSamplingCapable::RS_drawFromProposal" ref="addc288e07f0bfea667f0b30c235007d2" args="(TStateSpace &amp;outSample)=0" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">virtual void mrpt::bayes::CRejectionSamplingCapable::RS_drawFromProposal </td>
          <td>(</td>
          <td class="paramtype">TStateSpace &amp;&#160;</td>
          <td class="paramname"><em>outSample</em></td><td>)</td>
          <td><code> [protected, pure virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Generates one sample, drawing from some proposal distribution. </p>

<p>Referenced by <a class="el" href="_c_rejection_sampling_capable_8h_source.html#l00065">mrpt::bayes::CRejectionSamplingCapable&lt; poses::CPose2D &gt;::rejectionSampling()</a>.</p>

</div>
</div>
<a class="anchor" id="a6cf91003f69f1cb70d8f0b18f3a49b79"></a><!-- doxytag: member="mrpt::bayes::CRejectionSamplingCapable::RS_observationLikelihood" ref="a6cf91003f69f1cb70d8f0b18f3a49b79" args="(const TStateSpace &amp;x)=0" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">virtual double mrpt::bayes::CRejectionSamplingCapable::RS_observationLikelihood </td>
          <td>(</td>
          <td class="paramtype">const TStateSpace &amp;&#160;</td>
          <td class="paramname"><em>x</em></td><td>)</td>
          <td><code> [protected, pure virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Returns the NORMALIZED observation likelihood (linear, not exponential!!!) at a given point of the state space (values in the range [0,1]). </p>

<p>Referenced by <a class="el" href="_c_rejection_sampling_capable_8h_source.html#l00065">mrpt::bayes::CRejectionSamplingCapable&lt; poses::CPose2D &gt;::rejectionSampling()</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>