15 #ifndef QMCPLUSPLUS_STDRAND_H 16 #define QMCPLUSPLUS_STDRAND_H 38 static_assert(std::is_floating_point_v<T>);
42 template<
typename RNG>
45 return static_cast<result_type>(eng() - eng.min()) / (static_cast<result_type>(eng.max() - eng.min()) + 1) *
64 void init(
int iseed_in)
override 72 void write(std::ostream& rout)
const override { rout <<
engine; }
76 void load(
const std::vector<uint_type>& newstate)
override;
77 void save(std::vector<uint_type>& curstate)
const override;
78 std::unique_ptr<RandomBase<T>>
makeClone()
const override {
return std::make_unique<StdRandom<T>>(*this); }
uniform_real_distribution_as_boost(T min=T(0.0), T max=T(1.0))
helper functions for EinsplineSetBuilder
std::unique_ptr< RandomBase< T > > makeClone() const override
void read(std::istream &rin) override
void write(std::ostream &rout) const override
RngValueType< T > result_type
result_type operator()(RNG &eng)
Generating functions.
generating real type random numbers [min, max) in a uniform distribution.
result_type operator()() override
std::size_t stream_state_size
the number count of streaming states. Must match read/write/load/save
void load(const std::vector< uint_type > &newstate) override
void save(std::vector< uint_type > &curstate) const override
RngValueType< T > result_type
typename RandomBase< T >::result_type result_type
size_t state_size() const override
void init(int iseed_in) override
void seed(uint_type aseed) override
StdRandom(uint_type iseed=911)
uniform_real_distribution_as_boost< T > distribution
random number generator [0,1)