cMHN 1.1
C++ library for learning MHNs with pRC
Loading...
Searching...
No Matches
upper_triangular.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: BSD-2-Clause
2
3#ifndef pRC_CORE_TENSOR_OPERATOR_FUNCTIONS_UPPER_TRIANGULAR_H
4#define pRC_CORE_TENSOR_OPERATOR_FUNCTIONS_UPPER_TRIANGULAR_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 upperTriangular(X &&a)
16 {
18 return TensorViews::UpperTriangular<typename R::Type, typename R::Sizes,
19 V>(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<UpperTriangular, X &>> = 0>
25 static inline constexpr auto upperTriangular(X &&a)
26 {
27 return eval(upperTriangular(a));
28 }
29}
30#endif // pRC_CORE_TENSOR_OPERATOR_FUNCTIONS_UPPER_TRIANGULAR_H
Definition upper_triangular.hpp:13
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 upperTriangular(X &&a)
Definition upper_triangular.hpp:15