* indentations + whitespace cleanup
This commit is contained in:
parent
8457e39efe
commit
56c6edab04
285 changed files with 6068 additions and 6223 deletions
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
PyEO
|
||||
|
||||
|
||||
Copyright (C) 2003 Maarten Keijzer
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
|
|
@ -17,6 +17,7 @@
|
|||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include <eoNDSorting.h>
|
||||
|
||||
#include "PyEO.h"
|
||||
|
|
@ -30,19 +31,18 @@ struct Perf2WorthWrapper : public eoPerf2Worth<PyEO,double>
|
|||
|
||||
void operator()( const eoPop<PyEO>& pop)
|
||||
{
|
||||
call_method<void>(self, "__call__", boost::ref(pop));
|
||||
call_method<void>(self, "__call__", boost::ref(pop));
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
numeric::array get_worths(eoPerf2Worth<PyEO, double>& p)
|
||||
{
|
||||
std::vector<double>& worths = p.value();
|
||||
list result;
|
||||
|
||||
|
||||
for (unsigned i = 0; i < worths.size(); ++i)
|
||||
result.append(worths[i]);
|
||||
|
||||
result.append(worths[i]);
|
||||
|
||||
return numeric::array(result);
|
||||
}
|
||||
|
||||
|
|
@ -53,36 +53,37 @@ struct CachedPerf2WorthWrapper : public eoPerf2WorthCached<PyEO, double>
|
|||
|
||||
void calculate_worths(const eoPop<PyEO>& pop)
|
||||
{
|
||||
call_method<void>(self, "calculate_worths", boost::ref(pop));
|
||||
call_method<void>(self, "calculate_worths", boost::ref(pop));
|
||||
}
|
||||
};
|
||||
|
||||
void perf2worth()
|
||||
void perf2worth()
|
||||
{
|
||||
//numeric::array::set_module_and_type("Numeric", "ArrayType");
|
||||
|
||||
class_<
|
||||
eoPerf2Worth<PyEO, double>,
|
||||
Perf2WorthWrapper,
|
||||
bases< eoValueParam<std::vector<double> > >,
|
||||
boost::noncopyable>("eoPerf2Worth", init<>())
|
||||
|
||||
.def("__call__", &Perf2WorthWrapper::operator())
|
||||
.def("sort_pop", &eoPerf2Worth<PyEO, double>::sort_pop)
|
||||
//.def("value", get_worths)
|
||||
;
|
||||
|
||||
class_<eoPerf2WorthCached<PyEO, double>, CachedPerf2WorthWrapper, bases<eoPerf2Worth<PyEO, double> >, boost::noncopyable>
|
||||
("eoPerf2WorthCached", init<>())
|
||||
.def("__call__", &eoPerf2WorthCached<PyEO, double>::operator())
|
||||
.def("calculate_worths", &CachedPerf2WorthWrapper::calculate_worths)
|
||||
;
|
||||
|
||||
class_<eoPerf2Worth<PyEO, double>,
|
||||
Perf2WorthWrapper,
|
||||
bases< eoValueParam<std::vector<double> > >,
|
||||
boost::noncopyable>("eoPerf2Worth", init<>())
|
||||
|
||||
.def("__call__", &Perf2WorthWrapper::operator())
|
||||
.def("sort_pop", &eoPerf2Worth<PyEO, double>::sort_pop)
|
||||
//.def("value", get_worths)
|
||||
;
|
||||
|
||||
class_<eoPerf2WorthCached<PyEO, double>,
|
||||
CachedPerf2WorthWrapper,
|
||||
bases<eoPerf2Worth<PyEO, double> >,
|
||||
boost::noncopyable>("eoPerf2WorthCached", init<>())
|
||||
|
||||
.def("__call__", &eoPerf2WorthCached<PyEO, double>::operator())
|
||||
.def("calculate_worths", &CachedPerf2WorthWrapper::calculate_worths)
|
||||
;
|
||||
|
||||
//class_<eoNoPerf2Worth<PyEO>, bases<eoPerf2Worth<PyEO, double> > >("eoNoPerf2Worth")
|
||||
// .def("__call__", &eoNoPerf2Worth<PyEO>::operator());
|
||||
|
||||
class_<eoNDSorting_II<PyEO>, bases<eoPerf2WorthCached<PyEO, double> > >("eoNDSorting_II")
|
||||
.def("calculate_worths", &eoNDSorting_II<PyEO>::calculate_worths);
|
||||
// .def("__call__", &eoNoPerf2Worth<PyEO>::operator());
|
||||
|
||||
class_<eoNDSorting_II<PyEO>,
|
||||
bases<eoPerf2WorthCached<PyEO, double> > >("eoNDSorting_II")
|
||||
.def("calculate_worths", &eoNDSorting_II<PyEO>::calculate_worths);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Reference in a new issue