Doing libes.a in src/es and adding t-eoReal.cpp in test
I had to move eoRealBounds to utils dir because of global objects Some domino consequences here and there ...
This commit is contained in:
parent
511dc26623
commit
4968d64b05
19 changed files with 120 additions and 25 deletions
|
|
@ -48,9 +48,6 @@
|
|||
#include <es/eoRealOp.h>
|
||||
#include <es/eoNormalMutation.h>
|
||||
|
||||
// and their generic counterparts
|
||||
#include <es/eoGenericRealOp.h>
|
||||
|
||||
// the ES-mutations
|
||||
#include <es/eoEsMutationInit.h>
|
||||
#include <es/eoEsMutate.h>
|
||||
|
|
|
|||
|
|
@ -4,5 +4,16 @@
|
|||
##
|
||||
###############################################################################
|
||||
|
||||
INCLUDES = -I$(top_builddir)/src
|
||||
lib_LIBRARIES = libes.a
|
||||
libes_a_SOURCES = make_algo_scalar_real.cpp \
|
||||
make_checkpoint_real.cpp \
|
||||
make_continue_real.cpp \
|
||||
make_genotype_real.cpp \
|
||||
make_help.cpp \
|
||||
make_op_real.cpp \
|
||||
make_pop_real.cpp \
|
||||
make_run_real.cpp
|
||||
CPPFLAGS = -Wall
|
||||
libeoincdir = $(includedir)/eo/es
|
||||
libeoinc_HEADERS = eoEsChromInit.h eoEsFull.h eoEsMutate.h eoEsMutationInit.h eoEsSimple.h eoEsStdev.h eoEsStdevXOver.h eoGenericRealOp.h eoNormalMutation.h eoReal.h eoRealBounds.h eoRealOp.h
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@
|
|||
#ifndef _eoEsChromInit_H
|
||||
#define _eoEsChromInit_H
|
||||
|
||||
#include <es/eoRealBounds.h>
|
||||
#include <utils/eoRealBounds.h>
|
||||
#include <es/eoEsSimple.h>
|
||||
#include <es/eoEsStdev.h>
|
||||
#include <es/eoEsFull.h>
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@
|
|||
#include <es/eoEsSimple.h>
|
||||
#include <es/eoEsStdev.h>
|
||||
#include <es/eoEsFull.h>
|
||||
#include <es/eoRealBounds.h>
|
||||
#include <utils/eoRealBounds.h>
|
||||
|
||||
#include <eoOp.h>
|
||||
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@
|
|||
#define _eoEsStdevXOver_h
|
||||
|
||||
#include <es/eoEsStdev.h>
|
||||
#include <es/eoGenericRealOp.h>
|
||||
#include <es/eoRealOp.h>
|
||||
|
||||
/**
|
||||
\ingroup EvolutionStrategies
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@
|
|||
#include <utils/eoUpdatable.h>
|
||||
#include <eoEvalFunc.h>
|
||||
#include <es/eoReal.h>
|
||||
#include <es/eoRealBounds.h>
|
||||
#include <utils/eoRealBounds.h>
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
/** Simple normal mutation of a vector of real values.
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@
|
|||
#include <algorithm> // swap_ranges
|
||||
#include <utils/eoRNG.h>
|
||||
#include <es/eoReal.h>
|
||||
#include <es/eoRealBounds.h>
|
||||
#include <utils/eoRealBounds.h>
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
|
|
|
|||
|
|
@ -24,15 +24,15 @@
|
|||
*/
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
/** This file contains all ***INSTANCIATED DEFINITIONS*** of operators
|
||||
/** This file contains all ***INSTANCIATED DEFINITIONS*** of pop. init.
|
||||
* of the library for ***BISTRING*** evolution inside EO.
|
||||
* It should be included in the file that calls any of the corresponding fns
|
||||
* Compiling this file allows one to generate part of the library (i.e. object
|
||||
* files that you just need to link with your own main and fitness code).
|
||||
*
|
||||
* The corresponding ***INSTANCIATED DECLARATIONS*** are contained
|
||||
* in make_algo_scalar_ga.h
|
||||
* while the TEMPLATIZED code is define in make_algo_scalar.h in the do dir
|
||||
* in src/ga/ga.h
|
||||
* while the TEMPLATIZED code is define in make_algo_scalar.h in the src/do dir
|
||||
*
|
||||
* Unlike most EO .h files, it does not (and should not) contain any code,
|
||||
* just declarations
|
||||
|
|
|
|||
|
|
@ -31,8 +31,8 @@
|
|||
* files that you just need to link with your own main and fitness code).
|
||||
*
|
||||
* The corresponding ***INSTANCIATED DECLARATIONS*** are contained
|
||||
* in make_continue_ga.h
|
||||
* while the TEMPLATIZED code is define in make_contninue.h in the do dir
|
||||
* in ga.h
|
||||
* while the TEMPLATIZED code is define in make_contninue.h in the src/do dir
|
||||
*
|
||||
* Unlike most EO .h files, it does not (and should not) contain any code,
|
||||
* just declarations
|
||||
|
|
|
|||
|
|
@ -31,8 +31,8 @@
|
|||
* files that you just need to link with your own main and fitness code).
|
||||
*
|
||||
* The corresponding ***INSTANCIATED DECLARATIONS*** are contained
|
||||
* in make_pop_ga.h
|
||||
* while the TEMPLATIZED code is define in make_pop.h in the do dir
|
||||
* in ga.h
|
||||
* while the TEMPLATIZED code is define in make_pop.h in the src/do dir
|
||||
*
|
||||
* Unlike most EO .h files, it does not (and should not) contain any code,
|
||||
* just declarations
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
INCLUDES = -I$(top_builddir)/src
|
||||
CPPFLAGS = -O2 -Wall
|
||||
lib_LIBRARIES = libeoutils.a
|
||||
libeoutils_a_SOURCES = eoParser.cpp eoRNG.cpp eoState.cpp eoUpdater.cpp eoFileMonitor.cpp eoStdoutMonitor.cpp
|
||||
libeoutils_a_SOURCES = eoParser.cpp eoRNG.cpp eoState.cpp eoUpdater.cpp eoFileMonitor.cpp eoStdoutMonitor.cpp eoRealBounds.cpp
|
||||
|
||||
libeoincdir = $(includedir)/eo/utils
|
||||
libeoinc_HEADERS = checkpointing *.h
|
||||
|
|
|
|||
|
|
@ -103,7 +103,7 @@ inline void eoGnuplot1DMonitor::FirstPlot()
|
|||
{
|
||||
if (vec.size() < 2)
|
||||
{
|
||||
throw runtime_error("eoGnuplot1DMonitor needs at least 2 stats (X and Y)!\n");
|
||||
throw runtime_error("Must have some stats to plot!\n");
|
||||
}
|
||||
char buff[1024];
|
||||
ostrstream os(buff, 1024);
|
||||
|
|
|
|||
|
|
@ -470,7 +470,7 @@ public:
|
|||
// so here we do have arguments
|
||||
string t = _value.substr(pos+1);// the arguments
|
||||
_value.resize(pos);
|
||||
first = _value; // done for the keyword
|
||||
first = _value; // done for the keyword (NOTE: may be empty string!)
|
||||
|
||||
// now all arguments
|
||||
string delim(" (),");
|
||||
|
|
|
|||
7
eo/src/utils/eoRealBounds.cpp
Normal file
7
eo/src/utils/eoRealBounds.cpp
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
#include <ctime>
|
||||
#include "eoRealBounds.h"
|
||||
|
||||
// the global dummy bounds
|
||||
// (used for unbounded variables when bounds are required)
|
||||
eoRealNoBounds eoDummyRealNoBounds;
|
||||
eoRealVectorNoBounds eoDummyVectorNoBounds;
|
||||
|
|
@ -27,6 +27,9 @@
|
|||
#ifndef _eoRealBounds_h
|
||||
#define _eoRealBounds_h
|
||||
|
||||
#include <stdexcept> // exceptions!
|
||||
#include <utils/eoRNG.h>
|
||||
|
||||
/**
|
||||
\defgroup EvolutionStrategies
|
||||
|
||||
|
|
@ -408,7 +411,7 @@ Anyone with extra time in his agenda is welcome to change that :-)
|
|||
class eoRealVectorBounds : public vector<eoRealBounds *>
|
||||
{
|
||||
public:
|
||||
// virtual desctructor (to avoid warining?)
|
||||
// virtual desctructor (to avoid warning?)
|
||||
virtual ~eoRealVectorBounds(){}
|
||||
|
||||
/** Default Ctor
|
||||
|
|
@ -649,6 +652,6 @@ public:
|
|||
};
|
||||
|
||||
// one object for all
|
||||
eoRealNoBounds eoDummyRealNoBounds;
|
||||
eoRealVectorNoBounds eoDummyVectorNoBounds;
|
||||
extern eoRealNoBounds eoDummyRealNoBounds;
|
||||
extern eoRealVectorNoBounds eoDummyVectorNoBounds;
|
||||
#endif
|
||||
Reference in a new issue