<commit_before>#include <cassert>
#include <vSMC/internal/random.hpp>

#ifdef V_SMC_USE_STD_RANDOM
using std::bernoulli_distribution;
using std::binomial_distribution;
using std::gamma_distribution;
using std::lognormal_distribution;
using std::normal_distribution;
using std::uniform_int_distribution;
using std::uniform_real_distribution;
#else
#include <boost/random/bernoulli_distribution.hpp>
#include <boost/random/gamma_distribution.hpp>
#include <boost/random/lognormal_distribution.hpp>
#include <boost/random/normal_distribution.hpp>
#include <boost/random/uniform_int_distribution.hpp>
#if BOOST_VERSION < 104700
using boost::bernoulli_distribution;
using boost::binomial_distribution;
using boost::gamma_distribution;
using boost::lognormal_distribution;
using boost::normal_distribution;
using boost::uniform_int_distribution;
using boost::uniform_real_distribution;
#else
using boost::random::bernoulli_distribution;
using boost::random::binomial_distribution;
using boost::random::gamma_distribution;
using boost::random::lognormal_distribution;
using boost::random::normal_distribution;
using boost::random::uniform_int_distribution;
using boost::random::uniform_real_distribution;
#endif
#endif

int main ()
{
    int N = 100000;
    r123::Engine<V_SMC_CRNG_TYPE> eng(V_SMC_CRNG_SEED);

    bernoulli_distribution<> rbern(0.5);
    for (int i = 0; i != N; ++i){
        int b = rbern(eng);
        assert(b == 0 || b == 1);
    }

    binomial_distribution<> rbinom(20, 0.7);
    for (int i = 0; i != N; ++i) {
        int b = rbinom(eng);
        assert(b >= 0 && b <= 20);
    }
<commit_msg>workaround of boost.random and c++11 ranodm differences<commit_after>#include <cassert>
#include <vSMC/internal/random.hpp>

#ifdef V_SMC_USE_STD_RANDOM
using std::bernoulli_distribution;
using std::binomial_distribution;
using std::gamma_distribution;
using std::lognormal_distribution;
using std::normal_distribution;
using std::uniform_int_distribution;
using std::uniform_real_distribution;
#else
#include <boost/random/bernoulli_distribution.hpp>
#include <boost/random/gamma_distribution.hpp>
#include <boost/random/lognormal_distribution.hpp>
#include <boost/random/normal_distribution.hpp>
#include <boost/random/uniform_int_distribution.hpp>
#if BOOST_VERSION < 104700
using boost::bernoulli_distribution;
using boost::binomial_distribution;
using boost::gamma_distribution;
using boost::lognormal_distribution;
using boost::normal_distribution;
using boost::uniform_int_distribution;
using boost::uniform_real_distribution;
#else
using boost::random::bernoulli_distribution;
using boost::random::binomial_distribution;
using boost::random::gamma_distribution;
using boost::random::lognormal_distribution;
using boost::random::normal_distribution;
using boost::random::uniform_int_distribution;
using boost::random::uniform_real_distribution;
#endif
#endif

int main ()
{
    int N = 100000;
    r123::Engine<V_SMC_CRNG_TYPE> eng(V_SMC_CRNG_SEED);

#ifdef V_SMC_USE_BOOST_RANDOM
    bernoulli_distribution<> rbern(0.5);
#else
    bernoulli_distribution rbern(0.5);
#endif
    for (int i = 0; i != N; ++i){
        int b = rbern(eng);
        assert(b == 0 || b == 1);
    }

    binomial_distribution<> rbinom(20, 0.7);
    for (int i = 0; i != N; ++i) {
        int b = rbinom(eng);
        assert(b >= 0 && b <= 20);
    }

{'fraction_non_alphanumeric': 0.12200956937799043, 'fraction_numerical': 0.017942583732057416, 'mean_word_length': 6.55079006772009, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 25, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1507380', 'n_tokens_mistral': 1195, 'n_tokens_neox': 1085, 'n_words': 222}