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.
32 lines
402 B
32 lines
402 B
3 years ago
|
#pragma once
|
||
|
|
||
|
#include "common.h"
|
||
|
|
||
|
namespace rng
|
||
|
{
|
||
|
template<typename T>
|
||
|
struct seed_gen
|
||
|
{
|
||
|
virtual T generate_seed() = 0;
|
||
|
|
||
|
inline virtual ~seed_gen(){}
|
||
|
};
|
||
|
|
||
|
namespace seed
|
||
|
{
|
||
|
typedef u64 sm128r[2];
|
||
|
struct sm128 {
|
||
|
sm128r m_raw;
|
||
|
};
|
||
|
|
||
|
struct splitmix64 : public virtual seed_gen<sm128>
|
||
|
{
|
||
|
splitmix64(u64 i);
|
||
|
|
||
|
sm128 generate_seed() override;
|
||
|
private:
|
||
|
sm128r m_state;
|
||
|
};
|
||
|
}
|
||
|
}
|