直接使用梅森旋转来产生随机数
#include <random>
#include <utility>
static std::random_device rd;
static std::mt19937_64 rg(rd());
int32_t random_int(int32_t _a, int32_t _b )
{
if (_a > _b)
std::swap(_a, _b);
std::uniform_int_distribution<> dist(_a, _b);
return dist(rg);
}
// 产生小数随机数
std::uniform_real_distribution<double> distribution(-1, 1);