Default template added

git-svn-id: svn://scm.gforge.inria.fr/svnroot/paradiseo@1245 331e1502-861f-0410-8da2-ba01fb791d7f
This commit is contained in:
jhumeau 2008-11-10 14:30:52 +00:00
commit 34f2354d78
4 changed files with 15 additions and 15 deletions

View file

@ -88,7 +88,7 @@
**/
template < class MOEOObjectiveVector, class MOEOFitness, class MOEODiversity >
template < class MOEOObjectiveVector, class MOEOFitness=double, class MOEODiversity=double >
class MOEO : public EO < MOEOObjectiveVector >
{
public:

View file

@ -43,15 +43,15 @@
/**
* This class is an implementationeo of a simple bit-valued moeoVector.
*/
template < class MOEOObjectiveVector, class MOEOFitness, class MOEODiversity >
class moeoBitVector : public moeoVector < MOEOObjectiveVector, MOEOFitness, MOEODiversity, bool >
template < class MOEOObjectiveVector, class MOEOFitness=double, class MOEODiversity=double >
class moeoBitVector : public moeoVector < MOEOObjectiveVector, bool, MOEOFitness, MOEODiversity >
{
public:
using moeoVector < MOEOObjectiveVector, MOEOFitness, MOEODiversity, bool > :: begin;
using moeoVector < MOEOObjectiveVector, MOEOFitness, MOEODiversity, bool > :: end;
using moeoVector < MOEOObjectiveVector, MOEOFitness, MOEODiversity, bool > :: resize;
using moeoVector < MOEOObjectiveVector, MOEOFitness, MOEODiversity, bool > :: size;
using moeoVector < MOEOObjectiveVector, bool, MOEOFitness, MOEODiversity > :: begin;
using moeoVector < MOEOObjectiveVector, bool, MOEOFitness, MOEODiversity > :: end;
using moeoVector < MOEOObjectiveVector, bool, MOEOFitness, MOEODiversity > :: resize;
using moeoVector < MOEOObjectiveVector, bool, MOEOFitness, MOEODiversity > :: size;
/**
@ -59,7 +59,7 @@ class moeoBitVector : public moeoVector < MOEOObjectiveVector, MOEOFitness, MOEO
* @param _size Length of vector (default is 0)
* @param _value Initial value of all elements (default is default value of type GeneType)
*/
moeoBitVector(unsigned int _size = 0, bool _value = false) : moeoVector< MOEOObjectiveVector, MOEOFitness, MOEODiversity, bool >(_size, _value)
moeoBitVector(unsigned int _size = 0, bool _value = false) : moeoVector< MOEOObjectiveVector, bool, MOEOFitness, MOEODiversity >(_size, _value)
{}

View file

@ -43,8 +43,8 @@
/**
* This class is an implementation of a simple double-valued moeoVector.
*/
template < class MOEOObjectiveVector, class MOEOFitness, class MOEODiversity >
class moeoRealVector : public moeoVector < MOEOObjectiveVector, MOEOFitness, MOEODiversity, double >
template < class MOEOObjectiveVector, class MOEOFitness=double, class MOEODiversity=double >
class moeoRealVector : public moeoVector < MOEOObjectiveVector, double, MOEOFitness, MOEODiversity >
{
public:
@ -53,7 +53,7 @@ class moeoRealVector : public moeoVector < MOEOObjectiveVector, MOEOFitness, MOE
* @param _size Length of vector (default is 0)
* @param _value Initial value of all elements (default is default value of type GeneType)
*/
moeoRealVector(unsigned int _size = 0, double _value = 0.0) : moeoVector< MOEOObjectiveVector, MOEOFitness, MOEODiversity, double >(_size, _value)
moeoRealVector(unsigned int _size = 0, double _value = 0.0) : moeoVector< MOEOObjectiveVector, double, MOEOFitness, MOEODiversity >(_size, _value)
{}

View file

@ -46,7 +46,7 @@
* Base class for fixed length chromosomes, just derives from MOEO and std::vector and redirects the smaller than operator to MOEO (objective vector based comparison).
* GeneType must have the following methods: void ctor (needed for the std::vector<>), copy ctor.
*/
template < class MOEOObjectiveVector, class MOEOFitness, class MOEODiversity, class GeneType >
template < class MOEOObjectiveVector, class GeneType, class MOEOFitness=double, class MOEODiversity=double >
class moeoVector : public MOEO < MOEOObjectiveVector, MOEOFitness, MOEODiversity >, public std::vector < GeneType >
{
public:
@ -101,7 +101,7 @@ class moeoVector : public MOEO < MOEOObjectiveVector, MOEOFitness, MOEODiversity
* To avoid conflicts between MOEO::operator< and std::vector<GeneType>::operator<
* @param _moeo the object to compare with
*/
bool operator<(const moeoVector< MOEOObjectiveVector, MOEOFitness, MOEODiversity, GeneType> & _moeo) const
bool operator<(const moeoVector< MOEOObjectiveVector, GeneType, MOEOFitness, MOEODiversity> & _moeo) const
{
return MOEO < MOEOObjectiveVector, MOEOFitness, MOEODiversity >::operator<(_moeo);
}
@ -148,7 +148,7 @@ class moeoVector : public MOEO < MOEOObjectiveVector, MOEOFitness, MOEODiversity
* @param _moeo2 the second object to compare
*/
template < class MOEOObjectiveVector, class MOEOFitness, class MOEODiversity, class GeneType >
bool operator<(const moeoVector< MOEOObjectiveVector, MOEOFitness, MOEODiversity, GeneType> & _moeo1, const moeoVector< MOEOObjectiveVector, MOEOFitness, MOEODiversity, GeneType> & _moeo2)
bool operator<(const moeoVector< MOEOObjectiveVector, GeneType, MOEOFitness, MOEODiversity> & _moeo1, const moeoVector< MOEOObjectiveVector, GeneType, MOEOFitness, MOEODiversity > & _moeo2)
{
return _moeo1.operator<(_moeo2);
}
@ -160,7 +160,7 @@ bool operator<(const moeoVector< MOEOObjectiveVector, MOEOFitness, MOEODiversity
* @param _moeo2 the second object to compare
*/
template < class MOEOObjectiveVector, class MOEOFitness, class MOEODiversity, class GeneType >
bool operator>(const moeoVector< MOEOObjectiveVector, MOEOFitness, MOEODiversity, GeneType> & _moeo1, const moeoVector< MOEOObjectiveVector, MOEOFitness, MOEODiversity, GeneType> & _moeo2)
bool operator>(const moeoVector< MOEOObjectiveVector, GeneType, MOEOFitness, MOEODiversity> & _moeo1, const moeoVector< MOEOObjectiveVector, GeneType, MOEOFitness, MOEODiversity > & _moeo2)
{
return _moeo1.operator>(_moeo2);
}