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