You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
381 B
23 lines
381 B
4 years ago
|
|
||
|
#include "impl.hpp"
|
||
4 years ago
|
#include <debug.h>
|
||
4 years ago
|
namespace rng
|
||
|
{
|
||
|
struct drng : public RNG
|
||
|
{
|
||
4 years ago
|
inline drng(std::uint32_t seed) : state(seed){
|
||
|
D_dprintf("drng: seeded with %u", seed);
|
||
|
//dprintf(" dummy run sample: %f", sample());
|
||
|
}
|
||
4 years ago
|
inline drng() : drng(1){}
|
||
|
|
||
|
static drng from_time();
|
||
|
|
||
|
int rand();
|
||
|
protected:
|
||
|
double sample() override;
|
||
|
private:
|
||
|
std::uint32_t state;
|
||
|
};
|
||
|
}
|