cMHN 1.2
C++ library for learning MHNs with pRC
Loading...
Searching...
No Matches
apply.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: BSD-2-Clause
2
3#ifndef pRC_TENSOR_TRAIN_OPERATOR_FUNCTIONS_APPLY_H
4#define pRC_TENSOR_TRAIN_OPERATOR_FUNCTIONS_APPLY_H
5
13
14namespace pRC
15{
18 Operator::Hint OH = Operator::Hint::None, class XA, class XB,
19 TensorTrain::IsOperatorish RA = RemoveReference<XA>,
20 class RB = RemoveReference<XB>>
21 requires(TensorTrain::IsOperatorish<RB> ||
22 TensorTrain::IsTensorish<RemoveReference<XB>>) &&
23 IsInvocable<Transform<OT>, XA> &&
24 IsInvocable<Mul, ResultOf<Restrict<OR>, ResultOf<Transform<OT>, XA>>,
25 XB>
26 static inline constexpr auto apply(XA &&a, XB &&b)
27 {
28 return restrict<OR>(transform<OT>(forward<XA>(a))) * forward<XB>(b);
29 }
30}
31#endif // pRC_TENSOR_TRAIN_OPERATOR_FUNCTIONS_APPLY_H
Restrict
Definition restrict.hpp:9
Hint
Definition hint.hpp:9
Transform
Definition transform.hpp:9
Definition cholesky.hpp:10
static constexpr auto transform(X &&a)
Definition transform.hpp:15
static constexpr auto restrict(X &&a)
Definition restrict.hpp:15
std::remove_reference_t< T > RemoveReference
Definition basics.hpp:41
static constexpr decltype(auto) apply(JacobiRotation< T > const &r, X &&m, Index const p, Index const q)
Definition jacobi_rotation.hpp:321