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_TENSOR_RANDOM_H
4#define pRC_CORE_TENSOR_RANDOM_H
5
8
9namespace pRC
10{
11 template<class T, Size... Ns, template<class...> class D>
12 struct Random<Tensor<T, Ns...>, D<typename T::Value>,
13 If<IsDistribution<D<typename T::Value>>>>
14 {
15 public:
17 : mRNG(rng)
18 , mDistribution(distribution)
19 {
20 }
21
22 constexpr auto operator()()
23 {
24 return TensorViews::Random<T, Sizes<Ns...>, D>(mRNG, mDistribution);
25 }
26
27 private:
28 RandomEngine &mRNG;
29 D<typename T::Value> &mDistribution;
30 };
31}
32#endif // pRC_CORE_TENSOR_RANDOM_H
pRC::Size const D
Definition CalculatePThetaTests.cpp:9
Definition sequence.hpp:56
Definition random.hpp:15
Definition tensor.hpp:28
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::size_t Size
Definition type_traits.hpp:20
std::enable_if_t< B{}, int > If
Definition type_traits.hpp:68
Random(RandomEngine &rng, D< typename T::Value > &distribution)
Definition random.hpp:16
Definition random.hpp:12