cMHN
1.2
C++ library for learning MHNs with pRC
Loading...
Searching...
No Matches
pRC
prc
tensor_train
operator
views
backwards.hpp
Go to the documentation of this file.
1
// SPDX-License-Identifier: BSD-2-Clause
2
3
#ifndef pRC_TENSOR_TRAIN_OPERATOR_VIEWS_BACKWARDS_H
4
#define pRC_TENSOR_TRAIN_OPERATOR_VIEWS_BACKWARDS_H
5
6
#include <
prc/core/basic/sequence.hpp
>
7
#include <
prc/tensor_train/operator/declarations.hpp
>
8
9
namespace
pRC::TensorTrain::OperatorViews
10
{
11
template
<
class
T,
class
M,
class
N,
class
Ranks,
class
V>
12
requires
IsOperatorView<V>
13
class
Backwards
14
:
public
Conditional
<IsAssignable<V>,
15
Assignable<T, M, N, Ranks, Backwards<T, M, N, Ranks, V>>,
16
View<T, M, N, Ranks, Backwards<T, M, N, Ranks, V>>>
17
{
18
private
:
19
using
Base
=
20
Conditional<IsAssignable<V>
,
Assignable<T, M, N, Ranks, Backwards>
,
21
View<T, M, N, Ranks, Backwards>
>;
22
23
public
:
24
template
<
class
X>
25
requires
IsSame<V, RemoveReference<X>
>
26
Backwards
(X &&a)
27
: mA(forward<X>(a))
28
{
29
}
30
31
using
Base::operator=;
32
33
template
<Index C>
34
constexpr
decltype
(
auto
)
core
()
35
{
36
constexpr
auto
B = Base::Dimension - C - 1;
37
38
return
permute<3, 1, 2, 0>
(mA.template
core<B>
());
39
}
40
41
template
<Index C>
42
constexpr
decltype
(
auto
)
core
()
const
43
{
44
constexpr
auto
B = Base::Dimension - C - 1;
45
46
return
permute<3, 1, 2, 0>
(mA.template
core<B>
());
47
}
48
49
private
:
50
V mA;
51
};
52
}
53
#endif
// pRC_TENSOR_TRAIN_OPERATOR_VIEWS_BACKWARDS_H
Base
Definition
gtest_unittest.cc:5120
pRC::TensorTrain::OperatorViews::Assignable
Definition
assignable.hpp:13
pRC::TensorTrain::OperatorViews::Backwards
Definition
backwards.hpp:17
pRC::TensorTrain::OperatorViews::Backwards::core
constexpr decltype(auto) core() const
Definition
backwards.hpp:42
pRC::TensorTrain::OperatorViews::Backwards::Backwards
Backwards(X &&a)
Definition
backwards.hpp:26
pRC::TensorTrain::OperatorViews::Backwards::core
constexpr decltype(auto) core()
Definition
backwards.hpp:34
pRC::TensorTrain::OperatorViews::View
Definition
declarations.hpp:25
pRC::IsSame
Definition
concepts.hpp:28
pRC::TensorTrain::OperatorViews
Definition
declarations.hpp:23
pRC::permute
static constexpr auto permute(Sequence< T, Is... > const)
Definition
sequence.hpp:487
pRC::Conditional
std::conditional_t< B, T, F > Conditional
Definition
basics.hpp:56
sequence.hpp
declarations.hpp
Generated by
1.11.0