mirror of
https://github.com/triqs/dft_tools
synced 2024-12-25 05:43:40 +01:00
rng : preview
This commit is contained in:
parent
22ef7ac015
commit
edca014785
@ -33,7 +33,13 @@ namespace boost{
|
||||
buf->fill();
|
||||
return *cur++;
|
||||
}
|
||||
generator(generator<R> const & rhs)
|
||||
inline R const preview() {
|
||||
if (cur == end)
|
||||
buf->fill();
|
||||
return *cur;
|
||||
}
|
||||
|
||||
generator(generator<R> const & rhs)
|
||||
:
|
||||
buf(new buffer (*rhs.buf))
|
||||
, cur(buf->cur)
|
||||
|
@ -59,6 +59,9 @@ namespace mc_tools {
|
||||
INTEGER_OVERLOAD(size_t)
|
||||
#undef INTEGER_OVERLOAD
|
||||
|
||||
/// Returns a double in [0,1[ with flat distribution
|
||||
double preview() { return gen->preview();}
|
||||
|
||||
/// Returns a double in [0,1[ with flat distribution
|
||||
double operator()() { return ((*gen)());}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user