diff --git a/eo/test/ChangeLog b/eo/test/ChangeLog index 77cefa02..bb827673 100644 --- a/eo/test/ChangeLog +++ b/eo/test/ChangeLog @@ -1,3 +1,9 @@ +2006-12-04 Jochen Küpper + + * Makefile.am: Add t-eoRNG + + * t-eoRNG.cpp: Start test for random number generator. + 2006-12-02 Jochen Küpper * t-MGE1bit.cpp: Change float to double. diff --git a/eo/test/Makefile.am b/eo/test/Makefile.am index 65b88165..703e427f 100644 --- a/eo/test/Makefile.am +++ b/eo/test/Makefile.am @@ -38,7 +38,8 @@ check_PROGRAMS = t-eoParetoFitness \ t-eoFitnessAssembledEA \ t-eoRoulette \ t-eoSharing \ - t-eoCMAES + t-eoCMAES \ + t-eoRNG TESTS = $(check_PROGRAMS) \ @@ -91,3 +92,4 @@ t_eoFitnessAssembled_SOURCES = t-eoFitnessAssembled.cpp t_eoRoulette_SOURCES = t-eoRoulette.cpp t_eoSharing_SOURCES = t-eoSharing.cpp t_eoCMAES_SOURCES = t-eoCMAES.cpp +t_eoRNG_SOURCES = t-eoRNG.cpp diff --git a/eo/test/t-eoRNG.cpp b/eo/test/t-eoRNG.cpp new file mode 100644 index 00000000..4ff94170 --- /dev/null +++ b/eo/test/t-eoRNG.cpp @@ -0,0 +1,53 @@ +//----------------------------------------------------------------------------- +// t-rng.cpp +//----------------------------------------------------------------------------- + +// This file really needs to be implementes usign some stringent tests, for now +// we simply check that the impementation of some methods does generally work... + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include + + +using namespace std; + + +int main() +{ + const size_t num(10000); + double mean(100.); + double sigma(5.); + double sum(0.); + for(size_t i=0; i sigma / 0.68) { + cerr << "Normal distribution seems out of bounds; " + << "rerun to make sure it wasn't a statistical outlier" << endl; + return -1; + } + sum = 0.; + for(size_t i=0; i sigma / 0.68) { + cerr << "Normal distribution seems out of bounds; " + << "rerun to make sure it wasn't a statistical outlier" << endl; + return -1; + } + return 0; +} + + +// Local Variables: +// coding: iso-8859-1 +// mode: C++ +// c-file-offsets: ((c . 0)) +// c-file-style: "Stroustrup" +// fill-column: 80 +// End: