cMHN 1.1
C++ library for learning MHNs with pRC
Loading...
Searching...
No Matches
random.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: BSD-2-Clause
2
3#ifndef pRC_CORE_VALUE_RANDOM_H
4#define pRC_CORE_VALUE_RANDOM_H
5
8
9namespace pRC
10{
11 template<class T, template<class...> class D>
12 struct Random<T, D<T>, If<All<IsValue<T>, IsDistribution<D<T>>>>>
13 {
14 public:
16 : mRNG(rng)
17 , mDistribution(distribution)
18 {
19 }
20
21 constexpr auto operator()()
22 {
23 return mDistribution(mRNG);
24 }
25
26 private:
27 RandomEngine &mRNG;
28 D<T> &mDistribution;
29 };
30}
31#endif // pRC_CORE_VALUE_RANDOM_H
pRC::Size const D
Definition CalculatePThetaTests.cpp:9
Definition threefry.hpp:24
pRC::Float<> T
Definition externs_nonTT.hpp:1
Definition cholesky.hpp:18
static constexpr auto makeConstantSequence()
Definition sequence.hpp:402
std::enable_if_t< B{}, int > If
Definition type_traits.hpp:68
std::conjunction< Bs... > All
Definition type_traits.hpp:77
Any< IsFloat< T >, IsInteger< T > > IsValue
Definition type_traits.hpp:72
Definition type_traits.hpp:32
Random(RandomEngine &rng, D< T > &distribution)
Definition random.hpp:15
Definition random.hpp:12