pRC
multi-purpose Tensor Train library for C++
Loading...
Searching...
No Matches
outer_product.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: BSD-2-Clause
2
3#ifndef pRC_CORE_TENSOR_FUNCTIONS_OUTER_PRODUCT_H
4#define pRC_CORE_TENSOR_FUNCTIONS_OUTER_PRODUCT_H
5
11
12namespace pRC
13{
28 template<class XA, class XB, class RA = RemoveReference<XA>,
29 class RB = RemoveReference<XB>, If<IsTensorish<RA>> = 0,
30 If<IsInvocable<View, XA>> = 0, If<IsTensorish<RB>> = 0,
31 If<IsInvocable<View, XB>> = 0, If<IsInvocable<Conj, XA>> = 0,
32 If<IsInvocable<TensorProduct, XA, ResultOf<Conj, XB>>> = 0>
33 static inline constexpr auto outerProduct(XA &&a, XB &&b)
34 {
36 }
37
55 template<class XA, class XB, class RA = RemoveReference<XA>,
56 class RB = RemoveReference<XB>, If<IsTensorish<RA>> = 0,
57 If<IsTensorish<RB>> = 0,
58 If<Not<All<IsInvocable<View, XA>, IsInvocable<View, XB>>>> = 0,
59 If<IsInvocable<OuterProduct, XA &, XB &>> = 0>
60 static inline constexpr auto outerProduct(XA &&a, XB &&b)
61 {
62 return eval(outerProduct(a, b));
63 }
64}
65#endif // pRC_CORE_TENSOR_FUNCTIONS_OUTER_PRODUCT_H
Definition cholesky.hpp:18
static constexpr X eval(X &&a)
Definition eval.hpp:11
static constexpr Conditional< IsSatisfied< C >, RemoveConstReference< X >, X > copy(X &&a)
Definition copy.hpp:13
static constexpr auto outerProduct(XA &&a, XB &&b)
Calculates the outer product of two Tensors.
Definition outer_product.hpp:33
static constexpr auto tensorProduct(XA &&a, XB &&b)
Calculates the tensor product of two Tensors.
Definition tensor_product.hpp:32
static constexpr auto conj(Complex< T > const &a)
Definition conj.hpp:11