3
0
mirror of https://github.com/triqs/dft_tools synced 2024-12-25 22:03:43 +01:00

rng : preview

This commit is contained in:
Olivier Parcollet 2014-04-02 20:36:54 +02:00
parent 22ef7ac015
commit edca014785
2 changed files with 10 additions and 1 deletions

View File

@ -33,6 +33,12 @@ namespace boost{
buf->fill(); buf->fill();
return *cur++; return *cur++;
} }
inline R const preview() {
if (cur == end)
buf->fill();
return *cur;
}
generator(generator<R> const & rhs) generator(generator<R> const & rhs)
: :
buf(new buffer (*rhs.buf)) buf(new buffer (*rhs.buf))

View File

@ -59,6 +59,9 @@ namespace mc_tools {
INTEGER_OVERLOAD(size_t) INTEGER_OVERLOAD(size_t)
#undef INTEGER_OVERLOAD #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 /// Returns a double in [0,1[ with flat distribution
double operator()() { return ((*gen)());} double operator()() { return ((*gen)());}