Modified eoInit so that it would use the eoRndGenerator base class.
To be able to use the primitive std::generate function, added a set of wrappers in eoSTLFunctor.h that have the copy semantics most STL functions expect (namely pass-by-value rather then pass-by-reference). Updated test/Makefile.am to also test t-eoRandom
This commit is contained in:
parent
e28211188a
commit
a79075f673
11 changed files with 240 additions and 83 deletions
|
|
@ -43,12 +43,18 @@ class eoVector : public EO<FitT>, public std::vector<GeneType>
|
|||
typedef GeneType AtomType;
|
||||
typedef std::vector<GeneType> ContainerType;
|
||||
|
||||
|
||||
eoVector(unsigned size = 0, GeneType value = GeneType()) : EO<FitT>(), std::vector<GeneType>(size, value)
|
||||
{}
|
||||
|
||||
/// copy ctor abstracting from the FitT
|
||||
template <class OtherFitnessType>
|
||||
eoVector(const eoVector<OtherFitnessType, GeneType>& _vec) : vector<GeneType>(_vec)
|
||||
{}
|
||||
|
||||
// we can't have a Ctor from a vector, it would create ambiguity
|
||||
// with the copy Ctor
|
||||
void value(std::vector<GeneType> _v)
|
||||
void value(const std::vector<GeneType>& _v)
|
||||
{
|
||||
if (_v.size() != size())
|
||||
throw runtime_error("Wrong size in vector assignation in eoVector");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue