cMHN 1.2
C++ library for learning MHNs with pRC
Loading...
Searching...
No Matches
restrict.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: BSD-2-Clause
2
3#ifndef pRC_TENSOR_TRAIN_OPERATOR_FUNCTIONS_RESTRICT_H
4#define pRC_TENSOR_TRAIN_OPERATOR_FUNCTIONS_RESTRICT_H
5
9
10namespace pRC
11{
12 template<Operator::Restrict OR = Operator::Restrict::None, class X>
13 requires TensorTrain::IsOperatorish<RemoveReference<X>> &&
15 static inline constexpr decltype(auto) restrict(X &&a)
16 {
17 if constexpr(!IsInvocable<View, X>)
18 {
19 return eval(forward<X>(a));
20 }
21 else
22 {
23 return view(forward<X>(a));
24 }
25 }
26}
27#endif // pRC_TENSOR_TRAIN_OPERATOR_FUNCTIONS_RESTRICT_H
Definition concepts.hpp:31
Definition cholesky.hpp:10
static constexpr auto restrict(X &&a)
Definition restrict.hpp:15
static constexpr decltype(auto) view(X &&a)
Definition view.hpp:13
static constexpr decltype(auto) eval(X &&a)
Definition eval.hpp:12