#include #include #include #include "Box_muller.h" #include "Central_limit_theorem.h" #include "Marsaglia_polar.h" #include "Ratio.h" void build_maze( int, int ); int main() { int N = 1000000000; srand48( time(0) ); double s = drand48(); int t = time(0); for ( int i = 0; i < N; ++i ) { s += 0.1; } std::cout << "Default: " << time(0) - t << std::endl; t = time(0); for ( int i = 0; i < N; ++i ) { s += Normal_distributions::Box_muller::randn(); } std::cout << "Box-Muller method: " << time(0) - t << std::endl; t = time(0); for ( int i = 0; i < N; ++i ) { s += Normal_distributions::Central_limit_theorem::randn(); } std::cout << std::endl << "Central Limit Theorem: " << time(0) - t << std::endl; t = time(0); for ( int i = 0; i < N; ++i ) { s += Normal_distributions::Marsaglia_polar::randn(); } std::cout << std::endl << "Marsaglia polar method: " << time(0) - t << std::endl; t = time(0); for ( int i = 0; i < N; ++i ) { s += Normal_distributions::Ratio::randn(); } std::cout << std::endl << "Ratio method: " << time(0) - t << std::endl; std::cout << s << std::endl; return 0; }