pRC
multi-purpose Tensor Train library for C++
Loading...
Searching...
No Matches
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/type_traits.hpp
>
8
#include <
prc/tensor_train/tensor/type_traits.hpp
>
9
10
namespace
pRC::TensorTrain::OperatorViews
11
{
12
template
<
class
T,
class
M,
class
N,
class
Ranks,
class
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
static_assert
(
IsOperatorView<V>
());
19
20
private
:
21
using
Base =
22
Conditional<IsAssignable<V>
,
Assignable<T, M, N, Ranks, Backwards>
,
23
View<T, M, N, Ranks, Backwards>
>;
24
25
public
:
26
template
<
class
X, If<IsSame<V, RemoveReference<X>>> = 0>
27
Backwards
(
X
&&a)
28
: mA(forward<
X
>(a))
29
{
30
}
31
32
using
Base::operator=;
33
34
template
<Index C>
35
constexpr
decltype
(
auto
)
core
()
36
{
37
constexpr
auto
B
=
typename
Base::Dimension() -
C
- 1;
38
39
return
permute<3, 1, 2, 0>
(mA.template
core<B>
());
40
}
41
42
template
<Index C>
43
constexpr
decltype
(
auto
)
core
()
const
44
{
45
constexpr
auto
B
=
typename
Base::Dimension() -
C
- 1;
46
47
return
permute<3, 1, 2, 0>
(mA.template
core<B>
());
48
}
49
50
private
:
51
V
mA;
52
};
53
}
54
#endif
// pRC_TENSOR_TRAIN_OPERATOR_VIEWS_BACKWARDS_H
pRC::TensorTrain::OperatorViews::Assignable
Definition
type_traits.hpp:40
pRC::TensorTrain::OperatorViews::Backwards
Definition
backwards.hpp:17
pRC::TensorTrain::OperatorViews::Backwards::core
constexpr decltype(auto) core() const
Definition
backwards.hpp:43
pRC::TensorTrain::OperatorViews::Backwards::Backwards
Backwards(X &&a)
Definition
backwards.hpp:27
pRC::TensorTrain::OperatorViews::Backwards::core
constexpr decltype(auto) core()
Definition
backwards.hpp:35
pRC::TensorTrain::OperatorViews::View
Definition
type_traits.hpp:37
pRC::TensorTrain::OperatorViews
Definition
type_traits.hpp:35
pRC::copy
static constexpr Conditional< IsSatisfied< C >, RemoveConstReference< X >, X > copy(X &&a)
Definition
copy.hpp:13
pRC::Conditional
std::conditional_t< B{}, T, F > Conditional
Definition
type_traits.hpp:131
sequence.hpp
type_traits.hpp
type_traits.hpp
Generated by
1.9.8