cMHN
1.1
C++ library for learning MHNs with pRC
Loading...
Searching...
No Matches
pRC
prc
tensor_train
tensor
views
random.hpp
Go to the documentation of this file.
1
// SPDX-License-Identifier: BSD-2-Clause
2
3
#ifndef pRC_TENSOR_TRAIN_TENSOR_VIEWS_RANDOM_H
4
#define pRC_TENSOR_TRAIN_TENSOR_VIEWS_RANDOM_H
5
6
#include <
prc/core/basic/functions/random.hpp
>
7
#include <
prc/tensor_train/tensor/type_traits.hpp
>
8
9
namespace
pRC::TensorTrain::TensorViews
10
{
11
template
<
class
T
,
class
N,
class
Ranks,
template
<
class
...>
class
D
>
12
class
Random
:
public
View
<T, N, Ranks, Random<T, N, Ranks, D>>
13
{
14
private
:
15
using
Base
=
View<T, N, Ranks, Random>
;
16
17
public
:
18
Random
(
RandomEngine
&
rng
,
D<typename T::Value>
&
distribution
)
19
: mRNG(
rng
)
20
, mDistribution(
distribution
)
21
{
22
}
23
24
template
<Index C>
25
constexpr
decltype
(
auto
)
core
()
26
{
27
using
Core
=
typename
Base::template
Cores<C>
;
28
return
random<Core>
(mRNG, mDistribution);
29
}
30
31
private
:
32
RandomEngine
&mRNG;
33
D<typename T::Value>
&mDistribution;
34
};
35
}
36
#endif
// pRC_TENSOR_TRAIN_TENSOR_VIEWS_RANDOM_H
D
pRC::Size const D
Definition
CalculatePThetaTests.cpp:9
pRC::TensorTrain::TensorViews::Random
Definition
random.hpp:13
pRC::TensorTrain::TensorViews::Random::Random
Random(RandomEngine &rng, D< typename T::Value > &distribution)
Definition
random.hpp:18
pRC::TensorTrain::TensorViews::Random::core
constexpr decltype(auto) core()
Definition
random.hpp:25
pRC::TensorTrain::TensorViews::View
Definition
type_traits.hpp:37
pRC::Threefry
Definition
threefry.hpp:24
random.hpp
T
pRC::Float<> T
Definition
externs_nonTT.hpp:1
pRC::TensorTrain::TensorViews
Definition
type_traits.hpp:35
pRC::makeConstantSequence
static constexpr auto makeConstantSequence()
Definition
sequence.hpp:402
type_traits.hpp
Generated by
1.10.0