cMHN 1.2
C++ library for learning MHNs with pRC
Loading...
Searching...
No Matches
folding.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: BSD-2-Clause
2
3#ifndef pRC_CORE_TENSOR_FUNCTIONS_FOLDING_H
4#define pRC_CORE_TENSOR_FUNCTIONS_FOLDING_H
5
9
10namespace pRC
11{
12 template<Position P, class X, IsTensorish R = RemoveReference<X>>
13 requires(P == Position::Left) &&
14 IsInvocable<Unfolding<R::Dimension - 2>, X>
15 static inline constexpr auto folding(X &&a)
16 {
17 return unfolding<R::Dimension - 2>(forward<X>(a));
18 }
19
20 template<Position P, class X, IsTensorish R = RemoveReference<X>>
21 requires(P == Position::Right) && IsInvocable<Unfolding<0>, X>
22 static inline constexpr auto folding(X &&a)
23 {
24 return unfolding<0>(forward<X>(a));
25 }
26}
27#endif // pRC_CORE_TENSOR_FUNCTIONS_FOLDING_H
Definition cholesky.hpp:10
static constexpr auto folding(X &&a)
Definition folding.hpp:15
static constexpr auto unfolding(X &&a)
Definition unfolding.hpp:12