cMHN 1.2
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_TENSOR_TRAIN_OPERATOR_VIEWS_RANDOM_H
4#define pRC_TENSOR_TRAIN_OPERATOR_VIEWS_RANDOM_H
5
9
11{
12 template<class T, class M, class N, class Ranks, class URNG,
13 template<class...> class D>
14 class Random : public View<T, M, N, Ranks, Random<T, M, N, Ranks, URNG, D>>
15 {
16 private:
18
19 public:
20 Random(URNG &rng, D<Value<T>> &distribution)
21 : mRNG(rng)
22 , mDistribution(distribution)
23 {
24 }
25
26 template<Index C>
27 constexpr decltype(auto) core()
28 {
29 using Core = typename Base::template Cores<C>;
30 return random<Core>(mRNG, mDistribution);
31 }
32
33 private:
34 URNG &mRNG;
35 D<Value<T>> &mDistribution;
36 };
37}
38#endif // pRC_TENSOR_TRAIN_OPERATOR_VIEWS_RANDOM_H
pRC::Size const D
Definition CalculatePThetaTests.cpp:9
constexpr decltype(auto) core()
Definition random.hpp:27
Random(URNG &rng, D< Value< T > > &distribution)
Definition random.hpp:20
Definition declarations.hpp:25
pRC::Float<> T
Definition externs_nonTT.hpp:1
Definition declarations.hpp:23
typename ValueType< T >::Type Value
Definition value.hpp:72
static constexpr auto random(URNG &rng, D &distribution)
Definition random.hpp:13