Revert "fix!(eoBit): defaults to char for scalar type"
This reverts commit 06e0cc0162b6f753d92076c510d7124d82a3def1.
This commit is contained in:
parent
93e89828b8
commit
c442d8a0a2
5 changed files with 9 additions and 9 deletions
|
|
@ -41,7 +41,7 @@ template <class FitT>
|
|||
class eoInitVirus: public eoInit< eoVirus<FitT> > {
|
||||
public:
|
||||
|
||||
eoInitVirus(unsigned _combien, eoRndGenerator<char>& _generator )
|
||||
eoInitVirus(unsigned _combien, eoRndGenerator<bool>& _generator )
|
||||
: combien(_combien), generator(_generator) {}
|
||||
|
||||
virtual void operator()( eoVirus<FitT>& chrom)
|
||||
|
|
@ -58,7 +58,7 @@ public:
|
|||
private :
|
||||
unsigned combien;
|
||||
/// generic wrapper for eoFunctor (s), to make them have the function-pointer style copy semantics
|
||||
eoSTLF<char> generator;
|
||||
eoSTLF<bool> generator;
|
||||
};
|
||||
|
||||
/// Inits the virus with one bit to the left set to one
|
||||
|
|
@ -66,7 +66,7 @@ template <class FitT>
|
|||
class eoInitVirus1bit: public eoInit< eoVirus<FitT> > {
|
||||
public:
|
||||
|
||||
eoInitVirus1bit(unsigned _combien, eoRndGenerator<char>& _generator )
|
||||
eoInitVirus1bit(unsigned _combien, eoRndGenerator<bool>& _generator )
|
||||
: combien(_combien), generator(_generator) {}
|
||||
|
||||
virtual void operator()( eoVirus<FitT>& chrom)
|
||||
|
|
@ -81,6 +81,6 @@ public:
|
|||
private :
|
||||
unsigned combien;
|
||||
/// generic wrapper for eoFunctor (s), to make them have the function-pointer style copy semantics
|
||||
eoSTLF<char> generator;
|
||||
eoSTLF<bool> generator;
|
||||
};
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -60,12 +60,12 @@ Example of a complete test program that use various bitstrings operators:
|
|||
Based on STL's std::vector<bool> specialization.
|
||||
*/
|
||||
|
||||
template <class FitT, class ScalarT = char>
|
||||
template <class FitT, class ScalarT = bool>
|
||||
|
||||
class eoBit: public eoVector<FitT, ScalarT>
|
||||
{
|
||||
public:
|
||||
using ScalarType = ScalarT;
|
||||
using ScalarType = ScalarT;
|
||||
|
||||
using eoVector< FitT, ScalarType >::begin;
|
||||
using eoVector< FitT, ScalarType >::end;
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@ eoInit<EOT> & do_make_genotype(eoParser& _parser, eoState& _state, EOT, float _b
|
|||
|
||||
// Then we can built a bitstring random initializer
|
||||
// based on boolean_generator class (see utils/rnd_generator.h)
|
||||
eoBooleanGenerator<char> * gen = new eoBooleanGenerator<char>(_bias);
|
||||
eoBooleanGenerator<bool> * gen = new eoBooleanGenerator<bool>(_bias);
|
||||
_state.storeFunctor(gen);
|
||||
eoInitFixedLength<EOT>* init = new eoInitFixedLength<EOT>(theSize, *gen);
|
||||
// store in state
|
||||
|
|
|
|||
|
|
@ -115,7 +115,7 @@ inline bool eoUniformGenerator<bool>::operator()(void)
|
|||
to easily generate random booleans with a specified bias
|
||||
\ingroup bitstring
|
||||
*/
|
||||
template<class T=char>
|
||||
template<class T=bool>
|
||||
class eoBooleanGenerator : public eoRndGenerator<T>
|
||||
{
|
||||
public :
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ int main() {
|
|||
nkLandscapesEval<Solution> eval(N, K);
|
||||
|
||||
// init
|
||||
eoUniformGenerator<char> uGen;
|
||||
eoUniformGenerator<bool> uGen;
|
||||
eoInitFixedLength<Solution> init(N, uGen);
|
||||
|
||||
// verif constructor
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue