cMHN 1.1
C++ library for learning MHNs with pRC
Loading...
Searching...
No Matches
rotate.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: BSD-2-Clause
2
3#ifndef pRC_CORE_TENSOR_FUNCTIONS_ROTATE_H
4#define pRC_CORE_TENSOR_FUNCTIONS_ROTATE_H
5
7
8namespace pRC
9{
10 template<Direction D, Size S = 1, class X, class R = RemoveReference<X>,
11 If<IsTensorish<R>> = 0,
12 If<IsSatisfied<(
13 D == Direction::Leftwards || D == Direction::Rightwards)>> = 0>
14 static inline constexpr auto rotate(X &&a)
15 {
16 return expand(
17 rotate<D, S>(makeSeries<Index, typename R::Dimension{}>()),
18 [&a](auto const... seq)
19 {
20 return permute<seq...>(forward<X>(a));
21 });
22 }
23}
24#endif // pRC_CORE_TENSOR_FUNCTIONS_ROTATE_H
Definition cholesky.hpp:18
static constexpr auto rotate(Sequence< T, First, Is... > const)
Definition sequence.hpp:460
static constexpr auto makeConstantSequence()
Definition sequence.hpp:402
Size Index
Definition type_traits.hpp:21
static constexpr auto makeSeries()
Definition sequence.hpp:351
static constexpr auto permute(Sequence< T, Is... > const)
Definition sequence.hpp:440
static constexpr decltype(auto) expand(Sequence< T, Seq... > const, F &&f, Xs &&...args)
Definition sequence.hpp:344