aboutsummaryrefslogtreecommitdiffstats
path: root/util/random/normal.cpp
blob: 478b38fd2509d919861aac4ac136ea35c7468075 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#include "normal.h"
#include "common_ops.h"
#include "random.h"

namespace {
    template <class T>
    struct TSysRNG: public TCommonRNG<T, TSysRNG<T>> {
        inline T GenRand() noexcept {
            return RandomNumber<T>();
        }
    };
}

template <>
float StdNormalRandom<float>() noexcept {
    return StdNormalDistribution<float>(TSysRNG<ui64>());
}

template <>
double StdNormalRandom<double>() noexcept {
    return StdNormalDistribution<double>(TSysRNG<ui64>());
}

template <>
long double StdNormalRandom<long double>() noexcept {
    return StdNormalDistribution<long double>(TSysRNG<ui64>());
}