/******************************************************************************* * * TRIQS: a Toolbox for Research in Interacting Quantum Systems * * Copyright (C) 2011 by M. Ferrero, O. Parcollet * * TRIQS is free software: you can redistribute it and/or modify it under the * terms of the GNU General Public License as published by the Free Software * Foundation, either version 3 of the License, or (at your option) any later * version. * * TRIQS is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. * * You should have received a copy of the GNU General Public License along with * TRIQS. If not, see . * ******************************************************************************/ #include "random_generator.hpp" #include "./MersenneRNG.hpp" #include //#include #include //#include #include #include #include #include #include #include #define AS_STRING(X) AS_STRING2(X) #define AS_STRING2(X) #X // List of All available Boost random number generator #define RNG_LIST (mt19937)(mt11213b)\ (lagged_fibonacci607) (lagged_fibonacci1279) (lagged_fibonacci2281) (lagged_fibonacci3217) (lagged_fibonacci4423)\ (lagged_fibonacci9689) (lagged_fibonacci19937) (lagged_fibonacci23209) (lagged_fibonacci44497) (ranlux3) namespace triqs { namespace mc_tools { typedef boost::generator gen_type; inline gen_type * choose_gen(std::string const & RandomGeneratorName, std::size_t seed_, boost::shared_ptr &ptr) { if (RandomGeneratorName=="") return new gen_type( mc_tools::RandomGenerators::RandMT (seed_)); // now boost random number generators #define DRNG(r,data,XX) if (RandomGeneratorName==AS_STRING(XX)) { \ boost::shared_ptr localptr = boost::make_shared(seed_);\ ptr = localptr; boost::uniform_real<> dis;\ return new gen_type( boost::variate_generator >(*localptr,dis));} BOOST_PP_SEQ_FOR_EACH(DRNG,~,RNG_LIST) TRIQS_RUNTIME_ERROR<<"The random generator "<