mercredi 21 septembre 2016

Making own random number class compitible with uniform_int_distribution

I created a class which is implementing MersenneTwister algorithm to generate pseudo-random numbers. My question is how can I make my generator work with default std::uniform_int_distribution? Header of my class is given below:

class MersenneTwister
{
public:
    void initialize(unsigned int seed);
    unsigned int extract();

private:
    unsigned int twist();
    unsigned int _x[624];
    signed int _index;
};




Aucun commentaire:

Enregistrer un commentaire