pRC
multi-purpose Tensor Train library for C++
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{
23 template<Direction D, Size S = 1, class X, class R = RemoveReference<X>,
24 If<IsTensorish<R>> = 0,
25 If<IsSatisfied<(
26 D == Direction::Leftwards || D == Direction::Rightwards)>> = 0>
27 static inline constexpr auto rotate(X &&a)
28 {
29 return expand(
30 rotate<D, S>(makeSeries<Index, typename R::Dimension{}>()),
31 [&a](auto const... seq)
32 {
33 return permute<seq...>(forward<X>(a));
34 });
35 }
36}
37#endif // pRC_CORE_TENSOR_FUNCTIONS_ROTATE_H
Definition cholesky.hpp:18
static constexpr auto rotate(Sequence< T, First, Is... > const)
Definition sequence.hpp:470
static constexpr auto makeSeries()
Definition sequence.hpp:361
static constexpr Conditional< IsSatisfied< C >, RemoveConstReference< X >, X > copy(X &&a)
Definition copy.hpp:13
static constexpr auto permute(Sequence< T, Is... > const)
Definition sequence.hpp:450
static constexpr decltype(auto) expand(Sequence< T, Seq... > const, F &&f, Xs &&...args)
forwards the values in a pRC::Sequence to a function as parameters
Definition sequence.hpp:354
Size Index
Definition type_traits.hpp:21