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:
parent
bc1f453978
commit
c3aec878e5
3609 changed files with 342772 additions and 0 deletions
173
trunk/paradiseo-eo/doc/html/genetic_ops_8cpp-source.html
Normal file
173
trunk/paradiseo-eo/doc/html/genetic_ops_8cpp-source.html
Normal file
|
|
@ -0,0 +1,173 @@
|
|||
<!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: geneticOps.cpp 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 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 Hierarchy</a> | <a class="qindex" href="classes.html">Alphabetical List</a> | <a class="qindex" href="annotated.html">Class List</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="namespacemembers.html">Namespace Members</a> | <a class="qindex" href="functions.html">Class Members</a> | <a class="qindex" href="pages.html">Related Pages</a> | <span class="search"><u>S</u>earch for <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> / <a class="el" href="dir_000001.html">pyeo</a></div>
|
||||
<h1>geneticOps.cpp</h1><div class="fragment"><pre class="fragment">00001 <span class="comment">/*</span>
|
||||
00002 <span class="comment"> PyEO</span>
|
||||
00003 <span class="comment"> </span>
|
||||
00004 <span class="comment"> Copyright (C) 2003 Maarten Keijzer</span>
|
||||
00005 <span class="comment"></span>
|
||||
00006 <span class="comment"> This program is free software; you can redistribute it and/or modify</span>
|
||||
00007 <span class="comment"> it under the terms of the GNU General Public License as published by</span>
|
||||
00008 <span class="comment"> the Free Software Foundation; either version 2 of the License, or</span>
|
||||
00009 <span class="comment"> (at your option) any later version.</span>
|
||||
00010 <span class="comment"></span>
|
||||
00011 <span class="comment"> This program is distributed in the hope that it will be useful,</span>
|
||||
00012 <span class="comment"> but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
|
||||
00013 <span class="comment"> MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the</span>
|
||||
00014 <span class="comment"> GNU General Public License for more details.</span>
|
||||
00015 <span class="comment"></span>
|
||||
00016 <span class="comment"> You should have received a copy of the GNU General Public License</span>
|
||||
00017 <span class="comment"> along with this program; if not, write to the Free Software</span>
|
||||
00018 <span class="comment"> Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA</span>
|
||||
00019 <span class="comment">*/</span>
|
||||
00020
|
||||
00021 <span class="preprocessor">#include <eoGenOp.h></span>
|
||||
00022 <span class="preprocessor">#include <eoOp.h></span>
|
||||
00023 <span class="preprocessor">#include <eoCloneOps.h></span>
|
||||
00024 <span class="preprocessor">#include <eoPopulator.h></span>
|
||||
00025 <span class="preprocessor">#include <eoOpContainer.h></span>
|
||||
00026
|
||||
00027 <span class="preprocessor">#include "PyEO.h"</span>
|
||||
00028 <span class="preprocessor">#include "def_abstract_functor.h"</span>
|
||||
00029
|
||||
00030 <span class="keyword">using</span> <span class="keyword">namespace </span>boost::python;
|
||||
00031
|
||||
00032 <span class="keyword">class </span>GenOpWrapper : <span class="keyword">public</span> <a class="code" href="classeo_gen_op.html">eoGenOp</a><PyEO>
|
||||
00033 {
|
||||
00034 <span class="keyword">public</span>:
|
||||
00035
|
||||
00036 PyObject* <span class="keyword">self</span>;
|
||||
00037 GenOpWrapper(PyObject* p) : self(p) {}
|
||||
00038 <span class="keywordtype">unsigned</span> <a class="code" href="classeo_gen_op.html#a1">max_production</a>(<span class="keywordtype">void</span>)
|
||||
00039 {
|
||||
00040 <span class="keywordflow">return</span> call_method<unsigned>(<span class="keyword">self</span>,<span class="stringliteral">"max_production"</span>);
|
||||
00041 }
|
||||
00042 std::string className()<span class="keyword"> const</span>
|
||||
00043 <span class="keyword"> </span>{
|
||||
00044 <span class="keywordflow">return</span> <span class="stringliteral">"GenOpDerivative"</span>; <span class="comment">// never saw the use of className anyway</span>
|
||||
00045 }
|
||||
00046
|
||||
00047 <span class="keywordtype">void</span> <a class="code" href="classeo_gen_op.html#b0">apply</a>(<a class="code" href="classeo_populator.html">eoPopulator<PyEO></a>& populator )
|
||||
00048 {
|
||||
00049 boost::python::call_method<void>(<span class="keyword">self</span>,<span class="stringliteral">"apply"</span>, boost::ref( populator ) );
|
||||
00050 }
|
||||
00051 };
|
||||
00052
|
||||
00053 <span class="keyword">class </span>PopulatorWrapper : <span class="keyword">public</span> <a class="code" href="classeo_populator.html">eoPopulator</a><PyEO>
|
||||
00054 {
|
||||
00055 <span class="keyword">public</span>:
|
||||
00056 PyObject* <span class="keyword">self</span>;
|
||||
00057 PopulatorWrapper(PyObject* p, <span class="keyword">const</span> <a class="code" href="classeo_pop.html">eoPop<PyEO></a>& src, <a class="code" href="classeo_pop.html">eoPop<PyEO></a>& dest)
|
||||
00058 : <a class="code" href="classeo_populator.html">eoPopulator</a><PyEO>(src, dest), self(p)
|
||||
00059 {
|
||||
00060 <span class="comment">//throw std::runtime_error("abstract base class");</span>
|
||||
00061 }
|
||||
00062
|
||||
00063 <span class="keyword">const</span> PyEO& <a class="code" href="classeo_populator.html#a11">select</a>()
|
||||
00064 {
|
||||
00065 <span class="keywordflow">return</span> call_method<const PyEO&>(<span class="keyword">self</span>,<span class="stringliteral">"select"</span>);
|
||||
00066 }
|
||||
00067 };
|
||||
00068
|
||||
00069 <span class="keyword">class </span>MonOpWrapper : <span class="keyword">public</span> <a class="code" href="classeo_mon_op.html">eoMonOp</a><PyEO>
|
||||
00070 {
|
||||
00071 <span class="keyword">public</span>:
|
||||
00072 PyObject* <span class="keyword">self</span>;
|
||||
00073 MonOpWrapper(PyObject* p) : self(p) {}
|
||||
00074 <span class="keywordtype">bool</span> <a class="code" href="classeo_u_f.html#a1">operator()</a>(PyEO& _eo)
|
||||
00075 { <span class="keywordflow">return</span> boost::python::call_method<bool>(<span class="keyword">self</span>, <span class="stringliteral">"__call__"</span>, boost::ref( _eo )); }
|
||||
00076 };
|
||||
00077 <span class="keyword">class </span>BinOpWrapper : <span class="keyword">public</span> <a class="code" href="classeo_bin_op.html">eoBinOp</a><PyEO>
|
||||
00078 {
|
||||
00079 <span class="keyword">public</span>:
|
||||
00080 PyObject* <span class="keyword">self</span>;
|
||||
00081 BinOpWrapper(PyObject* p) : self(p) {}
|
||||
00082 <span class="keywordtype">bool</span> <a class="code" href="classeo_b_f.html#a1">operator()</a>(PyEO& _eo, <span class="keyword">const</span> PyEO& _eo2)
|
||||
00083 { <span class="keywordflow">return</span> boost::python::call_method<bool>(<span class="keyword">self</span>, <span class="stringliteral">"__call__"</span>, boost::ref( _eo ), boost::ref(_eo2)); }
|
||||
00084 };
|
||||
00085 <span class="keyword">class </span>QuadOpWrapper : <span class="keyword">public</span> <a class="code" href="classeo_quad_op.html">eoQuadOp</a><PyEO>
|
||||
00086 {
|
||||
00087 <span class="keyword">public</span>:
|
||||
00088 PyObject* <span class="keyword">self</span>;
|
||||
00089 QuadOpWrapper(PyObject* p) : self(p) {}
|
||||
00090 <span class="keywordtype">bool</span> <a class="code" href="classeo_b_f.html#a1">operator()</a>(PyEO& _eo, PyEO& _eo2)
|
||||
00091 { <span class="keywordflow">return</span> boost::python::call_method<bool>(<span class="keyword">self</span>, <span class="stringliteral">"__call__"</span>, boost::ref( _eo ), boost::ref(_eo2)); }
|
||||
00092 };
|
||||
00093
|
||||
00094 <span class="keywordtype">void</span> geneticOps()
|
||||
00095 {
|
||||
00096 class_<eoPopulator<PyEO>, PopulatorWrapper, boost::noncopyable>
|
||||
00097 (<span class="stringliteral">"eoPopulator"</span>, init<const eoPop<PyEO>&, <a class="code" href="classeo_pop.html">eoPop<PyEO></a>&>() )
|
||||
00098 .def(<span class="stringliteral">"select"</span>, &PopulatorWrapper::select, return_internal_reference<>() )
|
||||
00099 .def(<span class="stringliteral">"get"</span>, &<a class="code" href="classeo_populator.html">eoPopulator<PyEO></a>::<span class="keyword">operator</span>*, return_internal_reference<>() )
|
||||
00100 .def(<span class="stringliteral">"next"</span>, &<a class="code" href="classeo_populator.html">eoPopulator<PyEO></a>::<span class="keyword">operator</span>++, return_internal_reference<>() )
|
||||
00101 .def(<span class="stringliteral">"insert"</span>, &<a class="code" href="classeo_populator.html">eoPopulator<PyEO></a>::insert)
|
||||
00102 .def(<span class="stringliteral">"reserve"</span>, &<a class="code" href="classeo_populator.html">eoPopulator<PyEO></a>::reserve)
|
||||
00103 .def(<span class="stringliteral">"source"</span>, &<a class="code" href="classeo_populator.html">eoPopulator<PyEO></a>::source, return_internal_reference<>() )
|
||||
00104 .def(<span class="stringliteral">"offspring"</span>, &<a class="code" href="classeo_populator.html">eoPopulator<PyEO></a>::offspring, return_internal_reference<>() )
|
||||
00105 .def(<span class="stringliteral">"tellp"</span>, &<a class="code" href="classeo_populator.html">eoPopulator<PyEO></a>::tellp)
|
||||
00106 .def(<span class="stringliteral">"seekp"</span>, &<a class="code" href="classeo_populator.html">eoPopulator<PyEO></a>::seekp)
|
||||
00107 .def(<span class="stringliteral">"exhausted"</span>, &<a class="code" href="classeo_populator.html">eoPopulator<PyEO></a>::exhausted)
|
||||
00108 ;
|
||||
00109
|
||||
00110 class_<eoSeqPopulator<PyEO>, bases<eoPopulator<PyEO> > >
|
||||
00111 (<span class="stringliteral">"eoSeqPopulator"</span>, init<const eoPop<PyEO>&, <a class="code" href="classeo_pop.html">eoPop<PyEO></a>&>() )
|
||||
00112 .def(<span class="stringliteral">"select"</span>, &<a class="code" href="classeo_seq_populator.html">eoSeqPopulator<PyEO></a>::select, return_internal_reference<>() )
|
||||
00113 ;
|
||||
00114
|
||||
00115 class_<eoSelectivePopulator<PyEO>, bases<eoPopulator<PyEO> > >
|
||||
00116 (<span class="stringliteral">"eoSelectivePopulator"</span>, init<const eoPop<PyEO>&, <a class="code" href="classeo_pop.html">eoPop<PyEO></a>&, <a class="code" href="classeo_select_one.html">eoSelectOne<PyEO></a>& >() )
|
||||
00117 .def(<span class="stringliteral">"select"</span>, &<a class="code" href="classeo_seq_populator.html">eoSeqPopulator<PyEO></a>::select, return_internal_reference<>() )
|
||||
00118 ;
|
||||
00119 enum_<eoOp<PyEO>::OpType>(<span class="stringliteral">"OpType"</span>)
|
||||
00120 .value(<span class="stringliteral">"unary"</span>, <a class="code" href="classeo_op.html">eoOp<PyEO></a>::unary)
|
||||
00121 .value(<span class="stringliteral">"binary"</span>, <a class="code" href="classeo_op.html">eoOp<PyEO></a>::binary)
|
||||
00122 .value(<span class="stringliteral">"quadratic"</span>, <a class="code" href="classeo_op.html">eoOp<PyEO></a>::quadratic)
|
||||
00123 .value(<span class="stringliteral">"general"</span>, <a class="code" href="classeo_op.html">eoOp<PyEO></a>::general)
|
||||
00124 ;
|
||||
00125
|
||||
00126 class_<eoOp<PyEO> >(<span class="stringliteral">"eoOp"</span>, init<eoOp<PyEO>::OpType>())
|
||||
00127 .def(<span class="stringliteral">"getType"</span>, &<a class="code" href="classeo_op.html">eoOp<PyEO></a>::getType);
|
||||
00128
|
||||
00129 class_<eoMonOp<PyEO>, MonOpWrapper, bases<eoOp<PyEO> >, boost::noncopyable>(<span class="stringliteral">"eoMonOp"</span>, init<>())
|
||||
00130 .def(<span class="stringliteral">"__call__"</span>, &MonOpWrapper::operator(), <span class="stringliteral">"an example docstring"</span>);
|
||||
00131 class_<eoBinOp<PyEO>, BinOpWrapper, bases<eoOp<PyEO> >, boost::noncopyable>(<span class="stringliteral">"eoBinOp"</span>, init<>())
|
||||
00132 .def(<span class="stringliteral">"__call__"</span>, &BinOpWrapper::operator());
|
||||
00133 class_<eoQuadOp<PyEO>, QuadOpWrapper, bases<eoOp<PyEO> >, boost::noncopyable>(<span class="stringliteral">"eoQuadOp"</span>, init<>())
|
||||
00134 .def(<span class="stringliteral">"__call__"</span>, &QuadOpWrapper::operator());
|
||||
00135
|
||||
00136 class_<eoGenOp<PyEO>, GenOpWrapper, bases<eoOp<PyEO> >, boost::noncopyable>(<span class="stringliteral">"eoGenOp"</span>, init<>())
|
||||
00137 .def(<span class="stringliteral">"max_production"</span>, &GenOpWrapper::max_production)
|
||||
00138 .def(<span class="stringliteral">"className"</span>, &GenOpWrapper::className)
|
||||
00139 .def(<span class="stringliteral">"apply"</span>, &GenOpWrapper::apply)
|
||||
00140 .def(<span class="stringliteral">"__call__"</span>, &<a class="code" href="classeo_gen_op.html">eoGenOp<PyEO></a>::<span class="keyword">operator</span>())
|
||||
00141 ;
|
||||
00142
|
||||
00143 class_<eoSequentialOp<PyEO>, bases<eoGenOp<PyEO> >, boost::noncopyable>(<span class="stringliteral">"eoSequentialOp"</span>, init<>())
|
||||
00144 .def(<span class="stringliteral">"add"</span>, &<a class="code" href="classeo_sequential_op.html">eoSequentialOp<PyEO></a>::add, WC1)
|
||||
00145 .def(<span class="stringliteral">"apply"</span>, &<a class="code" href="classeo_sequential_op.html">eoSequentialOp<PyEO></a>::apply)
|
||||
00146 ;
|
||||
00147
|
||||
00148 class_<eoProportionalOp<PyEO>, bases<eoGenOp<PyEO> >, boost::noncopyable>(<span class="stringliteral">"eoProportionalOp"</span>, init<>())
|
||||
00149 .def(<span class="stringliteral">"add"</span>, &<a class="code" href="classeo_proportional_op.html">eoProportionalOp<PyEO></a>::add, WC1)
|
||||
00150 .def(<span class="stringliteral">"apply"</span>, &<a class="code" href="classeo_proportional_op.html">eoProportionalOp<PyEO></a>::apply)
|
||||
00151 ;
|
||||
00152
|
||||
00153 <span class="comment">/* Cloning */</span>
|
||||
00154 class_<eoMonCloneOp<PyEO>, bases<eoMonOp<PyEO> > >(<span class="stringliteral">"eoMonCloneOp"</span>).def(<span class="stringliteral">"__call__"</span>, &<a class="code" href="classeo_mon_clone_op.html">eoMonCloneOp<PyEO></a>::<span class="keyword">operator</span>());
|
||||
00155 class_<eoBinCloneOp<PyEO>, bases<eoBinOp<PyEO> > >(<span class="stringliteral">"eoBinCloneOp"</span>).def(<span class="stringliteral">"__call__"</span>, &<a class="code" href="classeo_bin_clone_op.html">eoBinCloneOp<PyEO></a>::<span class="keyword">operator</span>());
|
||||
00156 class_<eoQuadCloneOp<PyEO>, bases<eoQuadOp<PyEO> > >(<span class="stringliteral">"eoQuadCloneOp"</span>).def(<span class="stringliteral">"__call__"</span>, &<a class="code" href="classeo_quad_clone_op.html">eoQuadCloneOp<PyEO></a>::<span class="keyword">operator</span>());
|
||||
00157
|
||||
00158 }
|
||||
</pre></div><hr size="1"><address style="align: right;"><small>Generated on Thu Oct 19 05:06:40 2006 for EO by
|
||||
<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>
|
||||
Loading…
Add table
Add a link
Reference in a new issue