Paradiseo-eo sources added

git-svn-id: svn://scm.gforge.inria.fr/svnroot/paradiseo@40 331e1502-861f-0410-8da2-ba01fb791d7f
This commit is contained in:
legrand 2006-12-12 14:49:08 +00:00
commit c3aec878e5
3609 changed files with 342772 additions and 0 deletions

View file

@ -0,0 +1,53 @@
<!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>EO: eoSelectPerc.h Source File</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.3.9.1 -->
<div class="qindex"> <form class="search" action="search.php" method="get">
<a class="qindex" href="main.html">Main&nbsp;Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="namespaces.html">Namespace List</a> | <a class="qindex" href="hierarchy.html">Class&nbsp;Hierarchy</a> | <a class="qindex" href="classes.html">Alphabetical&nbsp;List</a> | <a class="qindex" href="annotated.html">Class&nbsp;List</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="namespacemembers.html">Namespace&nbsp;Members</a> | <a class="qindex" href="functions.html">Class&nbsp;Members</a> | <a class="qindex" href="pages.html">Related&nbsp;Pages</a> | <span class="search"><u>S</u>earch&nbsp;for&nbsp;<input class="search" type="text" name="query" value="" size="20" accesskey="s"/></span></form></div>
<div class="nav">
<a class="el" href="dir_000000.html">src</a></div>
<h1>eoSelectPerc.h</h1><div class="fragment"><pre class="fragment">00001
00023 <span class="comment">//-----------------------------------------------------------------------------</span>
00024
00025 <span class="preprocessor">#ifndef _eoSelectPerc_h</span>
00026 <span class="preprocessor"></span><span class="preprocessor">#define _eoSelectPerc_h</span>
00027 <span class="preprocessor"></span>
00028
00029 <span class="comment">//-----------------------------------------------------------------------------</span>
00030 <span class="preprocessor">#include &lt;eoSelect.h&gt;</span>
00031 <span class="preprocessor">#include &lt;eoSelectOne.h&gt;</span>
00032 <span class="preprocessor">#include &lt;math.h&gt;</span>
00033 <span class="comment">//-----------------------------------------------------------------------------</span>
00034
00041 <span class="keyword">template</span>&lt;<span class="keyword">class</span> EOT&gt;
<a name="l00042"></a><a class="code" href="classeo_select_perc.html">00042</a> <span class="keyword">class </span><a class="code" href="classeo_select_perc.html">eoSelectPerc</a> : <span class="keyword">public</span> <a class="code" href="classeo_select.html">eoSelect</a>&lt;EOT&gt;
00043 {
00044 <span class="keyword">public</span>:
<a name="l00046"></a><a class="code" href="classeo_select_perc.html#a0">00046</a> <a class="code" href="classeo_select_perc.html#a0">eoSelectPerc</a>(<a class="code" href="classeo_select_one.html">eoSelectOne&lt;EOT&gt;</a>&amp; _select, <span class="keywordtype">float</span> _rate = 1.0)
00047 : select(_select), rate(_rate) {}
00048
<a name="l00055"></a><a class="code" href="classeo_select_perc.html#a1">00055</a> <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classeo_select_perc.html#a1">operator()</a>(<span class="keyword">const</span> <a class="code" href="classeo_pop.html">eoPop&lt;EOT&gt;</a>&amp; _source, <a class="code" href="classeo_pop.html">eoPop&lt;EOT&gt;</a>&amp; _dest)
00056 {
00057 size_t target = static_cast&lt;size_t&gt;(floor(rate * _source.size()));
00058
00059 _dest.resize(target);
00060
00061 select.<a class="code" href="classeo_select_one.html#a0">setup</a>(_source);
00062
00063 <span class="keywordflow">for</span> (size_t i = 0; i &lt; _dest.size(); ++i)
00064 _dest[i] = select(_source);
00065 }
00066
00067 <span class="keyword">private</span> :
00068 <a class="code" href="classeo_select_one.html">eoSelectOne&lt;EOT&gt;</a>&amp; select;
00069 <span class="keywordtype">float</span> rate;
00070 };
00071
00072 <span class="preprocessor">#endif</span>
</pre></div><hr size="1"><address style="align: right;"><small>Generated on Thu Oct 19 05:06:38 2006 for EO by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.3.9.1 </small></address>
</body>
</html>