pRC
multi-purpose Tensor Train library for C++
Loading...
Searching...
No Matches
sub.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: BSD-2-Clause
2
3#ifndef pRC_TENSOR_TRAIN_COMMON_FUNCTIONS_SUB_H
4#define pRC_TENSOR_TRAIN_COMMON_FUNCTIONS_SUB_H
5
11
12namespace pRC
13{
14 template<class XA, class XB, class RA = RemoveReference<XA>,
15 class RB = RemoveReference<XB>,
16 If<Any<All<TensorTrain::IsTensorish<RA>, TensorTrain::IsTensorish<RB>>,
17 All<TensorTrain::IsOperatorish<RA>,
18 TensorTrain::IsOperatorish<RB>>>> = 0,
19 If<IsInvocable<Minus, XB>> = 0,
20 If<IsInvocable<Add, XA, ResultOf<Minus, XB>>> = 0>
21 static inline constexpr auto operator-(XA &&a, XB &&b)
22 {
23 return forward<XA>(a) + (-forward<XB>(b));
24 }
25}
26#endif // pRC_TENSOR_TRAIN_COMMON_FUNCTIONS_SUB_H
Definition cholesky.hpp:18
static constexpr auto operator-(Sequence< T, As... > const, Sequence< T, Bs... > const)
Definition sequence.hpp:132
static constexpr Conditional< IsSatisfied< C >, RemoveConstReference< X >, X > copy(X &&a)
Definition copy.hpp:13