pRC
multi-purpose Tensor Train library for C++
Loading...
Searching...
No Matches
swap.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: BSD-2-Clause
2
3#ifndef pRC_CORE_TENSOR_FUNCTIONS_SWAP_H
4#define pRC_CORE_TENSOR_FUNCTIONS_SWAP_H
5
10
11namespace pRC
12{
22 template<class XA, class XB, class RA = RemoveReference<XA>,
23 class RB = RemoveReference<XB>, If<IsTensorish<RA>> = 0,
24 If<IsInvocable<View, XA>> = 0, If<IsTensorish<RB>> = 0,
25 If<IsInvocable<View, XB>> = 0,
26 If<IsSame<typename RA::Sizes, typename RB::Sizes>> = 0,
27 class EA = ResultOf<XA, typename RA::Subscripts>,
28 class EB = ResultOf<XB, typename RB::Subscripts>,
29 If<IsInvocable<Swap, EA, EB>> = 0>
30 static inline constexpr auto swap(XA &&a, XB &&b)
31 {
33 [&a, &b](auto const... indices)
34 {
36 });
37 }
38}
39#endif // pRC_CORE_TENSOR_FUNCTIONS_SWAP_H
Definition cholesky.hpp:18
static constexpr Conditional< IsSatisfied< C >, RemoveConstReference< X >, X > copy(X &&a)
Definition copy.hpp:13
static constexpr auto swap(XA &&a, XB &&b)
Swaps two Tensors.
Definition swap.hpp:30