Chromium Code Reviews| Index: src/IceRNG.h |
| diff --git a/src/IceRNG.h b/src/IceRNG.h |
| index 423aee00e233110a5aeb783ffcda8ba07661781a..4372b70fab66c24ba28801a7c98d1526e1f25ac8 100644 |
| --- a/src/IceRNG.h |
| +++ b/src/IceRNG.h |
| @@ -28,6 +28,19 @@ private: |
| uint64_t State; |
| }; |
| +// This class adds additional random number generator utilities. The |
| +// reason for the wrapper class is that we want to keep the |
| +// RandomNumberGenerator interface identical to LLVM's. |
| +class RandomNumberGeneratorWrapper { |
|
Jim Stichnoth
2014/08/14 01:10:29
Here and above, add the usual boilerplate disablin
wala
2014/08/15 03:37:23
Done.
|
| +public: |
| + uint64_t next(uint64_t Max) { return RNG.next(Max); } |
| + uint64_t operator()(uint64_t Max) { return RNG.next(Max); } |
| + bool getTrueWithProbability(float Probability); |
| + RandomNumberGeneratorWrapper(RandomNumberGenerator &RNG) : RNG(RNG) {} |
| +private: |
| + RandomNumberGenerator &RNG; |
| +}; |
| + |
| } // end of namespace Ice |
| #endif // SUBZERO_SRC_ICERNG_H |