normal.cpp 629 B

123456789101112131415161718192021222324252627
  1. #include "normal.h"
  2. #include "common_ops.h"
  3. #include "random.h"
  4. namespace {
  5. template <class T>
  6. struct TSysRNG: public TCommonRNG<T, TSysRNG<T>> {
  7. inline T GenRand() noexcept {
  8. return RandomNumber<T>();
  9. }
  10. };
  11. } // namespace
  12. template <>
  13. float StdNormalRandom<float>() noexcept {
  14. return StdNormalDistribution<float>(TSysRNG<ui64>());
  15. }
  16. template <>
  17. double StdNormalRandom<double>() noexcept {
  18. return StdNormalDistribution<double>(TSysRNG<ui64>());
  19. }
  20. template <>
  21. long double StdNormalRandom<long double>() noexcept {
  22. return StdNormalDistribution<long double>(TSysRNG<ui64>());
  23. }