fixes for gcc-4 compilation -- still have a linker problem

This commit is contained in:
kuepper 2005-12-07 15:40:23 +00:00
commit adbc5dd461
4 changed files with 66 additions and 57 deletions

View file

@ -4,24 +4,24 @@
// eoFunctorStore.h
// (c) Maarten Keijzer 2000, GeNeura Team, 2000
/*
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Contact: todos@geneura.ugr.es, http://geneura.ugr.es
Marc.Schoenauer@polytechnique.fr
mak@dhi.dk
*/
Contact: todos@geneura.ugr.es, http://geneura.ugr.es
Marc.Schoenauer@polytechnique.fr
mak@dhi.dk
*/
//-----------------------------------------------------------------------------
#ifndef _eoFunctorStore_h
@ -32,9 +32,9 @@
class eoFunctorBase;
/**
eoFunctorStore is a class that stores functors that are allocated on the
heap. This class can be used in factories to store allocated memory for
dynamically created functors.
eoFunctorStore is a class that stores functors that are allocated on the
heap. This class can be used in factories to store allocated memory for
dynamically created functors.
*/
class eoFunctorStore
{
@ -46,23 +46,25 @@ public:
// virtual destructor so we don't need to define it in derived classes
virtual ~eoFunctorStore();
/// Add an eoFunctorBase to the store
template <class Functor>
Functor& storeFunctor(Functor* r)
/// Add an eoFunctorBase to the store
template <class Functor>
Functor& storeFunctor(Functor* r)
{
// If the compiler complains about the following line, check if you really are giving it a pointer to an eoFunctorBase derived object
vec.push_back(r);
return *r;
// If the compiler complains about the following line,
// check if you really are giving it a pointer to an
// eoFunctorBase derived object
vec.push_back(r);
return *r;
}
private :
private :
/// no copying allowed
eoFunctorStore(const eoFunctorStore&);
/// no copying allowed
eoFunctorStore(const eoFunctorStore&);
/// no copying allowed
eoFunctorStore operator=(const eoFunctorStore&);
std::vector<eoFunctorBase*> vec;
/// no copying allowed
eoFunctorStore operator=(const eoFunctorStore&);
std::vector<eoFunctorBase*> vec;
};
#endif

View file

@ -186,7 +186,7 @@ template<class EOT> class eoDetUniformMutation: public eoMonOp<EOT>
// scale to the range - if any
for (unsigned i=0; i<bounds.size(); i++)
if (bounds.isBounded(i))
epsilon[i] *= _epsilon*bounds.range(i);
epsilon[i] *= _epsilon[i]*bounds.range(i);
}
/// The class name.

View file

@ -75,6 +75,12 @@ eoEsChromInit<EOT> & do_make_genotype(eoParser& _parser, eoState& _state, EOT)
"initBounds",
"Bounds for initialization (MUST be bounded)",
'B', "Genotype Initialization");
// now some initial value for sigmas - even if useless?
// should be used in Normal mutation
eoValueParam<std::string>& sigmaParam
= _parser.getORcreateParam(std::string("0.3"), "sigmaInit",
"Initial value for Sigmas (with a '%' -> scaled by the range of each variable)",
's',"Genotype Initialization");
// check if there is a vecSigmaInit
eoParam *vecSigmaParam = _parser.getParamWithLongName("vecSigmaInit");
if(vecSigmaParam) {

View file

@ -59,6 +59,7 @@ public:
using eoVector< FitT, bool >::begin;
using eoVector< FitT, bool >::end;
using eoVector< FitT, bool >::resize;
using eoVector< FitT, bool >::size;
/**