pRC
multi-purpose Tensor Train library for C++
Loading...
Searching...
No Matches
prc
tensor_train
tensor
random.hpp
Go to the documentation of this file.
1
// SPDX-License-Identifier: BSD-2-Clause
2
3
#ifndef pRC_TENSOR_TRAIN_TENSOR_RANDOM_H
4
#define pRC_TENSOR_TRAIN_TENSOR_RANDOM_H
5
6
#include <
prc/core/basic/random.hpp
>
7
#include <
prc/tensor_train/tensor/views/random.hpp
>
8
9
namespace
pRC
10
{
11
template
<
class
T
,
class
N,
class
Ranks,
template
<
class
...>
class
D
>
12
struct
Random
<TensorTrain::
Tensor
<T, N, Ranks>,
D
<typename T::Value>,
13
If
<IsDistribution<D<typename T::Value>>>>
14
{
15
public
:
16
Random
(
RandomEngine
&
rng
,
D<typename T::Value>
&
distribution
)
17
: mRNG(
rng
)
18
, mDistribution(
distribution
)
19
{
20
}
21
22
constexpr
auto
operator()
()
23
{
24
return
TensorTrain::TensorViews::Random<T, N, Ranks, D>
(mRNG,
25
mDistribution);
26
}
27
28
private
:
29
RandomEngine
&mRNG;
30
D<typename T::Value>
&mDistribution;
31
};
32
}
33
#endif
// pRC_TENSOR_TRAIN_TENSOR_RANDOM_H
pRC::TensorTrain::TensorViews::Random
Definition
random.hpp:13
pRC::Tensor
Class storing tensors.
Definition
tensor.hpp:44
pRC::Threefry
Definition
threefry.hpp:24
random.hpp
pRC
Definition
cholesky.hpp:18
pRC::If
std::enable_if_t< B{}, int > If
Definition
type_traits.hpp:68
pRC::copy
static constexpr Conditional< IsSatisfied< C >, RemoveConstReference< X >, X > copy(X &&a)
Definition
copy.hpp:13
pRC::Random< TensorTrain::Tensor< T, N, Ranks >, D< typename T::Value >, If< IsDistribution< D< typename T::Value > > > >::operator()
constexpr auto operator()()
Definition
random.hpp:22
pRC::Random< TensorTrain::Tensor< T, N, Ranks >, D< typename T::Value >, If< IsDistribution< D< typename T::Value > > > >::Random
Random(RandomEngine &rng, D< typename T::Value > &distribution)
Definition
random.hpp:16
pRC::Random
Definition
random.hpp:12
random.hpp
Generated by
1.9.8