cMHN 1.2
C++ library for learning MHNs with pRC
Loading...
Searching...
No Matches
tensor_product.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: BSD-2-Clause
2
3#ifndef pRC_CORE_TENSOR_FUNCTIONS_TENSOR_PRODUCT_H
4#define pRC_CORE_TENSOR_FUNCTIONS_TENSOR_PRODUCT_H
5
9
10namespace pRC
11{
12 template<class XA, class XB, IsTensorish RA = RemoveReference<XA>,
13 IsTensorish RB = RemoveReference<XB>,
14 class EA = ResultOf<XA, typename RA::Subscripts>,
15 class EB = ResultOf<XB, typename RB::Subscripts>>
16 requires IsInvocable<Mul, EA, EB>
17 static inline constexpr auto tensorProduct(XA &&a, XB &&b)
18 {
20 {
25 decltype(typename RA::Sizes(), typename RB::Sizes()), VA, VB>(
26 view(forward<XA>(a)), view(forward<XB>(b)));
27 }
28 else
29 {
30 return eval(tensorProduct(a, b));
31 }
32 }
33}
34#endif // pRC_CORE_TENSOR_FUNCTIONS_TENSOR_PRODUCT_H
Definition value.hpp:12
Definition tensor_product.hpp:14
Definition concepts.hpp:31
pRC::Float<> T
Definition externs_nonTT.hpp:1
Definition cholesky.hpp:10
std::remove_reference_t< T > RemoveReference
Definition basics.hpp:41
static constexpr decltype(auto) view(X &&a)
Definition view.hpp:13
static constexpr auto tensorProduct(XA &&a, XB &&b)
Definition tensor_product.hpp:17
RemoveConst< RemoveReference< T > > RemoveConstReference
Definition basics.hpp:47
static constexpr decltype(auto) eval(X &&a)
Definition eval.hpp:12