cMHN 1.1
C++ library for learning MHNs with pRC
Loading...
Searching...
No Matches
diagonal.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: BSD-2-Clause
2
3#ifndef pRC_CORE_TENSOR_OPERATOR_FUNCTIONS_DIAGONAL_H
4#define pRC_CORE_TENSOR_OPERATOR_FUNCTIONS_DIAGONAL_H
5
10
11namespace pRC
12{
13 template<class X, class R = RemoveReference<X>, If<IsTensorish<R>> = 0,
14 If<IsInvocable<View, X>> = 0,
15 If<IsSatisfied<(isEven(typename R::Dimension()))>> = 0>
16 static inline constexpr auto diagonal(X &&a)
17 {
20 view(forward<X>(a)));
21 }
22
23 template<class X, class R = RemoveReference<X>, If<IsTensorish<R>> = 0,
24 If<Not<IsInvocable<View, X>>> = 0, If<IsInvocable<Diagonal, X &>> = 0>
25 static inline constexpr auto diagonal(X &&a)
26 {
27 return eval(diagonal(a));
28 }
29}
30#endif // pRC_CORE_TENSOR_OPERATOR_FUNCTIONS_DIAGONAL_H
Definition diagonal.hpp:14
Definition cholesky.hpp:18
static constexpr X eval(X &&a)
Definition eval.hpp:11
static constexpr auto makeConstantSequence()
Definition sequence.hpp:402
static constexpr auto diagonal(X &&a)
Definition diagonal.hpp:16
static constexpr X view(X &&a)
Definition view.hpp:12