cMHN 1.1
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_TENSOR_FUNCTIONS_BACKWARDS_H
4#define pRC_TENSOR_TRAIN_TENSOR_FUNCTIONS_BACKWARDS_H
5
9
10namespace pRC
11{
12 template<class X, class R = RemoveReference<X>,
13 If<TensorTrain::IsTensorish<R>> = 0, If<IsInvocable<View, X>> = 0>
14 static inline constexpr auto backwards(X &&a)
15 {
17 using N = decltype(reverse(typename R::N()));
18 using Ranks = decltype(reverse(typename R::Ranks()));
19
20 return TensorTrain::TensorViews::Backwards<typename R::Type, N, Ranks,
21 V>(view(forward<X>(a)));
22 }
23
24 template<class X, class R = RemoveReference<X>,
25 If<TensorTrain::IsTensorish<R>> = 0, If<Not<IsInvocable<View, X>>> = 0>
26 static inline constexpr auto backwards(X &&a)
27 {
28 return eval(backwards(a));
29 }
30}
31#endif // pRC_TENSOR_TRAIN_TENSOR_FUNCTIONS_BACKWARDS_H
Definition backwards.hpp:17
Definition cholesky.hpp:18
static constexpr X eval(X &&a)
Definition eval.hpp:11
static constexpr auto makeConstantSequence()
Definition sequence.hpp:402
static constexpr X view(X &&a)
Definition view.hpp:12
static constexpr auto reverse(Direction const D)
Definition direction.hpp:24
static constexpr auto backwards(X &&a)
Definition backwards.hpp:12