cMHN 1.2
C++ library for learning MHNs with pRC
Loading...
Searching...
No Matches
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
8
10{
11 template<class T, class M, class N, class Ranks, class V>
12 requires IsOperatorView<V>
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 =
22
23 public:
24 template<class 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
Definition gtest_unittest.cc:5120
constexpr decltype(auto) core() const
Definition backwards.hpp:42
Backwards(X &&a)
Definition backwards.hpp:26
constexpr decltype(auto) core()
Definition backwards.hpp:34
Definition declarations.hpp:25
Definition concepts.hpp:28
Definition declarations.hpp:23
static constexpr auto permute(Sequence< T, Is... > const)
Definition sequence.hpp:487
std::conditional_t< B, T, F > Conditional
Definition basics.hpp:56