From 7abbf595f71c38553ef7c1816819ec7ccbe41deb Mon Sep 17 00:00:00 2001 From: jeggermo Date: Tue, 4 Dec 2001 21:15:16 +0000 Subject: [PATCH] some template classes and functions which did not need to be templates have been changed to normal classes and functions with hard coded typed This might help with M$VC++ 6.0 compatibility --- eo/app/gpsymreg/fitness.h | 17 ++++++++--------- eo/app/gpsymreg/main.cpp | 2 +- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/eo/app/gpsymreg/fitness.h b/eo/app/gpsymreg/fitness.h index d022e84c..b7a34439 100644 --- a/eo/app/gpsymreg/fitness.h +++ b/eo/app/gpsymreg/fitness.h @@ -95,8 +95,7 @@ double _negate(double arg1) // now let's define our tree nodes -template -void init(vector &initSequence) +void init(vector &initSequence) { // we have only one variable (X) @@ -162,12 +161,12 @@ void init(vector &initSequence) }; -template -class RegFitness: public eoEvalFunc< eoParseTree > + +class RegFitness: public eoEvalFunc< eoParseTree > { public: - typedef eoParseTree EoType; + typedef eoParseTree EoType; void operator()(EoType &_eo) { @@ -175,7 +174,7 @@ class RegFitness: public eoEvalFunc< eoParseTree > vector< double > input(1); // the input variable(s) double output; double target; - FType fitness; + FitnessType fitness; float x=0; @@ -205,9 +204,9 @@ class RegFitness: public eoEvalFunc< eoParseTree > - RegFitness(eoValueParam &_generationCounter, vector< TreeNode > &initSequence, Parameters &_parameter) : eoEvalFunc(), generationCounter(_generationCounter), parameter(_parameter) + RegFitness(eoValueParam &_generationCounter, vector< Node > &initSequence, Parameters &_parameter) : eoEvalFunc(), generationCounter(_generationCounter), parameter(_parameter) { - init(initSequence); + init(initSequence); best[NORMAL] = 1000; tree= "not found"; }; @@ -221,7 +220,7 @@ class RegFitness: public eoEvalFunc< eoParseTree > private: eoValueParam &generationCounter; // so we know the current generation Parameters ¶meter; // the parameters - FType best; // the best found fitness + FitnessType best; // the best found fitness string tree; }; diff --git a/eo/app/gpsymreg/main.cpp b/eo/app/gpsymreg/main.cpp index ee4c2943..e5e8f0f6 100644 --- a/eo/app/gpsymreg/main.cpp +++ b/eo/app/gpsymreg/main.cpp @@ -68,7 +68,7 @@ int main(int argc, char *argv[]) // create an instantiation of the fitness/evaluation function // it initializes the initSequence vector // the parameters are passed on as well - RegFitness eval(generationCounter, initSequence, parameter); + RegFitness eval(generationCounter, initSequence, parameter); // Depth Initializor, defaults to grow method. eoParseTreeDepthInit initializer(parameter.InitMaxDepth, initSequence);