cMHN 1.1
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{
14 static inline constexpr decltype(auto) restrict(X &&a)
15 {
16 if constexpr(OR == Operator::Restrict::None)
17 {
18 if constexpr(TensorTrain::IsOperator<R>() &&
20 {
21 return eval(forward<X>(a));
22 }
23 else
24 {
25 return view(forward<X>(a));
26 }
27 }
28 else
29 {
30 static_assert(OR != OR, "Unsupported operator restriction.");
31 }
32 }
33}
34#endif // pRC_TENSOR_TRAIN_OPERATOR_FUNCTIONS_RESTRICT_H
Restrict
Definition restrict.hpp:11
Definition cholesky.hpp:18
static constexpr X eval(X &&a)
Definition eval.hpp:11
static constexpr auto makeConstantSequence()
Definition sequence.hpp:402
static constexpr X view(X &&a)
Definition view.hpp:12
static constexpr decltype(auto) restrict(X &&a)
Definition restrict.hpp:14
Definition type_traits.hpp:21