mirror of
https://github.com/triqs/dft_tools
synced 2024-12-26 06:14:14 +01:00
rng : preview
This commit is contained in:
parent
22ef7ac015
commit
edca014785
@ -33,7 +33,13 @@ namespace boost{
|
|||||||
buf->fill();
|
buf->fill();
|
||||||
return *cur++;
|
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))
|
buf(new buffer (*rhs.buf))
|
||||||
, cur(buf->cur)
|
, cur(buf->cur)
|
||||||
|
@ -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)());}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user