cMHN
1.2
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/core/basic/random.hpp
>
8
#include <
prc/tensor_train/tensor/declarations.hpp
>
9
10
namespace
pRC::TensorTrain::TensorViews
11
{
12
template
<
class
T
,
class
N,
class
Ranks,
class
URNG,
13
template
<
class
...>
class
D
>
14
class
Random
:
public
View
<T, N, Ranks, Random<T, N, Ranks, URNG, D>>
15
{
16
private
:
17
using
Base
=
View<T, N, Ranks, Random>
;
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_TENSOR_VIEWS_RANDOM_H
D
pRC::Size const D
Definition
CalculatePThetaTests.cpp:9
pRC::TensorTrain::TensorViews::Random
Definition
random.hpp:15
pRC::TensorTrain::TensorViews::Random::Random
Random(URNG &rng, D< Value< T > > &distribution)
Definition
random.hpp:20
pRC::TensorTrain::TensorViews::Random::core
constexpr decltype(auto) core()
Definition
random.hpp:27
pRC::TensorTrain::TensorViews::View
Definition
declarations.hpp:21
random.hpp
random.hpp
T
pRC::Float<> T
Definition
externs_nonTT.hpp:1
pRC::TensorTrain::TensorViews
Definition
declarations.hpp:19
pRC::Value
typename ValueType< T >::Type Value
Definition
value.hpp:72
pRC::random
static constexpr auto random(URNG &rng, D &distribution)
Definition
random.hpp:13
declarations.hpp
Generated by
1.11.0