I have fixed some bugs and added some tests for doDistrib classes

This commit is contained in:
Caner Candan 2010-10-12 10:09:56 +02:00
commit f2e1e40c30
7 changed files with 41 additions and 11 deletions

View file

@ -1 +0,0 @@
* integrer ACP

View file

@ -8,8 +8,10 @@
#ifndef _doDistrib_h
#define _doDistrib_h
#include <eoFunctor.h>
template < typename EOT >
class doDistrib
class doDistrib : public eoFunctorBase
{
public:
//! Alias for the type

View file

@ -18,15 +18,14 @@
* This class uses the Uniform distribution parameters (bounds) to return
* a random position used for population sampling.
*/
template < typename EOT, class D=doUniform<EOT> >
template < typename EOT, class D=doUniform<EOT> > // FIXME: D template name is there really used ?!?
class doSamplerUniform : public doSampler< doUniform< EOT > >
{
public:
typedef D Distrib;
doSamplerUniform(doBounder< EOT > & bounder)
: doSampler< doUniform<EOT> >(bounder)
: doSampler< doUniform<EOT> >(bounder) // FIXME: Why D is not used here ?
{}
/*

View file

@ -36,6 +36,8 @@ SET(SOURCES
t-doEstimatorNormalMulti
t-mean-distance
t-bounderno
t-uniform
t-continue
)
FOREACH(current ${SOURCES})

View file

@ -1,12 +1,7 @@
#include <eo>
#include <do>
#include <mo>
#include <utils/eoLogger.h>
#include <utils/eoParserLogger.h>
#include "Rosenbrock.h"
#include "Sphere.h"
typedef eoReal< eoMinimizingFitness > EOT;

17
test/t-continue.cpp Normal file
View file

@ -0,0 +1,17 @@
#include <eo>
#include <do>
#include "Rosenbrock.h"
typedef eoReal< eoMinimizingFitness > EOT;
typedef doUniform< EOT > Distrib;
int main(void)
{
eoState state;
doContinue< Distrib >* continuator = new doDummyContinue< Distrib >();
state.storeFunctor(continuator);
return 0;
}

16
test/t-uniform.cpp Normal file
View file

@ -0,0 +1,16 @@
#include <eo>
#include <do>
#include "Rosenbrock.h"
typedef eoReal< eoMinimizingFitness > EOT;
int main(void)
{
eoState state;
doUniform< EOT >* distrib = new doUniform< EOT >( EOT(3, -1), EOT(3, 1) );
state.storeFunctor(distrib);
return 0;
}